Install Joplin on Synology nas (Docker)

Hi again!
As you can read here joplin-server should have a speed advantage over WebDAV. I do not know how much it matters because I have not tested Joplin with WebDAV but I think it is a good opportunity to learn using Docker. I am running Bitwarden, Tandoor Recipes, Piwigo, mariaDB, joplin-server and Adminer as Docker containers on my Synology DS216+II.

Here is the content of of my docker-compose.yml:

version: '3'

services:
    db:
        image: postgres:latest # Download latest postgres image
        container_name: postgres # Here you can give the container a name of your liking 
#        ports:
#            - 5433:5432 # Expose internal docker port 5432 to external port 5433. Not necessary if you do not want to use the database from outside docker.
        restart: unless-stopped # Restart if not stopped manually
        volumes:
            - ./joplin-data:/var/lib/postgresql/data # Make database files persistent. Otherwise your data is lost when the container is destroyed.
        environment:
            - APP_PORT=22300 # Specify port joplin-server is reachable at
            - POSTGRES_PASSWORD=joplin # Specify database password
            - POSTGRES_USER=joplin # Specify database user
            - POSTGRES_DB=joplin # Specify database name
    app:
        image: joplin/server:latest # Download latest joplin-server image
        depends_on:
            - db
        ports:
            - "22300:22300" # Expose internal port to LAN
        restart: unless-stopped
        environment:
            - APP_BASE_URL=https://YOURDOMAIN.org # If you do not want to expose joplin-server to the internet use your LAN-IP and port
            - DB_CLIENT=pg
            - POSTGRES_PASSWORD=joplin # Must be the same as above
            - POSTGRES_DATABASE=joplin # Must be the same as above
            - POSTGRES_USER=joplin # Must be the same as above
            - POSTGRES_PORT=5432 # Postgres internal port
            - POSTGRES_HOST=db

After installing Docker you should find a folder named docker. I recommend you create a folder structure named /joplin-server/joplin-data in /volume1/docker. In /volume1/docker/joplin-server you create a file docker-compose.yml and copy the content of the code section above into it. You can do this in your browser and by using the Synology app Text-Editor.
SSH into your NAS, then you run sudo docker-compose pull and sudo docker-compose up -d in /volume1/docker/joplin-data. If everything is okay you should be able to log in to YOURNASLANIP:22300/login. Then you only have to read this and change the syncronization method in your Joplin app. CAUTION! Read the FAQ before changing syncronisation target!!!
To update type sudo docker-compose stop, then sudo docker-compose pull and sudo docker-compose up -d.

2 Likes