Joplin Server: self-hosted note sync with Docker

Joplin Server syncs notes between the Joplin apps on your own server. How to run it with PostgreSQL and Docker Compose.

Joplin is a note-taking app for desktop and mobile with Markdown, notebooks, tags, attachments and end-to-end encryption. The apps can sync through several backends. Joplin Server is the project’s own sync server: it is faster than syncing over WebDAV and adds note sharing between users.

The licences differ. The Joplin apps are open source, while Joplin Server is published under the Joplin Server Personal Use License. Read it in the repository before using the server in a company.

What you need

  • A server with Docker and the Compose plugin
  • A domain or subdomain with HTTPS. The apps send your notes to this address, so do not expose it over plain HTTP.

Install

Create a folder with two files. The compose file below is the db and app part of the official docker-compose.server.yml, without the optional transcription service.

APP_BASE_URL=https://joplin.example.com
POSTGRES_PASSWORD=change-me
POSTGRES_DATABASE=joplin
POSTGRES_USER=joplin
POSTGRES_PORT=5432
services:
  db:
    image: postgres:16
    volumes:
      - ./data/postgres:/var/lib/postgresql/data
    restart: unless-stopped
    environment:
      - POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
      - POSTGRES_USER=${POSTGRES_USER}
      - POSTGRES_DB=${POSTGRES_DATABASE}

  app:
    image: joplin/server:latest
    depends_on:
      - db
    ports:
      - "22300:22300"
    restart: unless-stopped
    environment:
      - APP_PORT=22300
      - APP_BASE_URL=${APP_BASE_URL}
      - DB_CLIENT=pg
      - POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
      - POSTGRES_DATABASE=${POSTGRES_DATABASE}
      - POSTGRES_USER=${POSTGRES_USER}
      - POSTGRES_PORT=${POSTGRES_PORT}
      - POSTGRES_HOST=db

APP_BASE_URL must be the exact public address, otherwise the server rejects requests. Point your reverse proxy at port 22300.

Start it:

docker compose up -d

First run

Open your domain. The server creates an admin user with the email admin@localhost and the password admin.

Then create a separate non-admin user on the Users page and use it for syncing. In each Joplin app open Synchronisation in the settings, choose “Joplin Server” as the target and enter the server URL, the email and the password of that user.

Backup

Notes and attachments are in PostgreSQL, in ./data/postgres. Take a database dump rather than copying the folder of a running database.

Updating

docker compose pull && docker compose up -d