How to Self-Host Docmost with Docker Compose

What Is Docmost?

Docmost is an open-source collaborative wiki and documentation platform — a self-hosted alternative to Confluence and Notion. It features real-time collaboration, a block-based editor with slash commands, nested page hierarchies, and workspace/space organization. It’s written in TypeScript and licensed under AGPL-3.0.

Official site: docmost.com | GitHub: docmost/docmost

Prerequisites

  • A Linux server (Ubuntu 22.04+ recommended)
  • Docker and Docker Compose installed (guide)
  • 2 GB of free RAM (minimum)
  • 5 GB of free disk space
  • A domain name (recommended for HTTPS access)

Docker Compose Configuration

Create a docker-compose.yml file:

services:
  docmost:
    image: docmost/docmost:v0.25.3
    depends_on:
      - db
      - redis
    environment:
      APP_URL: "${APP_URL}"
      APP_SECRET: "${APP_SECRET}"
      DATABASE_URL: "postgresql://docmost:${DB_PASSWORD}@db:5432/docmost?sslmode=disable"
      REDIS_URL: "redis://redis:6379"
    ports:
      - "3000:3000"
    restart: unless-stopped
    volumes:
      - docmost_data:/app/data/storage

  db:
    image: postgres:16-alpine
    environment:
      POSTGRES_DB: docmost
      POSTGRES_USER: docmost
      POSTGRES_PASSWORD: "${DB_PASSWORD}"
    restart: unless-stopped
    volumes:
      - db_data:/var/lib/postgresql/data
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U docmost"]
      interval: 10s
      timeout: 5s
      retries: 5

  redis:
    image: redis:7-alpine
    command: ["redis-server", "--appendonly", "yes", "--maxmemory-policy", "noeviction"]
    restart: unless-stopped
    volumes:
      - redis_data:/data
    healthcheck:
      test: ["CMD", "redis-cli", "ping"]
      interval: 10s
      timeout: 5s
      retries: 5

volumes:
  docmost_data:
  db_data:
  redis_data:

Create a .env file alongside:

# URL where Docmost is accessible (include protocol, no trailing slash)
APP_URL=https://wiki.example.com

# Secret key for session encryption — generate with: openssl rand -hex 32
APP_SECRET=CHANGE_ME_GENERATE_WITH_OPENSSL_RAND_HEX_32

# Database password — use a strong random string
DB_PASSWORD=CHANGE_ME_STRONG_DB_PASSWORD

Start the stack:

docker compose up -d

Initial Setup

  1. Open your browser and navigate to http://your-server-ip:3000 (or your configured domain).
  2. Docmost shows a registration page on first access. Create your admin account with email and password.
  3. Set your workspace name. This is the organization-level container for all your content.
  4. You’re now in the editor. Create your first space (a content area within the workspace) and start adding pages.

Configuration

Key Environment Variables

VariableRequiredDescription
APP_URLYesFull URL where Docmost is accessed. Must match exactly.
APP_SECRETYesEncryption key. Minimum 32 characters. Generate with openssl rand -hex 32.
DATABASE_URLYesPostgreSQL connection string.
REDIS_URLYesRedis connection string.
MAIL_DRIVERNoEmail driver: smtp or postmark. Required for invitations.
SMTP_HOSTNoSMTP server hostname.
SMTP_PORTNoSMTP port (587 for TLS).
SMTP_USERNAMENoSMTP authentication username.
SMTP_PASSWORDNoSMTP authentication password.
MAIL_FROM_ADDRESSNoSender email address.
MAIL_FROM_NAMENoSender display name.

SMTP Configuration

Email is optional but needed for user invitations and password resets. Add these to your .env:

MAIL_DRIVER=smtp
SMTP_HOST=smtp.example.com
SMTP_PORT=587
SMTP_USERNAME=your-smtp-user
SMTP_PASSWORD=your-smtp-password
MAIL_FROM_ADDRESS=[email protected]
MAIL_FROM_NAME=Docmost

Advanced Configuration (Optional)

S3 Storage

By default, Docmost stores file uploads locally in the docmost_data volume. For S3-compatible storage:

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=docmost-files
AWS_S3_ENDPOINT=https://s3.amazonaws.com  # or MinIO/Garage endpoint

Disable Registration

After creating your admin account, disable public registration to prevent unauthorized signups. This is managed through the workspace settings in the web UI under Settings → General.

Reverse Proxy

Docmost uses WebSocket for real-time collaboration. Your reverse proxy must support WebSocket passthrough.

Nginx Proxy Manager: Create a proxy host pointing to docmost:3000. Enable WebSocket support in the advanced settings.

For manual Nginx configuration, ensure these headers are set:

proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";

Reverse Proxy Setup

Backup

Back up these volumes:

  • docmost_data — uploaded files and attachments
  • db_data — PostgreSQL database (all pages, users, workspaces)
  • redis_data — session cache (less critical, regenerated on restart)

For PostgreSQL, a database dump is more reliable than volume backup:

docker compose exec db pg_dump -U docmost docmost > docmost_backup.sql

Backup Strategy

Troubleshooting

Pages Not Loading or Showing Errors

Symptom: Blank pages or 500 errors after deployment. Fix: Verify APP_URL exactly matches the URL in your browser (including protocol and port). Mismatch causes CORS and session issues.

Real-Time Collaboration Not Working

Symptom: Changes by one user don’t appear for others in real time. Fix: Ensure your reverse proxy supports WebSocket connections. Check that Upgrade and Connection headers are passed through.

Cannot Send User Invitations

Symptom: Invitation emails not delivered. Fix: Configure SMTP environment variables. Check SMTP credentials and test connectivity with telnet smtp.example.com 587.

Database Connection Refused

Symptom: connection refused errors in Docmost logs. Fix: Ensure the database container is healthy (docker compose ps). Verify DATABASE_URL matches the PostgreSQL container’s credentials exactly.

Health Check

Verify Docmost is running:

curl http://localhost:3000/api/health

A healthy instance returns 200 OK.

Resource Requirements

  • RAM: 300–500 MB for Docmost + 200 MB for PostgreSQL + 50 MB for Redis (~600 MB total)
  • CPU: Low to medium. Spikes during file uploads and search indexing.
  • Disk: 2 GB for application, plus storage proportional to uploaded files.

Verdict

Docmost is one of the most promising self-hosted wiki platforms in 2026. It delivers a Notion/Confluence-like editing experience with real-time collaboration, clean UI, and straightforward Docker deployment. The three-service stack (app + PostgreSQL + Redis) is standard and manageable.

Compared to Outline, Docmost has a simpler setup — no external OIDC provider required. Built-in email/password authentication makes it accessible to teams without SSO infrastructure. Compared to BookStack, Docmost offers a more modern editor and real-time collaboration at the cost of slightly higher resource usage.

The main caveat: Docmost is pre-1.0 software (v0.25.x). Expect occasional rough edges. For production team use, BookStack or Wiki.js are more mature. For teams willing to adopt newer software, Docmost is the most Notion-like self-hosted option available.