Joplin Server Docker doesn't work with mapped drives

Operating system


Joplin version


Sync target

Joplin Server

What issue do you have?

Docker Joplin Server won't utilize external drives.

I've beat my head on this for weeks now.

I've run through the setup process so many times that I've bumped into the LetsEncrypt weekly cert limit.

My compose-docker file looks like this:

		restart: unless-stopped
		image: postgres:latest
		- "5432:5432"
		- /mnt/joplin-data/:/var/lib/postgresql/data
		- POSTGRES_PASSWORD=mypassword
		- POSTGRES_USER=joplin
		- POSTGRES_DB=joplin
		- APP_PORT=22300
		- POSTGRES_PASSWORD=mypassword
		- POSTGRES_USER=joplin
		- DB_CLIENT=pg
		restart: unless-stopped
		image: etechonomy/joplin-server:latest
		- "22300:22300"
		- db'''

Where /mnt/joplin-data is mounted via /etc/fstab like this:

// /mnt/joplin-data cifs credentials=/home/username/cifs.creds

The mount works perfectly fine, but when running sudo docker compose down, sudo docker compose pull, sudo docker compose up, I get this:

It's complaining "could not change permissions of directory "/var/lib/postgresql/data": Operation not supported".

So, removing the mount statement from /etc/fstab and rebooting. I put a copy of the Joplin data files in a local folder named /mnt/joplin-data.

I do a sudo docker compose down, sudo docker compose pull, sudo docker compose up, and I get this:

And everything is fine. The server works, yadda, yadda, yadda. Trouble is it's stored locally and this isn't the biggest SD Card in the world.

Here's where it get's really weird.

If I do the mount from the command line: sudo mount -t cifs -o credentials=/home/username/cifs.creds // /mnt/joplin-data, it still works.

Until it get's rebooted and it all goes to foo-foo.

So, I'm reaching out for assistance.

What have I gotten wrong?




I am working at the edge of my knowledge here so this is more some thoughts rather than a solution.

When you access // via /mnt/joplin-data directly from your docker RasPi it has write permissions for the SMB shared folder (//

When you map that share (via /mnt/joplin-data) to /var/lib/postgresql/data in the Postgresql container, the container is using the share as if it were /var/lib/postgresql/data.

Note the error does NOT say that the operation is not supported but that the operation is not permitted. It also says that /var/lib/postgresql/data has wrong ownership and that the server must be started by the user that owns the data directory.

As @MrKanister pointed out in the other thread the Postgresql container writes to /var/lib/postgresql/data as user 999, which is the postgres user within the postgres container. I am wondering if the write fails with Operation not permitted is because user 999 has no write permissions for the // SMB share.

So although the Postgresql container thinks it is writing to /var/lib/postgresql/data it is actually writing to // and user 999 is not allowed?

As a test, what happens if /homes/chris/Joplin on is set to allow writes from anyone?

The other possible alternative is to try mounting an NFS share on as /mnt/joplin-data on your RasPi. I believe that NFS shares do not use the same kind of permissions as SMB and access is authorised using the IP address of the connecting machine (your docker RasPi).

As stated above I am more thinking this through with you than offering definite solutions.

If anyone more knowledgeable can shed light on what is happening please put us right...

1 Like


If I change from a CIFS mount to a NFS mount, it seems to work.


1 Like

Glad you solved it.