Skip to content

Instantly share code, notes, and snippets.

@ghazanhaider
Created February 22, 2026 06:07
Show Gist options
  • Select an option

  • Save ghazanhaider/3c1a09be62e9a9859263eb37fbc2c359 to your computer and use it in GitHub Desktop.

Select an option

Save ghazanhaider/3c1a09be62e9a9859263eb37fbc2c359 to your computer and use it in GitHub Desktop.
Installing Joplin Server on Amazon Linux 2023
sudo yum install docker
sudo systemctl start docke
sudo systemctl enable docker.service
sudo usermod -aG docker $USER
sudo curl -SL https://github.com/docker/compose/releases/latest/download/docker-compose-linux-$(uname -m) -o /usr/libexec/docker/cli-plugins/docker-compose
sudo chmod +x /usr/libexec/docker/cli-plugins/docker-compose
docker compose version
# Shows: "Docker Compose version v5.0.2"
cat <<EOF > docker-compose.yml
version: '3'
services:
db:
restart: unless-stopped
image: postgres:17.8
ports:
- "5432:5432"
volumes:
- /data/joplin-data:/var/lib/postgresql/data
environment:
- POSTGRES_PASSWORD=CHANGEME
- POSTGRES_USER=joplin
- POSTGRES_DB=joplin
app:
environment:
- APP_BASE_URL=https://YOUR-DOMAIN.COM/joplin
- APP_PORT=22300
- POSTGRES_PASSWORD=CHANGEME
- POSTGRES_DATABASE=joplin
- POSTGRES_USER=joplin
- POSTGRES_PORT=5432
- POSTGRES_HOST=db
- DB_CLIENT=pg
restart: unless-stopped
image: joplin/server:latest
ports:
- "22300:22300"
depends_on:
- db
EOF
# Change "YOUR-DOMAIN.COM" (ghazan.dev in my case) and "CHANGEME"x2 in the above file
sudo yum install nginx
# Edit /etc/nginx/nginx.conf, uncomment the server block that handles ssl
# For both 80 and 443 server blocks, change server_name = ghazan.dev (your domain name)
# Do not start nginx yet, certs do not yet exist
# Do not install certbot using yum!
sudo python3 -m venv /opt/certbot/
sudo /opt/certbot/bin/pip install --upgrade pip
sudo /opt/certbot/bin/pip install certbot certbot-nginx
sudo ln -s /opt/certbot/bin/certbot /usr/local/bin/certbot
sudo certbot certonly --nginx
sudo certbot install --cert-name ghazan.dev
# If this last line gives an error, manually update the two cert lines in /etc/nginx/nginx.conf:
sudo vi /etc/nginx/nginx.conf
"""
ssl_certificate "/etc/letsencrypt/live/ghazan.dev/fullchain.pem";
ssl_certificate_key "/etc/letsencrypt/live/ghazan.dev/privkey.pem";
"""
sudo systemctl start nginx
sudo systemctl enable nginx.service
# Test https://YOURDOMAIN.com to ensure ssl is functional
# Test https://YOURDOMAIN.com/joplin and login as admin@localhost password: admin and change the login/password
# Built upon this original document:
# https://discourse.joplinapp.org/t/guide-for-joplin-server-on-raspberry-pi/14702
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment