Can't write into config directory

I am using a raspberry pi 4 with Bullseye OS and I loaded nextcloud using docker. I get the famous “Error Can’t write into config directory! This can usually be fixed by giving the webserver write access to the config directory.”
Despite all what I have read, I a still stuck. Can somebody tell me which command I need to run (I am not an expert at all…) in order to resolve that issue.
Below is the portion of docker-compose.yml file that installs NV:

container_name: nextcloud
image: nextcloud
restart: unless-stopped
- MYSQL_HOST=nextcloud_db
- MYSQL_DATABASE=nextcloud
- MYSQL_USER=nextcloud
- “9321:80”
- /media/pi/TEYADI/mariadb/config:/var/www/html
- nextcloud_db
- default
- nextcloud

Thanks much !

Since you’re using a folder as your volume (what’s called a bind mount in Docker), you’re responsible for all permissions and file ownership matters.


The above is your data volume for your Nextcloud container. Can you see who owns that folder (and all folders above it for that matter) and the permissions? That folder will need to be freely writable (well, and readable) by UID 33 (aka: www-data).

P.S. Unrelated, but I recommend adding a version tag to your image if you want to avoid your container upgrading or breaking unexpectedly (check the image README or Docker Hub page for specifics):

image: nextcloud

Thanks much jtr, I appreciate your help to a newbie !

1 Like