Docker server deletes all data when NAS reboots. (Postgres storage volume is outside the container.)

Operating system


Joplin version


Sync target

Joplin Server

What issue do you have?

I am running a Joplin docker server on an Asustor NAS.
Users are created, syncing works perfectly.
When the NAS reboots all data is lost, and the server reverts to default login.
The compose file is based very much on the example on github.
The db volume is working. I can enter the container console and verify that the postgres files are on the NAS file system.
image: postgres:16
- ./data/postgres:/var/lib/postgresql/data

What needs to be done to make the Joplin server data persistent?

The volumes: statement was wrong. The statement I used, from numerous example compose files, did not work in Portainer. I suspect that it does work using docker commandline tools. In portainer the data was in the correct place and persistent (on my Asustor NAS) using:
- /volume1/docker/joplin/data/postgres:/var/lib/postgresql/data

1 Like