Install nextCloud on RPI4

Hi,

Try to setup nextcloud on rpi4 openwrt 22.03.3. Following the wiki

[OpenWrt Wiki] ownCloud or NextCloud

it seems there are several mistakes when I run lighttpd start:

2023-03-29 12:07:14: (../src/configfile.c.1287) WARNING: unknown config-key: server.error-log-use-syslog (ignored)
2023-03-29 12:07:14: (../src/configfile.c.1287) WARNING: unknown config-key: dir-listing.activate (ignored)

I changed server.error-log-use-syslog to server.errorlog-use-syslog and delete the following lines in the lighttpd.conf:

$HTTP["url"] =~ "^($|/)" {
	dir-listing.activate = "disable"
}

I am able to start lightpd without error.

However when I proceed to next step installing php7, it does not find the package. I believe it is no longer use php7.

it seems the wiki is very old already and it only listed ownclound installation. If someone has setup next cloud on openwrt recently, please share.

Thanks

After spending some time, I finally make nextcloud working on openwrt. I share my experience below:

mkdir /www/nextcloud
opkg update
opkg install lighttpd lighttpd-mod-cgi lighttpd-mod-fastcgi lighttpd-mod-access
opkg install php8 php8-cgi php8-fastcgi php8-mod-fpm php8-mod-bcmath php8-mod-calendar php8-mod-ctype php8-mod-curl php8-mod-dom php8-mod-exif php8-mod-fileinfo php8-mod-filter php8-mod-ftp php8-mod-gd php8-mod-gettext php8-mod-gmp php8-mod-iconv php8-mod-imap php8-mod-intl php8-mod-ldap php8-mod-mbstring php8-mod-mysqlnd php8-mod-openssl php8-mod-pdo php8-mod-pdo-mysql php8-mod-pdo-pgsql php8-mod-pdo-sqlite php8-mod-pgsql php8-mod-phar php8-mod-session php8-mod-simplexml php8-mod-sqlite3 php8-mod-xml php8-mod-xmlreader php8-mod-xmlwriter php8-mod-zip php8-pecl-mcrypt php8-pecl-redis
#some of the packages may not needed, but I just install them all

Edit the config-file /etc/lighttpd/lighttpd.conf

server.document-root = "/www/nextcloud"
server.errorlog-use-syslog = "enable"
server.port = 81

server.modules = (
	"mod_access",
	"mod_fastcgi",
	"mod_cgi"
)

$HTTP["url"] =~ "^/data/" {
	url.access-deny = ("")
}
index-file.names = ( "index.php", "index.html", "default.html", "index.htm", "default.htm" )
static-file.exclude-extensions = (".php, ".pl", ".fcgi")
fastcgi.server = (
	".php" => ((
		"bin-path" => "/usr/bin/php-fcgi",
		"socket" => "/tmp/php.socket",
		"max-procs" => 1
	))
)

save and reboot the router.

Now you can either use automatic setup or manual setup.

I use automatic setup:

cd /www/nextcloud
wget https://download.nextcloud.com/server/installer/setup-nextcloud.php

Now open the browser and type the address http://192.168.10.1:81/setup-nextcloud.php(I use 192.168.10.1 as my router address and port 81 for lighttpd). It will open the installation page.
here you can enter your installation path or just enter "." to use /www/nextcloud. Click next to download the nextcloud files and the installer will set all the permissions to the folders and files. Wait until the setup is complete and then you can click next to open the login page. Create admin account by enter the admin username and password and then click install.

that is all. After installation completed, you are able to login and configure users etc.
After that, you can change to https and open port for external access.
Install nextcloud app from apple store or google play, you can use it on mobile devices.

see the files and folders permissions below:

1 Like

Thanks for posting the steps to get a working config!

FYI: that warning goes away in lighttpd 1.4.68+
mod_dirlisting not loaded if dir-listing.activate not enabled
so the warning was spurious trace.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.