/media/usr/dati is a mount point for my sdb1 HD, and /var/www/html/data/usr/files is where Next Cloud saves the user data. I specified this volume because I want that Next Cloud manages all the data using my sdb1 HD.
unfortunately when I try to configure Next Cloud, something wrong happens, and from the login web page, I can’t do anything (see the attached screenshot).
if I don’t use the -v option this error doesn’t exist, so I think that, maybe, the issue is something like permissions, … it seems that Next Cloud is not able to write on sdb1 HD, but I don’t know why. how can I solve thi issue?
For addressing the “Cannot create or write into the data directory” issue with Nextcloud in Docker:
Check Directory Permissions: Ensure that the directory on the host you’re linking to the Docker container has the correct permissions. Use ls -l /path/to/directory to view permissions and adjust with chmod and chown if necessary, so the Docker process has access.
Use --user Flag in Docker: Start the container with the --user flag to specify the User ID (UID) and Group ID (GID) for the container process. This aligns the container’s permissions with those of the directory owner. Example: docker run --user $(id -u):$(id -g) ... to run the container with the current user’s UID and GID.
and like always - search helps - lot of issues have been discussed already!
this is not the right mount destination. From the docs you see
/var/www/html/ folder where all Nextcloud data lives
you want to persist more than files only e.g. config is essential
Nextcloud runs by default with user 33:33 I would recommend to assign this user and correct permissions (folders:750, files: 640) to all data mounted into NC container. Newer versions can run with a different UID but this requires more tweaking.