This has to be something that others must have encountered. I am losing my head trying to wrap the permissions.
I have Nextcloud setup for myself in an unprivileged LXC container. The data directory for this install is on a FreeNAS server. The way I set it up in the host is as an NFS share
Then in the container i have
Obviously nextcloud is a directory under /mnt/pve/media. This works great -- My nextcloud instance can read/write to the nextcloud data directory (defined as /mnt/freenas/nextcloud in the config.php)
When I check the ownership of the folder from the container I see :
and yet, I don't have any problems reading/writing to that directory from within the container with the www-data user that nextcloud requires.
However, I am now trying to setup a similar Nextcloud instance for a friend. The only difference is that he does not have a separate FreeNAS server and would like to use the other disks in the Proxmox server for the Nextcloud data directory -- However I am getting into the whole permissions hell with this setup
Here's what I have done on the new system:
I set up a lvm partition and then mapped that in the /etc/fstab
Then I chowned the /mnt/data directory and it's sub-directories to the user:group www-data:www-data
Then I added the storage under Datacenter--> Storage as a Directory :
Then in the container I set up a Bind mount using
Then when setting up Nextcloud it complained that it couldn't write to the data directory. I checked the permissions and it was similar to how I have it in my server. The group was nogroup instead of nobody but no other difference.
So for testing, I set up chmod -R 777 on the PVE host. That allowed me to go through the Nextcloud setup and I can see the data written from within the container and also from the host. But now when I try to access Nextcloud from a browser -- it indicates that the permissions are set to 777 and should be changed to 770 --- Of course when I do this, the www-data user can no longer write to that directory and we are back in the same loop
I understand the whole subuid and subgid mapping that is needed --- OR -- I can make the container a Privileged container.
But what I don't understand is -- why does it work on my server and not on the new one? The only difference is using the Nextcloud data directory on theNFS share (for my server) vs the local disk on the Proxmox node itself (for my friend's server)
Please help !!!
I have Nextcloud setup for myself in an unprivileged LXC container. The data directory for this install is on a FreeNAS server. The way I set it up in the host is as an NFS share
Then in the container i have
Obviously nextcloud is a directory under /mnt/pve/media. This works great -- My nextcloud instance can read/write to the nextcloud data directory (defined as /mnt/freenas/nextcloud in the config.php)
When I check the ownership of the folder from the container I see :
and yet, I don't have any problems reading/writing to that directory from within the container with the www-data user that nextcloud requires.
However, I am now trying to setup a similar Nextcloud instance for a friend. The only difference is that he does not have a separate FreeNAS server and would like to use the other disks in the Proxmox server for the Nextcloud data directory -- However I am getting into the whole permissions hell with this setup
Here's what I have done on the new system:
I set up a lvm partition and then mapped that in the /etc/fstab
Code:
/dev/mapper/vg-data /mnt/data ext4 defaults 0 0
Then I added the storage under Datacenter--> Storage as a Directory :
Then in the container I set up a Bind mount using
Code:
mp0: /mnt/data/nextcloud,mp=/mnt/nextcloud
Then when setting up Nextcloud it complained that it couldn't write to the data directory. I checked the permissions and it was similar to how I have it in my server. The group was nogroup instead of nobody but no other difference.
So for testing, I set up chmod -R 777 on the PVE host. That allowed me to go through the Nextcloud setup and I can see the data written from within the container and also from the host. But now when I try to access Nextcloud from a browser -- it indicates that the permissions are set to 777 and should be changed to 770 --- Of course when I do this, the www-data user can no longer write to that directory and we are back in the same loop
I understand the whole subuid and subgid mapping that is needed --- OR -- I can make the container a Privileged container.
But what I don't understand is -- why does it work on my server and not on the new one? The only difference is using the Nextcloud data directory on theNFS share (for my server) vs the local disk on the Proxmox node itself (for my friend's server)
Please help !!!
Last edited: