Setup Docmost on AlmaLinux with Docker, Nginx, & SSL

By Raman Kumar

Updated on Sep 19, 2025

Learn how to setup Docmost on AlmaLinux 10 for collaborative documentation and wiki management. Step-by-step guide uses Docker, Nginx, and Let's Encrypt SSL.

What is Docmost?

Docmost is a powerful, open-source collaborative wiki and documentation software. It's an excellent choice for teams needing a centralized platform for knowledge creation, sharing, and real-time collaboration. Its features include a rich-text editor, support for diagrams (Mermaid, Draw.io, Excalidraw), a robust permissions system, spaces for content organization, integrated inline commenting, page history for version control, and powerful search functionality.

Prerequisites

Before we begin, ensure we have the following:

  • An AlmaLinux 10 on dedicated server or KVM VPS.
  • Domain Name point A record to the server IP.
  • Basic Linux Command Line Knowledge.

Setup Docmost on AlmaLinux with Docker, Nginx, & SSL

Step 1: Update Our AlmaLinux 10 System

First, let's ensure our system is up-to-date. This helps in avoiding potential conflicts and ensures we have the latest security patches.

sudo dnf update -y
sudo dnf upgrade -y

Step 2: Install Docker and Docker Compose

Docmost runs efficiently within Docker containers, which simplifies deployment and management. We'll install Docker Engine and Docker Compose.

Set up the repository

sudo dnf -y install dnf-plugins-core
sudo dnf config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo

To install the latest version, run:

sudo dnf install docker-ce -y

Start Docker Engine.

sudo systemctl start docker
sudo systemctl enable docker

Step 3: Prepare Docmost Configuration

Now, let's set up the necessary files for Docmost.

Create a Directory for Docmost: We'll create a dedicated directory to store Docmost's configuration files and data.

mkdir docmost && cd docmost

Download the Docker Compose File: Docmost provides a docker-compose.yml file that defines its services (application, database, Redis).

curl -O https://raw.githubusercontent.com/docmost/docmost/main/docker-compose.yml

Generate a Secret Key: Docmost requires a secret key for security. We'll generate one using OpenSSL.

openssl rand -hex 32

Edit Docker compose file:

nano docker-compose.yml

We need to modify the environment section for the docmost and db services. Locate the following lines and replace the placeholder values:

services:
  docmost:
    image: docmost/docmost:latest
    depends_on:
      - db
      - redis
    environment:
      APP_URL: "http://localhost:3000" # CHANGE THIS
      APP_SECRET: "7734fc6dc77c5508e0fdca88001b648787f8a00ea5f60408f5c7c5f68ef84582" # CHANGE THIS
      DATABASE_URL: "postgresql://docmost:STRONG_DB_PASSWORD@db:5432/docmost?schema=public" # CHANGE THIS
      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: STRONG_DB_PASSWORD # CHANGE THIS
    restart: unless-stopped
    volumes:
      - db_data:/var/lib/postgresql/data
  redis:
    image: redis:7-alpine
    restart: unless-stopped
volumes:
  docmost:
  db_data:

Save & close file.

Start Docmost Containers:

From within the docmost directory, launch the services.

sudo docker compose up -d

This command will download the necessary Docker images and start the Docmost, PostgreSQL, and Redis containers in the background. We can verify the containers are running with:

sudo docker ps

Step 4: Install and Configure Nginx (Reverse Proxy)

This step assumes we have successfully completed the previous steps and Docmost is running and accessible directly via http://your_server_ip:3000.

Install Nginx:

First, let's install Nginx on our AlmaLinux 10 server.

sudo dnf install -y nginx

Start and Enable Nginx Service:

After installation, we'll start the Nginx service and configure it to launch automatically at boot.

sudo systemctl start nginx
sudo systemctl enable nginx

Configure Firewall for Nginx:

Since Nginx typically serves web traffic on ports 80 (HTTP) and 443 (HTTPS), we need to open these ports in our firewall.

sudo firewall-cmd --zone=public --add-service=http --permanent
sudo firewall-cmd --zone=public --add-service=https --permanent
sudo firewall-cmd --reload

Configure SELinux

If you have SELinux enabled, execute following command:

sudo setsebool -P httpd_can_network_connect on

Create Nginx Configuration for Docmost:

We'll create a new Nginx server block configuration file for Docmost. It's good practice to create a dedicated configuration file for each application.

sudo nano /etc/nginx/conf.d/docmost.conf

Now, paste the following configuration into the file. Remember to replace example.com with our actual domain name or server IP address. If we are using a domain name, ensure it points to server's public IP address.

server {
    listen 80;
    server_name example.com; # Replace with your domain name or server IP

    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;
    }
}

Test Nginx Configuration:

sudo nginx -t

If the test is successful, reload Nginx to apply the new configuration.

sudo systemctl reload nginx

Step 5: Enable HTTPS with Let's Encrypt (Recommended for Production)

Certbot is often available in the EPEL (Extra Packages for Enterprise Linux) repository.

sudo dnf install -y epel-release

Install Certbot Nginx Plugin:

sudo dnf install -y certbot python3-certbot-nginx

Run Certbot and follow the prompts. Make sure our domain name is correctly configured and points to our server before running this command.

sudo certbot --nginx -d example.com

Conclusion

By following these steps, we've successfully set up Docmost on AlmaLinux, leveraging Docker for containerization, Nginx as a reverse proxy, and Let's Encrypt for robust SSL security. This provides a stable, secure, and scalable environment for our team's collaborative documentation and wiki management needs. 

Docmost offers powerful features like real-time collaboration, rich text editing, diagramming tools, and granular permissions, empowering our users to create, share, and manage knowledge effectively. We're now ready to empower our team with a centralized platform for all their documentation endeavors.

Checkout our low cost dedicated servers.