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.
Update the System and Install Docker
SSH into your VPS and get the system up to date:
apt update && apt upgrade -yInstall dependencies and add Docker's official GPG key:
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/nullInstall Docker Engine:
apt update
apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-pluginVerify and enable Docker:
docker --version
docker compose version
systemctl enable docker
systemctl start dockerCreate the Project Directory
Create a dedicated directory and pull the official Docker Compose template:
mkdir -p /opt/docmost
cd /opt/docmost
curl -O https://raw.githubusercontent.com/docmost/docmost/main/docker-compose.ymlConfigure Environment Variables
Generate secrets for your deployment:
# Generate APP_SECRET (32+ characters)
openssl rand -hex 32
# Generate database password
openssl rand -base64 24Edit docker-compose.yml with your values:
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:Start the Containers
From the /opt/docmost directory, bring the stack up:
docker compose up -dCheck that all three are running:
docker compose psYou should see docmost, db, and redis all showing as Up.
Install Nginx and Certbot
Install Nginx and Certbot:
apt install -y nginx certbot python3-certbot-nginxCreate the Nginx Server Block
Create a new configuration file:
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:
ln -s /etc/nginx/sites-available/docmost /etc/nginx/sites-enabled/
nginx -t
systemctl reload nginxObtain an SSL Certificate
Run Certbot to get a free Let's Encrypt certificate:
certbot --nginx -d wiki.yourdomain.comWhen asked whether to redirect HTTP to HTTPS, choose yes (option 2).
Test renewal:
certbot renew --dry-runComplete 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:
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:
docker compose up -d --force-recreate docmostOptional — S3-Compatible Storage
By default, Docmost stores uploaded files locally. To use S3-compatible object storage, add these variables:
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:
docker compose up -d --force-recreate docmostBackup Strategy
To dump the database to a file:
docker compose exec db pg_dump -U docmost docmost > /opt/docmost/backup-$(date +%Y%m%d).sqlFor automated daily backups, add a 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).sqlTo back up uploaded file storage:
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
# 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 3000Troubleshooting
Container shows Exit or Restarting
Check the logs to diagnose the issue:
docker compose logs docmost
docker compose logs dbCommon 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.
