Deploying Docmost on a VPS: A Lightweight, Real-Time Collaborative Wiki for Development Teams
Introduction: The Quest for the Perfect Team Knowledge Base
In the fast-paced world of software development, efficient knowledge management is not a luxury—it is a core operational requirement. Development teams constantly juggle API documentation, architectural decisions, onboarding guides, and sprint planning notes. For years, platforms like Confluence and Notion have been the industry standards. However, as teams scale, they frequently encounter significant pain points: escalating subscription costs, sluggish performance, feature bloat, and growing concerns over data privacy and compliance.
Enter Docmost, an open-source, exceptionally lightweight wiki and real-time collaborative documentation platform designed specifically to address these challenges. By deploying Docmost on your own Virtual Private Server (VPS), your development team can retain absolute ownership of its intellectual property while enjoying a fluid, modern editing experience. This guide provides a comprehensive, step-by-step walkthrough for deploying Docmost using Docker Compose, optimizing it for production, and integrating it into your team's daily workflow.
Why Docmost is a Game-Changer for Dev Teams
Before diving into the technical deployment, it is essential to understand what sets Docmost apart from its heavier counterparts. Docmost is engineered from the ground up to be fast, minimalist, and highly functional.
- Real-Time Collaboration: Multiple developers can edit the same document simultaneously without version conflicts, mimicking the seamless experience of Google Docs or Notion.
- Rich Markdown & Block Editor: Write documentation effortlessly using a modern block-based editor that fully supports Markdown shortcuts, code blocks with syntax highlighting, and media embeds.
- Lightweight Footprint: Unlike resource-heavy enterprise alternatives, Docmost consumes minimal CPU and RAM, allowing it to run smoothly even on cost-effective, low-tier VPS instances.
- Robust Permissions & Structure: Organize documentation logically using spaces, nested pages, and granular access controls to ensure sensitive architectural data is only visible to authorized personnel.
Prerequisites for VPS Deployment
To ensure a seamless installation process, verify that your environment meets the following baseline requirements:
- A Linux VPS: A server running Ubuntu 22.04 LTS or Ubuntu 24.04 LTS is highly recommended. A baseline configuration of 1 vCPU and 2GB of RAM is more than sufficient for small to medium-sized development teams.
- A Fully Qualified Domain Name (FQDN): A domain or subdomain (e.g.,
wiki.yourcompany.com) pointed directly to your VPS IP address via an A record. - Docker and Docker Compose Installed: The modern Docker engine must be configured on the host machine.
Note: It is strongly recommended to perform all deployment operations via an SSH session using a non-root user with sudo privileges to maintain host security.Step-by-Step Deployment Guide via Docker Compose
Step 1: Setting Up the Directory Structure
Log into your VPS via SSH and create a dedicated directory to house your Docmost configuration and persistent data volumes. This keeps your server structured and simplifies backup operations.
mkdir -p ~/docmost/data
cd ~/docmostStep 2: Configuring the Environment Variables
Docmost utilizes environment variables to manage security tokens, database credentials, and application settings securely. Create an .env file in your configuration directory:
nano .envPaste the following configuration into the file, ensuring you replace the placeholder values with your actual domain and highly secure, randomly generated secrets:
# General Settings
APP_URL=[https://wiki.yourcompany.com](https://wiki.yourcompany.com)
PORT=3000
# Database Configuration
DB_POSTGRES_USER=docmost_user
DB_POSTGRES_PASSWORD=your_ultra_secure_password
DB_POSTGRES_DB=docmost_db
# Redis Configuration
REDIS_URL=redis://redis:6379
# Cryptographic Keys (Generate strong random strings for these)
APP_SECRET=your_random_long_app_secret_string
JWT_SECRET=your_random_long_jwt_secret_stringSave and close the file (in Nano, press Ctrl+O, Enter, then Ctrl+X).
Step 3: Crafting the Docker Compose File
Docmost requires a PostgreSQL database for persistent structured data and a Redis instance to handle real-time WebSocket connections and caching. We will orchestrate these three components seamlessly using Docker Compose. Create the docker-compose.yml file:
nano docker-compose.ymlPopulate the file with the following standard production-ready service definitions:
version: '3.8'
services:
docmost:
image: docmost/docmost:latest
container_name: docmost_app
depends_on:
- db
- redis
environment:
- APP_URL=${APP_URL}
- PORT=${PORT}
- DB_POSTGRES_USER=${DB_POSTGRES_USER}
- DB_POSTGRES_PASSWORD=${DB_POSTGRES_PASSWORD}
- DB_POSTGRES_DB=${DB_POSTGRES_DB}
- REDIS_URL=${REDIS_URL}
- APP_SECRET=${APP_SECRET}
- JWT_SECRET=${JWT_SECRET}
ports:
- "3000:3000"
volumes:
- ./data:/app/data
restart: always
db:
image: postgres:16-alpine
container_name: docmost_db
environment:
POSTGRES_USER: ${DB_POSTGRES_USER}
POSTGRES_PASSWORD: ${DB_POSTGRES_PASSWORD}
POSTGRES_DB: ${DB_POSTGRES_DB}
volumes:
- pgdata:/var/lib/postgresql/data
restart: always
redis:
image: redis:7-alpine
container_name: docmost_redis
restart: always
volumes:
pgdata:Step 4: Launching the Containers
With the configuration files properly established, initialize and launch your services in detached mode by executing:
docker compose up -dVerify that all containers are operating optimally by inspecting the process statuses:
docker compose psSecuring Docmost with Nginx and Let's Encrypt SSL
Exposing raw HTTP ports directly to the web is highly discouraged for production environments. To protect your team's access credentials and intellectual property, you must configure Nginx as a reverse proxy and implement Let's Encrypt SSL certificates.
1. Install Nginx and Certbot
sudo apt update
sudo apt install nginx certbot python3-certbot-nginx -y2. Configure the Nginx Virtual Host
Create a brand new Nginx configuration block for your documentation platform:
sudo nano /etc/nginx/sites-available/docmostInsert the following configuration, adjusting the server_name to match your FQDN:
server {
listen 80;
server_name wiki.yourcompany.com;
location / {
proxy_pass [http://127.0.0.1:3000](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;
}
}Enable the site configuration by creating a symlink to the active sites directory and restart Nginx:
sudo ln -s /etc/nginx/sites-available/docmost /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl restart nginx3. Provision the SSL Certificate
Execute Certbot to automatically provision a Let's Encrypt SSL certificate and modify the Nginx configuration to automatically route all HTTP traffic through secure HTTPS:
sudo certbot --nginx -d wiki.yourcompany.comFollow the interactive on-screen prompts to complete the process. Certbot will handle the verification and automatically set up automated cron renewal tasks.
Post-Deployment Optimization & Best Practices
Once your deployment is live, navigate to your domain via a web browser to complete the initial administrator setup wizard. To keep your wiki resilient, consider implementing the following best practices:
Automated Backup Strategies
Documentation is the lifeblood of your engineering team; data loss can paralyze operations. Implement a nightly cron job that handles database dumps and file-system archiving. A basic backup script template looks like this:
#!/bin/bash
BACKUP_DIR="/backup/docmost"
DATE=$(date +%Y%m%d_%H%M%S)
mkdir -p $BACKUP_DIR
# Dump PostgreSQL Data
docker exec docmost_db pg_dump -U docmost_user docmost_db > $BACKUP_DIR/db_$DATE.sql
# Compress Attachments and Uploads
tar -czf $BACKUP_DIR/uploads_$DATE.tar.gz -C ~/docmost data/
# Delete backups older than 30 days to save disk space
find $BACKUP_DIR -type f -mtime +30 -deleteUpdating Docmost
Because Docmost is actively developed, new features and security patches are released frequently. Upgrading your self-hosted platform requires running only a few simple commands:
cd ~/docmost
docker compose pull
docker compose up -d --remove-orphansConclusion
By migrating your development team's internal knowledge base to Docmost on a self-hosted VPS, you successfully optimize operational costs while guaranteeing maximum data privacy. Docmost provides the cutting-edge, real-time collaboration features modern engineers expect, without the performance bottlenecks or resource-heavy requirements associated with legacy enterprise platforms. Follow this deployment matrix to grant your engineering team a lightning-fast, distraction-free environment built to capture innovation and maintain a single source of truth.
