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.
From the instructions you linked to, the path /var/lib/postgresql/datawithin the Postgres container is mapped to /volume1/docker/joplinon 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.
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.
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?
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