How to Install and Use Docmost on Ubuntu (Complete Self-Hosted Knowledge Base & Wiki Guide)
Last Updated: July 11th, 2026
This comprehensive tutorial shows you how to install, configure, secure, and use Docmost on an Ubuntu server. Docmost is an open-source, collaborative workspace and real-time documentation platform built as a self-hosted alternative to Notion and Confluence. Whether you are running a personal wiki, a technical knowledge base, or large team project documentation, Docmost gives you absolute control over your data with high-speed real-time editing.
What Is Docmost?
Docmost is a modern, self-hosted workspace software that allows team members to create, edit, and organize documents simultaneously. Proprietary documentation tools store your company knowledge and creative notes on third-party cloud servers where you have zero data visibility or privacy guarantees. By self-hosting Docmost, you gain a robust, fast platform featuring live real-time editing, nested sidebars, custom spaces, and structured database blocks—all running safely on your own hardware.
Docmost Features
- Collaborative Real-time Editor: Co-author and edit pages simultaneously with live cursor tracking and instant sync.
- Spaces & Granular Permissions: Group pages into dedicated Spaces for different departments or projects and manage permissions securely.
- Rich Media & Diagrams: Built-in support for embedding code blocks, tables, KaTeX math equations, and integrated diagramming tools (Draw.io, Excalidraw, Mermaid).
- Synced Blocks & Templates: Reuse content across multiple pages or create standardized workspace layouts effortlessly.
- Notion & Markdown Import: Seamlessly migrate your existing documentation or export your data at any time.
Requirements & Prerequisites
You will need an Ubuntu server (22.04, 24.04 LTS, or newer) with administrative sudo privileges, Docker and Docker Compose installed, a valid domain name, and an active TLS/SSL certificate (Let's Encrypt). Real-time collaboration in Docmost requires continuous WebSocket handling through your reverse proxy configuration.
Step 1: Install Docker and Docker Compose
Docmost runs with a multi-container architecture consisting of the Node.js application, PostgreSQL database, and Redis cache. Log into your Ubuntu server and install Docker:
sudo apt update
sudo apt install -y docker.io docker-compose-v2
sudo systemctl start docker
sudo systemctl enable docker
Step 2: Create a Docker Compose Configuration for Docmost
Create a dedicated directory for your Docmost instance and download the official multi-container stack setup:
mkdir -p ~/docmost && cd ~/docmost
curl -O https://raw.githubusercontent.com/docmost/docmost/main/docker-compose.yml
Generate a secure application secret key using OpenSSL:
openssl rand -hex 32
Open the configuration file to customize your environmental values and secret tokens:
sudo nano docker-compose.yml
Update APP_URL with your target domain name and replace REPLACE_WITH_LONG_SECRET and database passwords with your generated values:
services:
docmost:
image: docmost/docmost:latest
depends_on:
- db
- redis
environment:
APP_URL: "https://docs.example.com"
APP_SECRET: "YOUR_GENERATED_OPENSSL_HEX_KEY"
DATABASE_URL: "postgresql://docmost:STRONG_DB_PASSWORD@db:5432/docmost"
REDIS_URL: "redis://redis:6379"
ports:
- "127.0.0.1:3000:3000"
restart: unless-stopped
volumes:
- docmost:/app/data/storage
db:
image: postgres:18
environment:
POSTGRES_DB: docmost
POSTGRES_USER: docmost
POSTGRES_PASSWORD: STRONG_DB_PASSWORD
restart: unless-stopped
volumes:
- db_data:/var/lib/postgresql
redis:
image: redis:8
command: ["redis-server", "--appendonly", "yes", "--maxmemory-policy", "noeviction"]
restart: unless-stopped
volumes:
- redis_data:/data
volumes:
docmost:
db_data:
redis_data:
Save and close the file, then spin up your containers in the background:
sudo docker compose up -d
Step 3: Configure an Nginx Reverse Proxy (with WebSockets)
Docmost depends heavily on persistent WebSocket connections for live editing. Route traffic securely from your custom domain (e.g., docs.example.com) to port 3000:
sudo apt install -y nginx
sudo nano /etc/nginx/conf.d/docmost.conf
Add the following server block configuration:
server {
listen 80;
server_name docs.example.com;
client_max_body_size 100M;
location / {
proxy_pass http://127.0.0.1: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_buffering off;
}
}
Test syntax and reload Nginx:
sudo nginx -t
sudo systemctl reload nginx
Step 4: Secure with Let’s Encrypt HTTPS
Obtain an official SSL/TLS certificate via Certbot:
sudo apt install -y certbot python3-certbot-nginx
sudo certbot --nginx --agree-tos --redirect --email [email protected] -d docs.example.com
Step 5: Initial Setup & Workspace Creation
Open your browser and navigate to https://docs.example.com. On your first access, you will be greeted by the initialization setup screen:
- Complete your administrator account details and configure your primary workspace name.
- Once submitted, you will automatically be designated as the workspace owner.
Step 6: Using the Docmost Interface
Navigate and manage your team documents efficiently through the core interface sections:
- Creating and Organizing Spaces: Use the left sidebar to create distinct **Spaces** for different teams or projects (e.g., Engineering, HR, Product). Each space maintains independent layout permissions.
- Writing in the Real-Time Editor: Click **+ New Page** within any space. Use Markdown typing shortcuts (like
#for headings,-for lists) or click the formatting menu blocks to insert clean tables, KaTeX math expressions, code highlights, or diagrams. Because changes broadcast live via WebSockets, multiple active users can collaborate on the exact same page simultaneously. - Inviting Team Members: Go to workspace settings to invite additional collaborators via email addresses or assign roles through custom permission groups.