Self-Hosted Apps

    Deploy Docmost Wiki

    An open-source, self-hosted wiki and documentation platform with real-time collaborative editing, structured spaces, and built-in diagram support.

    What Is Docmost?

    Docmost is an open-source, self-hosted wiki and documentation platform that gives you real-time collaborative editing, structured spaces, granular permissions, and built-in diagram support - all running on a server you control. It's one of the cleaner Confluence alternatives available right now, and it deploys cleanly on a RamNode VPS in under 30 minutes.

    System Requirements

    • • RamNode VPS with at least 2GB RAM (the $6/month SSD KVM plan works well for small teams)
    • • Ubuntu 22.04 LTS
    • • A domain name or subdomain pointed at your server's IP (e.g., wiki.yourdomain.com)
    • • Root or sudo SSH access

    Docmost runs as a Docker Compose stack with three containers: the Docmost app, PostgreSQL 16, and Redis 7.2.

    1

    Update the System and Install Docker

    SSH into your VPS and get the system up to date:

    Update system
    apt update && apt upgrade -y

    Install dependencies and add Docker's official GPG key:

    Install Docker dependencies
    apt install -y ca-certificates curl gnupg lsb-release
    
    install -m 0755 -d /etc/apt/keyrings
    curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg
    chmod a+r /etc/apt/keyrings/docker.gpg
    
    echo \
      "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] \
      https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | \
      tee /etc/apt/sources.list.d/docker.list > /dev/null

    Install Docker Engine:

    Install Docker
    apt update
    apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

    Verify and enable Docker:

    Verify and enable
    docker --version
    docker compose version
    systemctl enable docker
    systemctl start docker
    2

    Create the Project Directory

    Create a dedicated directory and pull the official Docker Compose template:

    Create directory
    mkdir -p /opt/docmost
    cd /opt/docmost
    
    curl -O https://raw.githubusercontent.com/docmost/docmost/main/docker-compose.yml
    3

    Configure Environment Variables

    Generate secrets for your deployment:

    Generate secrets
    # Generate APP_SECRET (32+ characters)
    openssl rand -hex 32
    
    # Generate database password
    openssl rand -base64 24

    Edit docker-compose.yml with your values:

    docker-compose.yml
    services:
      docmost:
        image: docmost/docmost:latest
        depends_on:
          - db
          - redis
        environment:
          APP_URL: 'https://wiki.yourdomain.com'
          APP_SECRET: 'your_generated_hex_secret_here'
          DATABASE_URL: 'postgresql://docmost:your_db_password@db:5432/docmost?schema=public'
          REDIS_URL: 'redis://redis:6379'
        ports:
          - "3000:3000"
        restart: unless-stopped
        volumes:
          - docmost:/app/data/storage
      db:
        image: postgres:16-alpine
        environment:
          POSTGRES_DB: docmost
          POSTGRES_USER: docmost
          POSTGRES_PASSWORD: your_db_password
        restart: unless-stopped
        volumes:
          - db_data:/var/lib/postgresql/data
      redis:
        image: redis:7.2-alpine
        restart: unless-stopped
        volumes:
          - redis_data:/data
    
    volumes:
      docmost:
      db_data:
      redis_data:
    4

    Start the Containers

    From the /opt/docmost directory, bring the stack up:

    Start containers
    docker compose up -d

    Check that all three are running:

    Check status
    docker compose ps

    You should see docmost, db, and redis all showing as Up.

    5

    Install Nginx and Certbot

    Install Nginx and Certbot:

    Install Nginx & Certbot
    apt install -y nginx certbot python3-certbot-nginx
    6

    Create the Nginx Server Block

    Create a new configuration file:

    /etc/nginx/sites-available/docmost
    server {
        listen 80;
        server_name wiki.yourdomain.com;
    
        location / {
            proxy_pass http://localhost:3000;
            proxy_http_version 1.1;
    
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection 'upgrade';
            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_cache_bypass $http_upgrade;
            proxy_read_timeout 86400s;
            proxy_send_timeout 86400s;
        }
    }

    The extended timeouts are important for WebSockets used in real-time collaboration.

    Enable the site:

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

    Obtain an SSL Certificate

    Run Certbot to get a free Let's Encrypt certificate:

    Certbot
    certbot --nginx -d wiki.yourdomain.com

    When asked whether to redirect HTTP to HTTPS, choose yes (option 2).

    Test renewal:

    Test renewal
    certbot renew --dry-run
    8

    Complete Setup in the Browser

    Open https://wiki.yourdomain.com in your browser. You'll be taken to the Docmost setup screen where you'll create your first workspace, enter your name, email address, and password to set up the admin account.

    Optional — Configure Email (SMTP)

    Without SMTP, Docmost cannot send email invitations or password reset emails. Add these environment variables to the docmost service:

    Add to docker-compose.yml
    MAIL_DRIVER: smtp
    SMTP_HOST: 'smtp.yourmailprovider.com'
    SMTP_PORT: '587'
    SMTP_USERNAME: 'your@email.com'
    SMTP_PASSWORD: 'yourpassword'
    MAIL_FROM_ADDRESS: 'wiki@yourdomain.com'
    MAIL_FROM_NAME: 'Your Wiki'

    Restart to apply changes:

    Restart container
    docker compose up -d --force-recreate docmost

    Optional — S3-Compatible Storage

    By default, Docmost stores uploaded files locally. To use S3-compatible object storage, add these variables:

    Add to docker-compose.yml
    STORAGE_DRIVER: s3
    AWS_S3_ACCESS_KEY_ID: 'your-access-key'
    AWS_S3_SECRET_ACCESS_KEY: 'your-secret-key'
    AWS_S3_REGION: 'us-east-1'
    AWS_S3_BUCKET: 'your-bucket-name'
    # For S3-compatible providers, also set:
    AWS_S3_ENDPOINT: 'https://s3.yourprovider.com'

    Restart to apply:

    Restart container
    docker compose up -d --force-recreate docmost

    Backup Strategy

    To dump the database to a file:

    Database backup
    docker compose exec db pg_dump -U docmost docmost > /opt/docmost/backup-$(date +%Y%m%d).sql

    For automated daily backups, add a cron entry:

    Cron entry
    0 2 * * * root docker compose -f /opt/docmost/docker-compose.yml exec -T db pg_dump -U docmost docmost > /opt/docmost/backup-$(date +%Y%m%d).sql

    To back up uploaded file storage:

    Files backup
    docker run --rm \
      -v docmost_docmost:/data \
      -v /opt/docmost/backups:/backups \
      alpine tar czf /backups/docmost-files-$(date +%Y%m%d).tar.gz -C /data .

    Managing the Stack

    Useful commands
    # Pull the latest Docmost image and restart
    docker compose pull
    docker compose up -d
    
    # View live logs
    docker compose logs -f docmost
    
    # Stop the stack
    docker compose down
    
    # Restart just the app container
    docker compose restart docmost
    
    # Firewall - ensure ports 80/443 are open
    ufw allow 'Nginx Full'
    ufw deny 3000

    Troubleshooting

    Container shows Exit or Restarting

    Check the logs to diagnose the issue:

    Check logs
    docker compose logs docmost
    docker compose logs db

    Common causes: incorrect APP_SECRET format (must be hex), or database password mismatch.

    WebSocket connection issues

    Ensure Nginx proxy_read_timeout is set to 86400s and that the Upgrade/Connection headers are present in the Nginx config.

    Cannot send email invitations

    Verify SMTP settings in docker-compose.yml and check the Docmost logs for SMTP errors.