Help with Nextcloud docker installation with NFS hosted data directory reddit / selfhosted ---------------------------------------------------------------------- CarrotManMatt · 2023-12-29 03:55 I have a TrueNAS server running with a storage pool & NFS share. In the AccessControlList of the storage pool, the user is set as \`www- data\` & group of \`www-data\` (See attached image). This is a user & a group I have manually created in TrueNAS with a UID & GID of 33. This is to match with the inner user within the Nextcloud docker container that accesses this data. I then have the Nextcloud docker container running on a separate machine with the NFS share mounted as a volume inside the container at \`/media/carrotmanmatt\_nas\_files\`. The data directory for Nextcloud is then set to this path, so that theoretically my Nextcloud files will be streamed over from the NAS while the local config files are stored in a separate volume stored on the docker host (See \`docker- compose.yaml\`). I have then run \`docker exec --user root nextcloudapp chmod -R 755 /media/carrotmanmatt\_nas\_files\` & \`docker exec --user root nextcloudapp chown -R www-data:www-data /media/carrotmanmatt\_nas\_files\` to ensure all files are owned by the nextcloud user. To be clear I run the Nextcloud Docker container on a seperate host from the NAS using Portainer. When I then run the Nextcloud container, I can successfully create the first admin user, but then when trying to access the main dashboard it just shows this error: \`\`\` Internal Server Error The server encountered an internal error and was unable to complete your request. Please contact the server administrator if this error reappears multiple times, please include the technical details below in your report. More details can be found in the server log. \`\`\` The log file could not be attached here, so are available here: [https://help.nextcloud.com/t/nfs-hosted-data- directory/177713](https://help.nextcloud.com/t/nfs-hosted-data- directory/177713) https://preview.redd.it/8r4mli9tp59c1.jpg?width=676&format=pjpg&auto=w ebp&s=a20278924e0404bdbd963d522ab647b094b1e73f docker-compose.yaml \`\`\`yaml version: "3" services: nextcloudapp: image: nextcloud:apache restart: unless-stopped container\_name: nextcloudapp hostname: nextcloudapp volumes: * data:/var/www/html * carrotmanmatt\_nas\_files:/media/carrotmanmatt\_nas\_files environment: * MYSQL\_DATABASE=nextcloud * MYSQL\_USER=nextcloud * MYSQL\_PASSWORD=\*\*\*\*\* * MYSQL\_HOST=nextclouddb * REDISHOST=nextcloudredis * APACHE\_DISABLE\_REWRITE\_IP=1 * NEXTCLOUD\_DATA\_DIR=/media/carrotmanmatt\_nas\_files/data depends\_on: * nextclouddb * nextcloudoffice * nextcloudredis networks: * frontend * backend nextcloudoffice: image: collabora/code:latest container\_name: nextcloudoffice hostname: nextcloudoffice restart: unless-stopped cap\_add: * MKNOD environment: aliasgroup1: "https://files.carrotmanmatt.com:443" server\_name: [office.carrotmanmatt.com](http://office.carrotmanmatt.com/) networks: * frontend nextclouddb: image: mariadb container\_name: nextclouddb hostname: nextclouddb restart: unless-stopped environment: * MYSQL\_RANDOM\_ROOT\_PASSWORD=\*\*\*\*\* * MYSQL\_USER=nextcloud * MYSQL\_PASSWORD=\*\*\*\*\* * MYSQL\_DATABASE=nextcloud volumes: * db:/var/lib/mysql networks: * backend nextcloudredis: image: redis:alpine container\_name: nextcloudredis hostname: nextcloudredis restart: unless-stopped networks: * backend nextcloudcron: image: nextcloud:apache container\_name: nextcloudcron restart: unless-stopped volumes: * data:/var/www/html * carrotmanmatt\_nas\_files:/media/carrotmanmatt\_nas\_files environment: * NEXTCLOUD\_DATA\_DIR=/media/carrotmanmatt\_nas\_files/data entrypoint: /cron.sh depends\_on: * nextclouddb * nextcloudredis networks: * backend volumes: data: carrotmanmatt\_nas\_files: driver: local driver\_opts: type: nfs o: "username=www-data,password=\*\*\*\*\*,addr=192.168.1.20,rw" device: ":/mnt/main-pool/CarrotManMatt/Nextcloud/" db: networks: frontend: name: proxy-apps external: true backend: \`\`\` Any help would be greatly appreciated & feel free to ask questions for more information ---------------------------------------------------------------------- Square_Lawfulness_33 · 2023-12-29 04:55 I think your doing too much with the --user flag. let the docker container set the permissions on its own.