Nextcloud on OpenWrt without container - is it possible?

I have an x86-based router with plenty of memory (8GB) and plenty of storage space 120GB just to act as a basic personal storage. My idea is to host a nextcloud instance on it so I can sync my photos and files from another devices when away. I am planning to expose the server only to LAN devices and connect to my LAN externally via VPN, that part is clear. However, I am unsure how to install nextcloud as there are couple of things I want to consider.

First, I do not wish to use a container, since I will be exposing it to LAN only anyway and since I want the maximum performance with least overhead. Is this even possible?

Secondly, kind of a following on my previous thread where I asked about Attended System Upgrade and resizing of rootfs - since the maximum available option is 4GB when choosing the ASU server, I am not sure if and how any future upgrades will handle the extra partition where I will be storing my files.

Yes, I had one running like this and basically just went through the examples in the documentation the nextcloud team provides to set it up.

Download: https://nextcloud.com/install/#community-projects
under "Archive" you'll get it.

I use an (K)Ubuntu, mariaDB and Apache2

So to be clear, it doesn't run on OpenWrt?

(I'm just curious on how OpenWrt is related to the setup.)

I am having trouble with php8 specifically php8-mod-mbstring and libonig:

root@OpenWrt:~# /etc/init.d/php8-fpm restart

[19-May-2026 18:39:06] NOTICE: PHP message: PHP Warning:  PHP Startup: Unable to load dynamic library 'mbstring.so' (tried: /usr/lib/php8/mbstring.so (Error loading shared library libonig.so.5: No such file or directory (needed by /usr/lib/php8/mbstring.so)), /usr/lib/php8/mbstring.so.so (Error loading shared library /usr/lib/php8/mbstring.so.so: No such file or directory)) in Unknown on line 0


root@OpenWrt:~# ls -l /usr/lib/libonig*

lrwxrwxrwx    1 root     root            25 May 19 18:13 /usr/lib/libonig.so.5 -> /usr/lib/libonig.so.5.5.0

there is a symlink pointing to a non-existent file in the same dir. Tried reinstalling oniguruma5 but no effect.

EDIT: it has been reported here:

I did manage to download libonig.so.5.3.0 externally and it kinda works... Kinda... Because php is giving a lot of issues, with some more fiddling I got to the index.php of Nextcloud
But I could not get past it, for some reason, I could not create and administration account.

After a lot of time spent bashing my head against the wall, I did manage to make it work.

For anyone stumbling upon this, these are the php packages I had to install

php8-8.4.16-r4 x86_64 {feeds/packages/feeds/packages/lang/php8} (PHP-3.01) [installed]
php8-cgi-8.4.16-r4 x86_64 {feeds/packages/feeds/packages/lang/php8} (PHP-3.01) [installed]
php8-cli-8.4.16-r4 x86_64 {feeds/packages/feeds/packages/lang/php8} (PHP-3.01) [installed]
php8-fastcgi-8.4.16-r4 x86_64 {feeds/packages/feeds/packages/lang/php8} (PHP-3.01) [installed]
php8-fpm-8.4.16-r4 x86_64 {feeds/packages/feeds/packages/lang/php8} (PHP-3.01) [installed]
php8-mod-ctype-8.4.16-r4 x86_64 {feeds/packages/feeds/packages/lang/php8} (PHP-3.01) [installed]
php8-mod-curl-8.4.16-r4 x86_64 {feeds/packages/feeds/packages/lang/php8} (PHP-3.01) [installed]
php8-mod-dom-8.4.16-r4 x86_64 {feeds/packages/feeds/packages/lang/php8} (PHP-3.01) [installed]
php8-mod-fileinfo-8.4.16-r4 x86_64 {feeds/packages/feeds/packages/lang/php8} (PHP-3.01) [installed]
php8-mod-filter-8.4.16-r4 x86_64 {feeds/packages/feeds/packages/lang/php8} (PHP-3.01) [installed]
php8-mod-gd-8.4.16-r4 x86_64 {feeds/packages/feeds/packages/lang/php8} (PHP-3.01) [installed]
php8-mod-intl-8.4.16-r4 x86_64 {feeds/packages/feeds/packages/lang/php8} (PHP-3.01) [installed]
php8-mod-mbstring-8.4.16-r4 x86_64 {feeds/packages/feeds/packages/lang/php8} (PHP-3.01) [installed]
php8-mod-mysqli-8.4.16-r4 x86_64 {feeds/packages/feeds/packages/lang/php8} (PHP-3.01) [installed]
php8-mod-mysqlnd-8.4.16-r4 x86_64 {feeds/packages/feeds/packages/lang/php8} (PHP-3.01) [installed]
php8-mod-opcache-8.4.16-r4 x86_64 {feeds/packages/feeds/packages/lang/php8} (PHP-3.01) [installed]
php8-mod-openssl-8.4.16-r4 x86_64 {feeds/packages/feeds/packages/lang/php8} (PHP-3.01) [installed]
php8-mod-pcntl-8.4.16-r4 x86_64 {feeds/packages/feeds/packages/lang/php8} (PHP-3.01) [installed]
php8-mod-pdo-8.4.16-r4 x86_64 {feeds/packages/feeds/packages/lang/php8} (PHP-3.01) [installed]
php8-mod-pdo-mysql-8.4.16-r4 x86_64 {feeds/packages/feeds/packages/lang/php8} (PHP-3.01) [installed]
php8-mod-phar-8.4.16-r4 x86_64 {feeds/packages/feeds/packages/lang/php8} (PHP-3.01) [installed]
php8-mod-session-8.4.16-r4 x86_64 {feeds/packages/feeds/packages/lang/php8} (PHP-3.01) [installed]
php8-mod-simplexml-8.4.16-r4 x86_64 {feeds/packages/feeds/packages/lang/php8} (PHP-3.01) [installed]
php8-mod-xml-8.4.16-r4 x86_64 {feeds/packages/feeds/packages/lang/php8} (PHP-3.01) [installed]
php8-mod-xmlreader-8.4.16-r4 x86_64 {feeds/packages/feeds/packages/lang/php8} (PHP-3.01) [installed]
php8-mod-xmlwriter-8.4.16-r4 x86_64 {feeds/packages/feeds/packages/lang/php8} (PHP-3.01) [installed]
php8-mod-zip-8.4.16-r4 x86_64 {feeds/packages/feeds/packages/lang/php8} (PHP-3.01) [installed]
php8-pecl-imagick-3.8.0_rc2-r1 x86_64 {feeds/packages/feeds/packages/lang/php8-pecl-imagick} (PHP-3.01) [installed]
php8-pecl-redis-6.1.0-r1 x86_64 {feeds/packages/feeds/packages/lang/php8-pecl-redis} (PHP-3.01) [installed]

I am also using mariadb and nginx-full

A couple of things:

.so files are by default installed into /usr/lib/php8 but the php8-fpm is looking for them for some reason in /usr/lib/php

Also, running the php8-fpm init using

/etc/init.d/php8-fpm start

did not work for me, nginx would always tell me nginx No input file specified. Instead, I had to run the binary:

/usr/bin/php8-fpm -F -c /etc/php8-fpm.conf

I will later edit the init script to use that one instead

The next part is where I was stuck for a long time because I would be able to set up an administrator account but after that the page would end up in a loop with absolutely nothing in the logs to show what was causing this.

But after some fiddling and following the nextcloud documentation when setting up the

/etc/nginx/conf.d/nextcloud.conf

I got it working.

The ugly part: app store does not work. This is the error in the log:

cURL error 61: Unrecognized content encoding type (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://garm2.nextcloud.com/api/v1/apps.json

Alas, I do not think this can be fixed because of the way curl for OpenWrt is compiled, it is pretty barebones.
If someone has suggestions, I would gladly hear them but it seems Nextcloud for OpenWrt without a proper container is not a good idea.

Actually I managed to get the AppStore working! You can edit the Fetcher.php and add this:

$options['headers'] = [
    'Accept-Encoding' => 'deflate, identity',
];

just after

$options = [
    'timeout' => (int)$this->config->getAppValue('settings', 'appstore-timeout', '120')
];

So in conclusion, Nextcloud can definitely run on OpenWrt without a container. Of course, you'd still need a decent amount of memory, storage and CPU resources so I guess it would be fine for x86 users but not so much with other users.

I use nginx + php + postgresql + redis for nextcloud. I don't have the issues you mentioned except app store.

In the past, I fixed the app store issue by editing client.php - change encode type from gzip to identity. A few months ago, I compiled curl and libcurl4 myself with LIBCURL_ZLIB enabled. After installing my own curl package, I don't have to change anything on nextcloud setup.

Did you install it from archive? Also, is it possible to compile curl and libcurl4 natively without having to reflash the whole system? I thought I had to create a custom image which kinda put me off due to the fact that I already had configured the rest of the system and I did not really want to bother doing it all over again.

As for the appstore, there is another way to avoid encoding, which is to disable gzip in nginx configuration globally.

does not have to reflash the whole system. Just install self-compiled curl4 package either using luci or cli