Independent testing Updated April 2026 387 self-hosting guides 5 VPS providers tested

guide

How to Self-Host Docmost on a VPS (2026 Guide)

Step-by-step guide to self-hosting Docmost on a VPS with Docker Compose, PostgreSQL, Redis, and Nginx reverse proxy. Includes first-login walkthrough.

How to Self-Host Docmost on a VPS (2026 Guide)

Docmost is an open-source collaborative wiki and documentation platform. Self-hosting it on a VPS gives you complete data ownership, a custom domain, and no per-seat fees. This guide covers the full setup from a fresh Ubuntu VPS to a running Docmost instance with SSL and Nginx.

Prerequisites

Before starting, you need:

Recommended VPS providers:

Step 1: Provision Your VPS

Spin up a fresh Ubuntu 22.04 VPS. SSH in as root:

ssh root@your-server-ip

Create a non-root user with sudo privileges (recommended):

adduser deploy
usermod -aG sudo deploy

Step 2: Install Docker and Docker Compose

# Update system
apt update && apt upgrade -y

# Install Docker
curl -fsSL https://get.docker.com | sh

# Add your user to the docker group
usermod -aG docker deploy

# Verify installation
docker --version
docker compose version

Log out and back in for group changes to take effect.

Step 3: Create the Docmost Directory

mkdir -p /opt/docmost
cd /opt/docmost

Step 4: Write the Docker Compose File

Create /opt/docmost/docker-compose.yml:

version: '3'
services:
  docmost:
    image: docmost/docmost:latest
    ports:
      - "3000:3000"
    environment:
      DATABASE_URL: postgresql://docmost:password@db:5432/docmost
      REDIS_URL: redis://redis:6379
    depends_on:
      - db
      - redis
    restart: unless-stopped
  db:
    image: postgres:16
    environment:
      POSTGRES_USER: docmost
      POSTGRES_PASSWORD: password
      POSTGRES_DB: docmost
    volumes:
      - pg_data:/var/lib/postgresql/data
    restart: unless-stopped
  redis:
    image: redis:7
    volumes:
      - redis_data:/data
    restart: unless-stopped
volumes:
  pg_data:
  redis_data:

Security note: Replace password with a strong, randomly generated password before deploying.

Step 5: Start Docmost

cd /opt/docmost
docker compose up -d

Check that all containers are running:

docker compose ps

You should see docmost, db, and redis all in running state. Check logs if something fails:

docker compose logs docmost

Step 6: Install and Configure Nginx

apt install nginx -y

Create /etc/nginx/sites-available/docmost:

server {
    listen 80;
    server_name docs.yourdomain.com;
    return 301 https://$host$request_uri;
}

server {
    listen 443 ssl;
    server_name docs.yourdomain.com;

    ssl_certificate /etc/letsencrypt/live/docs.yourdomain.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/docs.yourdomain.com/privkey.pem;

    client_max_body_size 100M;

    location / {
        proxy_pass http://localhost:3000;
        proxy_http_version 1.1;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_read_timeout 86400;
    }
}

Enable the site:

ln -s /etc/nginx/sites-available/docmost /etc/nginx/sites-enabled/
nginx -t
systemctl reload nginx

Step 7: Obtain SSL Certificate

apt install certbot python3-certbot-nginx -y
certbot --nginx -d docs.yourdomain.com

Follow the prompts. Certbot will automatically update your Nginx config with the certificate paths and set up auto-renewal.

Step 8: Configure Firewall

ufw allow OpenSSH
ufw allow 'Nginx Full'
ufw enable

Do not expose port 3000 directly โ€” all traffic should flow through Nginx.

Step 9: First Login and Workspace Setup

  1. Open https://docs.yourdomain.com in your browser
  2. You will see the Docmost setup wizard on first visit
  3. Create your admin account (email + password)
  4. Name your workspace
  5. Create your first space (e.g., โ€œEngineeringโ€, โ€œProductโ€, โ€œHRโ€)
  6. Invite team members via the Settings panel

Updating Docmost

To pull the latest image and restart:

cd /opt/docmost
docker compose pull
docker compose up -d

Backup Strategy

Back up PostgreSQL data regularly:

docker exec docmost-db-1 pg_dump -U docmost docmost > backup_$(date +%Y%m%d).sql

Also back up the Docker volume at /var/lib/docker/volumes/docmost_pg_data.

Troubleshooting

IssueFix
Containers not startingCheck docker compose logs for errors
502 Bad GatewayDocmost may still be initializing โ€” wait 30s and retry
WebSocket errorsEnsure Upgrade and Connection headers are in Nginx config
DB connection refusedCheck DATABASE_URL matches Postgres container credentials

Next Steps

For VPS provider comparisons, see selfhostvps.com/en/best/.