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.70.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
- Open your browser and navigate to
http://your-server-ip:3000(or your configured domain). - Docmost shows a registration page on first access. Create your admin account with email and password.
- Set your workspace name. This is the organization-level container for all your content.
- You’re now in the editor. Create your first space (a content area within the workspace) and start adding pages.
Configuration
Key Environment Variables
| Variable | Required | Description |
|---|---|---|
APP_URL | Yes | Full URL where Docmost is accessed. Must match exactly. |
APP_SECRET | Yes | Encryption key. Minimum 32 characters. Generate with openssl rand -hex 32. |
DATABASE_URL | Yes | PostgreSQL connection string. |
REDIS_URL | Yes | Redis connection string. |
MAIL_DRIVER | No | Email driver: smtp or postmark. Required for invitations. |
SMTP_HOST | No | SMTP server hostname. |
SMTP_PORT | No | SMTP port (587 for TLS). |
SMTP_USERNAME | No | SMTP authentication username. |
SMTP_PASSWORD | No | SMTP authentication password. |
MAIL_FROM_ADDRESS | No | Sender email address. |
MAIL_FROM_NAME | No | Sender 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";
Backup
Back up these volumes:
docmost_data— uploaded files and attachmentsdb_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
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.70.x), though it has matured significantly — recent releases added page-level comments, notifications, multi-column layout, and cross-space mentions. For production team use, BookStack or Wiki.js remain more proven. For teams wanting a modern Notion-like self-hosted option, Docmost is the strongest choice available.
Frequently Asked Questions
Is Docmost a good alternative to Notion?
Yes, for team documentation and wikis. Docmost has a block-based editor with slash commands, nested page hierarchies, and real-time collaboration — the core Notion features that matter for team documentation. It lacks Notion’s database views, formulas, and third-party integrations, but for wiki and documentation use cases, it’s the closest self-hosted alternative.
Does Docmost support real-time collaboration?
Yes. Multiple users can edit the same page simultaneously with real-time sync. Changes appear instantly for all editors. This requires WebSocket support in your reverse proxy — ensure Upgrade and Connection headers are passed through.
How does Docmost compare to Outline?
Both are modern, Notion-like wiki platforms. Docmost has simpler setup — it includes built-in email/password authentication, while Outline requires an external OIDC provider (Authentik, Keycloak, etc.) for login. Outline is more mature (v0.80+) with a larger community. Docmost is catching up quickly with features like comments, notifications, and multi-column layout.
Can I use Docmost without SMTP email?
Yes. SMTP is optional. Without it, you can’t send user invitations or password reset emails, but you can create user accounts manually through the admin interface. Configure SMTP later when you need invitation and notification features.
What databases does Docmost support?
Docmost requires PostgreSQL specifically — it doesn’t support MySQL, MariaDB, or SQLite. Redis is also required for session management and real-time features. The three-service stack (Docmost + PostgreSQL + Redis) is the only supported configuration.
Is Docmost production-ready?
Docmost is pre-1.0 software (currently v0.70.x) but has matured significantly. Recent releases added page comments, notifications, multi-column layout, and cross-space mentions. For small to medium teams, it works well in production. For mission-critical documentation, BookStack or Wiki.js are more battle-tested options with longer track records.
Related
Get self-hosting tips in your inbox
Get the Docker Compose configs, hardware picks, and setup shortcuts we don't put in articles. Weekly. No spam.
Comments