Setting up a Joplin Server with Docker
So far, I have synced my Joplin database with Nextcloud to be able to use it on different clients. Since there is a Joplin Server available, I moved over to this.
Subdomain
I use the subdomain joplin on my local Network and set up a CNAME record in Pi-hole DNS, so the Name joplin.example.com is resolved to my Docker host.
Traefik Proxy takes care of the forwarding to the Docker container and the SSL-Certificate.
Setting up the Server in Docker
File: docker-compse.yml
version: '3'
services:
db:
image: postgres:13
volumes:
- ./postgres:/var/lib/postgresql/data
ports:
- "5432:5432"
restart: unless-stopped
environment:
- POSTGRES_PASSWORD=**********
- POSTGRES_USER=joplin
- POSTGRES_DB=joplin
networks:
- joplin
app:
image: joplin/server:latest
depends_on:
- db
ports:
- "22300:22300"
restart: unless-stopped
environment:
- APP_PORT=22300
- APP_BASE_URL=https://joplin.example.com
- DB_CLIENT=pg
- POSTGRES_PASSWORD=**********
- POSTGRES_DATABASE=postgres
- POSTGRES_USER=joplin
- POSTGRES_PORT=5432
- POSTGRES_HOST=db
networks:
- proxy
- joplin
labels:
- "traefik.enable=true"
- "traefik.http.routers.joplin.entrypoints=http"
- "traefik.http.routers.joplin.rule=Host(`joplin.example.com`)"
- "traefik.http.middlewares.joplin-https-redirect.redirectscheme.scheme=https"
- "traefik.http.routers.joplin.middlewares=joplin-https-redirect"
- "traefik.http.routers.joplin-secure.entrypoints=https"
- "traefik.http.routers.joplin-secure.rule=Host(`joplin.example.com`)"
- "traefik.http.routers.joplin-secure.tls=true"
- "traefik.http.routers.joplin-secure.service=joplin"
- "traefik.http.services.joplin.loadbalancer.server.port=22300"
- "traefik.docker.network=proxy"
networks:
proxy:
external: true
joplin:
external: false
Configuration
At first the password of the default admin user has to be changed. To do so I login with user admin@localhost and password admin.
Next, I create a user account that I use for the actual synchronization in the Joplin Client.
Setup the new synchronisation target
With the new user account the synchronization target in the Joplin Client can now be changed.
Because the sync destination is still empty, I use the option Re-upload local data to sync target in the advanced settings.
If everything has worked, more Joplin clients can be switched to the new target. But then use the normal synchronization instead of the re-upload.