Does anyone have setup instructions for the IX catalog Nextcloud app that will work if you want it put your data in a HOST path???
I have not made a new video in a while for setting up Nextcloud on TrueNAS because it just keeps breaking with updates.
I had it working in version 23.x But, going to 24 broke it and I have never gotten it to install since unless I didn’t use host paths. It seems even worse in version 25, now it just crashes without even leaving a error message or log. Thank you for all your great videos. . .
This may not be the simplest answer but what I do is I use docker compose and bind mount to the data sets I want to use. It never breaks this way, with TrueNAS updates. Here’s my docker compose if it helps.
services:
nextcloud:
image: nextcloud
container_name: nextcloud
restart: unless-stopped
networks:
- frontend
- nextcloud
depends_on:
- nextclouddb
- redis
ports:
- 9080:80 # 9080 was an unused port on my setup. Use whatever port you want
volumes:
- /mnt/fast_pool/nc/html:/var/www/html #change data to the left of the colon to match your dataset
- /mnt/fast_pool/nc/data:/mnt/ncdata #change data to the left of the colon to match your dataset. I moved user data out of the default location so I can manage the dataset separately
environment:
- PUID=1000
- PGID=1000
- TZ=America/New_York
- NEXTCLOUD_DATA_DIR=/mnt/ncdata
- MYSQL_DATABASE=nextcloud
- MYSQL_USER=nextcloud
- MYSQL_PASSWORD=password
- MYSQL_HOST=nextclouddb
- REDIS_HOST=redis
nextclouddb:
image: mariadb:11.4
container_name: nextcloud-db
restart: unless-stopped
command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
networks:
- nextcloud
volumes:
- /mnt/fast_pool/nc/db:/var/lib/mysql #change data to the left of the colon to match your dataset
environment:
- PUID=1000
- PGID=1000
- TZ=America/New_York
- MYSQL_ROOT_PASSWORD=supersecretpassword
- MYSQL_PASSWORD=password
- MYSQL_DATABASE=nextcloud
- MYSQL_USER=nextcloud
redis:
image: redis:alpine
container_name: redis
restart: unless-stopped
volumes:
- /mnt/fast_pool/nc/redis:/data #change data to the left of the colon to match your dataset
networks:
- nextcloud
networks:
frontend:
external: true # this is a pre-created network that I put Nginx proxy manager on. Skip this network if you don't use a proxy manager
nextcloud:
external: true # I created this network first, so that Docker-Compose wouldn't create it by default, just because I prefer to do the naming
Thank you for this suggestion. Would you please share the ACL permissions for the datasets you used in this setup. I have seen so many permissions and owner ship suggestions I have NO idea what would be appropriate at this point.
Sure. All data sets are set to “generic” type. The data volume (if you use a separate one like I do) and the HTML volume need to be owned by the www-data user (UID 33, GID 33). The database volume and the redis volume need to be owned by the netdata user /docker group (UID 999, GID 999)
Here’s how I set up Nginx proxy manager as well. I changed my TrueNAS web UI to use ports 8080 and 8443, so I could use 80 and 443 for Nginx. Don’t forget that you will need to create the nextcloud network manually or alter the docker compose file for Nextcloud to create it there. BTW a lot of this can be done with Portainer, if you install it on your system. Again, you may want to do this outside of the TrueNAS app catalog and just do it from the command line. Its very easy. The volumes for Nginx can be owned by any user. I don’t bind mount the volume for Portainer.
services:
nginx-proxy:
image: 'jc21/nginx-proxy-manager:latest'
container_name: nginx-proxy
environment:
- PUID=1000
- PGID=1000
- TZ=America/New_York
restart: unless-stopped
networks:
- frontend
ports:
- '80:80'
- '81:81'
- '443:443'
volumes:
- /mnt/fast_pool/nginx/data:/data
- /mnt/fast_pool/nginx/letsencrypt:/etc/letsencrypt
networks:
frontend:
name: frontend
Thanks for the permissions info. Looks like what I was expecting, but I’ve wasted so much time trying to get Nextcloud running with Host storage I didn’t want to go down another rabbit hole. I have been using portainer for a while on my Truenas system, it sure helped clean up some of the orphan junk I’ve had left over from my Nextcloud battles. . . I REALLY appreciate your help with a usable working example.
You’re welcome. Just note one other thing: I took out the section of my compose file for the Collabora container. It was giving me so much grief, and I decided I didn’t need to use the Nextcloud office/collaboration functions for my small set up. You can just slot this into your Nextcloud docker compose if you want.
collabora:
image: collabora/code
container_name: collabora
restart: unless-stopped
networks:
- nextcloud
environment:
- PUID=1000
- PGID=1000
- TZ=America/New_York
- password=password
- username=nextcloud
- domain=collabora.mydomain.com
- extra_params=--o:ssl.enable=true
ports:
- 9980:9980