Help setting up correct permissions for ZFS dataset mounted to Nextcloud LXC container

z1nonly

New Member
Oct 14, 2025
1
0
1
Hi everyone, new to Proxmox here so bear with me.

I'm trying to set up a NextcloudPi instance using the Proxmox Helper Scripts. I can get the instance up and running, but am having trouble mounting a ZFS dataset to the container and moving the ncdata directory to it. I've attached as much information as I can below, but let me know if you need anything else. Thanks!

System specs:
  • HP EliteDesk 800 G4 SFF
  • Intel i5-8500
  • 8GB RAM
  • 2x 8TB SAS drives connected via HBA card
Software specs:
  • Linux kernel 6.14.11-3-pve
  • PVE 9.0.10
  • NextcloudPi 1.55.4



  1. Following this guide, created a new user (justin) and group (tank) on the host with UID 101000 and GID 110000.
  2. Created a ZFS dataset at tank/nextcloud and set permissions using chown -R justin:tank /tank/nextcloud.
  3. Created the NextcloudPi LXC container using the helper script here.
  4. Activate the NCP instance from the web panel.
  5. In the NCP web panel, run the setup wizard and setup external access (installs fail2ban).
  6. Mount the ZFS dataset to the container using pct set 201 --mp0 /tank/nextcloud,mp=/mnt/nextcloud.
  7. In the NCP LXC, create the group tank with GID 10000, and assign www-data and ncp to it.
  8. Set www-data and ncp default group to tank using usermod -g tank [username].
  9. In the NCP web panel from the nc-datadir panel, try to change the datadir directory to /mnt/nextcloud.
  10. Change fails. Error #1 below.
  11. As ncp (sudo -u ncp bash), create /mnt/nextcloud/ncdata/data.
  12. Change fails. Error #2 below.
  13. ncdata directory is now owned by root:root.
Error #1:
Code:
[ nc-datadir ] (Tue Oct 14 02:01:26 EDT 2025)
data directory /mnt/nextcloud/ncdata/data not found

Error #2:
Code:
[ nc-datadir ] (Tue Oct 14 02:05:29 EDT 2025)
INFO: /mnt/nextcloud/ncdata is not empty. Creating backup /mnt/nextcloud/ncdata-10-14-25.1760421929
{"reqId":"mCtu2TmqpzfkGDpeMnbg","level":2,"time":"2025-10-14T06:05:29+00:00","remoteAddr":"","user":false,"app":"no app in context","method":"","url":"--","message":"Temporary directory /mnt/nextcloud/ncdata/data/tmp is not present or writable","userAgent":"--","version":"31.0.2.1","data":[]}
{"reqId":"mCtu2TmqpzfkGDpeMnbg","level":2,"time":"2025-10-14T06:05:29+00:00","remoteAddr":"","user":false,"app":"no app in context","method":"","url":"--","message":"Temporary directory /mnt/nextcloud/ncdata/data/tmp is not present or writable","userAgent":"--","version":"31.0.2.1","data":[]}
{"reqId":"AdxSYkk4oSt54CFSjO1N","level":2,"time":"2025-10-14T06:05:29+00:00","remoteAddr":"","user":false,"app":"no app in context","method":"","url":"--","message":"Temporary directory /mnt/nextcloud/ncdata/data/tmp is not present or writable","userAgent":"--","version":"31.0.2.1","data":[]}
{"reqId":"AdxSYkk4oSt54CFSjO1N","level":2,"time":"2025-10-14T06:05:29+00:00","remoteAddr":"","user":false,"app":"no app in context","method":"","url":"--","message":"Temporary directory /mnt/nextcloud/ncdata/data/tmp is not present or writable","userAgent":"--","version":"31.0.2.1","data":[]}
Your data directory is invalid.
Ensure there is a file called ".ncdata" in the root of the data directory. It should have the content: "# Nextcloud data directory"

Cannot create "data" directory.
This can usually be fixed by giving the web server write access to the root directory. See https://docs.nextcloud.com/server/31/go.php?to=admin-dir_permissions

An unhandled exception has been thrown:
Exception: Environment not properly prepared. in /var/www/nextcloud/lib/private/Console/Application.php:143
Stack trace:
#0 /var/www/nextcloud/console.php(81): OC\Console\Application->loadCommands()
#1 /var/www/nextcloud/occ(33): require_once('...')
#2 {main}
 
Last edited: