Nextcloudpi as an image won't function properly on quadra, as the firmware is very different, and it's designed for a Raspberry Pi SBC. HOWEVER.. In addition to Alexander's excellent post, if you're like me and not the best at LAMP/LEMP stack ins and outs (or if it's too much of a hassle), I can offer you yet another alternative to run NC on quadra/T95 On my quadra,I have it running syncing my phone (photos, videos, calendar), with a few users.. CPU temp is at about 50 C at about 20% of RAM without a fan (although full disclosure, I do have it standing on end next to my SATA enclosure, all of which is 2 feet from a drafty window)
TLDR - I was able to get NC running on a quadra with an external SATA enclosure running an old 1TB HDD. I did it using Docker and Docker Compose (bind-mounting the external drive). It saved me the steps of setting up a LAMP/LEMP and it doesn't suck (the overhead of the docker daemon wasn't a show-stopper). For those who would like to know more about my adventure (and maybe try it out yourself), read on for details.
I have a domain name with my DNS name servers at Cloudflare using their free tier. I'm using Cloudflare Zero Trust tunnel daemon (cloudflared) to act as a reverse proxy (I'm happy to share how to set that up with anyone who needs it).
1. I installed docker engine. Docker website has a convenient install script if you wish to use it
2. Used fdisk-l to locate the HDD partition (/dev/sda1), mounted it.$ sudo mkdir -p /media/hdd && sudo chmod 775 /media/hdd && sudo mount /dev/sda1 /media/hdd
3. Created the directories I would need to run Nextcloud, and the Docker Compose file
$ cd /media/hdd
$ mkdir -p nextcloud data db apps config
$ nano compose.yml
4. I wrote the following Docker Compose that you can use if you wish
services:
db:
image: mariadb:10.6
restart: always
command: --transaction-isolation=READ-COMMITTED --log-bin=binlog --binlog-format=ROW
volumes:
- /media/hdd/db:/var/lib/mysql:z
environment:
- MARIADB_AUTO_UPGRADE=1
- MARIADB_DISABLE_UPGRADE_BACKUP=1
- MYSQL_ROOT_PASSWORD=<root-password>
- MYSQL_PASSWORD=<db-password>
- MYSQL_DATABASE=nextcloud
- MYSQL_USER=nextcloud
redis:
image: redis:alpine
restart: always
app:
image: nextcloud:latest
container_name: nextcloud
restart: always
ports:
- 8080:80 # The left number is the port that is visible to the proxy/LAN and can be modified to suit your needs. If using cloudflare tunnel, use this port number to specify this service (localhost:8080) The right number should not be changed.
depends_on:
- db
- redis
volumes:
- /media/hdd/nextcloud:/var/www/html:z
- /media/hdd/apps:/var/www/html/custom_apps
- /media/hdd/config:/var/www/html/config
- /media/hdd/data:/var/www/html/data
environment:
- MYSQL_PASSWORD=<db-password>
- MYSQL_DATABASE=nextcloud
- MYSQL_USER=nextcloud
- MYSQL_HOST=db
- NEXTCLOUD_TRUSTED_DOMAINS= nextcloud.example.com <ip address if necessary> localhost 172.0.0.1 inovato.local #list all the ways you would call up this instance
- OVERWRITEPROTOCOL=http #for reverse proxy
5. Run sudo docker compose up -d.
6. **known "issue" with cron and background jobs**. By default, background jobs in nextcloud are set to ajax - which is less than ideal. It's recommended to use a system cron service to call "cron.php" as user "www-data". You CAN try to do it using systemd and make a service like nextcloudcron.service and nextcloudcron.timer, but I found it much easier to use systrem cron. To schedule a cron using the container user "www-data", run
Then add the cron entry at the bottom of the file. This passes the user option through the docker command. At 5 minute intervals, the system will run a docker command on the nextcloud container, telling the container to execute the file "cron.php" as the webserver user.
*/5 * * * * docker exec -u www-data nextcloud php -f /var/www/html/cron.php
7. You may get notification in your administrative settings warning you that your using an http port and that HSTS is not set. If you are using cloudflare tunnel or a reverse proxy such as nginx proxy manager, the SSL/https is handled by those services.
8. Enjoy the rest of the adventure with your nextcloud instance. To update nextcloud, go to the directory where you saved your compose.yml file. run
$ sudo docker pull nextcloud:latest
Remove the containers and old application image (your data is preserved in the bind mounts in the "nextcloud" "db" "apps" "config" directories)
$ sudo docker compose down && sudo docker image prune
Power it all back up with
$ sudo docker compose up -d