Problems with running joplin server in docker on a synology NAS

Operating system

Linux

Joplin version

3.0.9

Desktop version info

Joplin server

Sync target

Joplin Server

Editor

Markdown Editor

What issue do you have?

I try to setup a joplin server in a docker container on my NAS. I followed the guide from How to Install Joplin on Your Synology NAS – Marius Hosting, but I keep getting errors on the postgres container as following, and the container stops.

initdb: hint: If you want to create a new database system, either remove or empty the directory "/var/lib/postgresql/data" or run initdb with an argument other than "/var/lib/postgresql/data".
initdb: error: directory "/var/lib/postgresql/data" exists but is not empty

I've connected to the NAS with SSH, but the directory at the path above doesn't exist.

Any suggestions what to do?

@bonkers welcome to the forum.

From the instructions you linked to, the path /var/lib/postgresql/data within the Postgres container is mapped to /volume1/docker/joplin on your NAS. So when Postgres in its container looks at the content of /var/lib/postgresql/data it actually sees the contents of /volume1/docker/joplin on your NAS.

volumes:
  - /volume1/docker/joplin:/var/lib/postgresql/data:rw

For the error you are seeing try checking the contents of the /volume1/docker/joplin folder.

I've deleted the folder several times and started from scratch, but the message remains, I've also tried to use another folder but with the same result. When I log in with SSH I've no right to access the filesystem of the container to check if its empty. When I check the directoy from file explorer in Synology it contains only the .yaml file from the docker project.

I was trying with different docker compose files so I'm afraid the there are some remains of an old attemt, but I can't find anything. I've also deactivated the trash bin in synology, but still the same.

/volume1/docker/joplin contains the docker yaml file for Joplin Server?

I have never set up Joplin Server on a Synology NAS so I am guessing that the problem is the compose yaml file being in the folder dedicated to the Postgres database. Postgres is expecting an empty folder. Portainer should be storing these yaml files in its own dedicated folder.

When you set up Portainer did you give it its own folder (/volume1/docker/portainer) like in the tutorial or did you use the Joplin folder (/volume1/docker/joplin) for Portainer as well?

To be honest with you I did not follow the instructions on MariusHosting exactly. I tried to use Container-Manager on Synology instead of Portainer. I changed that now and followed the guide exactly and now the two containers are running without problems.

Only Problem I have now is I'm not able to connect to my server, nor from local or outside via DDNS.

1 Like

Unfortunately, using a Synology NAS as a reverse proxy with wildcard certificates and Synology DDNS for a docker-based application is something I have no experience of.

Maybe someone else on the forum who has installed Joplin on a Synology NAS can help?

1 Like

My reverse proxy settings are as follows:

Quelle
Protokoll: https
Hostname: joplinapp.mydomain.de
Port: 443
HSTS: :heavy_check_mark:

Ziel
Protokoll: http
Hostname: localhost (type this word and do not use the local IP)
Port: 22300

Benutzerdefinierte Kopfzeile
Erstellen / WebSocket

Has been working flawlessly ever since. Concerning the docker.yaml, I have strictly followed Mariusβ€˜ instructions also.

2 Likes

My reverse proxy settings are quite the same, with the help of Marius I was able to connect local via IP, but I'm still struggling via DDNS.

Which ports are you forwarding on your router?
Do you had to setup something under Web-Station?

Right now I'm able to connect to my NAS via DDNS but don't get to my joplin container.

I'm pretty much in the same situation here, other containers like bitwarden work fine locally and with DDNS but Joplin doesn't work either way..

EDIT: I created a new folder data in the joplin folder and changed the PG_DATA of the DB container variable to /volume1/docker/joplin/data and now it seems to work..

Also I didn't use portainer, I just set it up as a container manager project

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.