Last updated: 27 May 25 12:47:01 (Europe/Berlin)
Setup Joplin Server w/ Docker
Setup Joplin Server w/ Docker
- Create a directory for Joplin and a data directory:
mkdir joplin cd joplin mkdir data mkdir data/data chown 1001:1001 data/data
mkdir joplin
cd joplin
mkdir data
mkdir data/data
chown 1001:1001 data/data- Create the Docker
compose.ymlfile with this contents:
services:
db:
image: postgres:16-alpine
container_name: joplin_db
env_file: .env
volumes:
- ./data/postgres:/var/lib/postgresql/data
restart: unless-stopped
app:
image: joplin/server:latest
env_file: .env
container_name: joplin_app
volumes:
- ./data/data:/home/joplin/data
depends_on:
- db
ports:
- "127.0.0.1:22300:22300"
restart: unless-stoppedservices:
db:
image: postgres:16-alpine
container_name: joplin_db
env_file: .env
volumes:
- ./data/postgres:/var/lib/postgresql/data
restart: unless-stopped
app:
image: joplin/server:latest
env_file: .env
container_name: joplin_app
volumes:
- ./data/data:/home/joplin/data
depends_on:
- db
ports:
- "127.0.0.1:22300:22300"
restart: unless-stopped- Create the environment file
.envwith the following contents and make adaptations according to your needs (see comments).
APP_BASE_URL=https://joplin.example.com # TODO: Replace with your own URL. APP_PORT=22300 DB_CLIENT=pg POSTGRES_PASSWORD=joplin POSTGRES_DATABASE=joplin POSTGRES_USER=joplin # TODO: You might want to choose a more secure password. POSTGRES_PORT=5432 POSTGRES_HOST=db MAILER_ENABLED=1 MAILER_HOST=smtp.example.com # TODO: Replace with your SMTP server. MAILER_PORT=587 MAILER_SECURITY=starttls # Options: none, ssl, starttls MAILER_AUTH_USER=SMTP_Username # TODO: Replace with your SMTP user name. MAILER_AUTH_PASSWORD=SMTP_Password # TODO: Replace with your SMTP password. MAILER_NOREPLY_NAME=Joplin MAILER_NOREPLY_EMAIL=noreply@example.com # TODO: Replace with your email. STORAGE_DRIVER="Type=Filesystem; Path=/home/joplin/data" STORAGE_DRIVER_FALLBACK="Type=Database; Mode=ReadAndWrite" TZ=Europe/Berlin # TODO: You might want to change this to your time zone.
APP_BASE_URL=https://joplin.example.com # TODO: Replace with your own URL.
APP_PORT=22300
DB_CLIENT=pg
POSTGRES_PASSWORD=joplin
POSTGRES_DATABASE=joplin
POSTGRES_USER=joplin # TODO: You might want to choose a more secure password.
POSTGRES_PORT=5432
POSTGRES_HOST=db
MAILER_ENABLED=1
MAILER_HOST=smtp.example.com # TODO: Replace with your SMTP server.
MAILER_PORT=587
MAILER_SECURITY=starttls # Options: none, ssl, starttls
MAILER_AUTH_USER=SMTP_Username # TODO: Replace with your SMTP user name.
MAILER_AUTH_PASSWORD=SMTP_Password # TODO: Replace with your SMTP password.
MAILER_NOREPLY_NAME=Joplin
MAILER_NOREPLY_EMAIL=noreply@example.com # TODO: Replace with your email.
STORAGE_DRIVER="Type=Filesystem; Path=/home/joplin/data"
STORAGE_DRIVER_FALLBACK="Type=Database; Mode=ReadAndWrite"
TZ=Europe/Berlin # TODO: You might want to change this to your time zone.- Start the Joplin Docker containers with this command;
docker compose up -d
docker compose up -d- If needed, configure your reverse proxy. Here is an example for Caddy2. Add these lines into the
Caddyfile. Make sure to changejoplin.example.comso that it is identical to theAPP_BASE_URLin the.envFile.
joplin.example.com {
reverse_proxy localhost:22300
}joplin.example.com {
reverse_proxy localhost:22300
}-
Open the website
https://joplin.example.comand log in as administrator with the initial credentials:- Username:
admin@localhost - Password:
admin
- Username:
- Make sure you change the admin username and password to the values of your choice. A confirmation email will be sent asking to confirm the new administrator email address. Click on the link provided in the email to confirm.