How to Install Docmost Using Docker on AlmaLinux 10

Install Docmost using Docker on AlmaLinux 10 with PostgreSQL, Redis, Caddy HTTPS, firewalld rules, verification, and common fixes in minutes.
A polished 3D server rack beside a document stack and database cylinder with cyan lighting and a subtle orange accent on a midnight-blue background.

Install Docmost using Docker on AlmaLinux 10 with PostgreSQL, Redis, and automatic HTTPS from Caddy. With a domain already pointed at your VPS, the setup takes about ten minutes and ends at Docmost’s workspace creation screen.

Prerequisites

  • A 64-bit AlmaLinux 10 VPS with at least 2 GB of RAM and 10 GB of free disk space.
  • SSH access as root, or a normal Linux account with working sudo privileges.
  • A domain such as YOUR_DOMAIN with an A record pointing to SERVER_IP. Caddy needs public DNS and inbound ports 80 and 443 to issue a certificate.
  • Outbound HTTPS access to Docker Hub and Docker’s RPM repository.
  • A VPSLake Linux VPS if you need an AlmaLinux server with root access.

The commands use sudo for a normal SSH user. If you are logged in as root, remove sudo. This guide uses AlmaLinux’s DNF and firewalld, not Ubuntu’s apt and ufw.

Step 1: Confirm AlmaLinux 10 and update the server

Confirming the release first prevents you from using a repository intended for another Enterprise Linux version.

. /etc/os-release
printf '%s\n' "$PRETTY_NAME"
uname -m
sudo dnf upgrade -y

The first two checks should identify AlmaLinux 10 and a 64-bit architecture:

AlmaLinux 10.x (Cerulean Lion)
x86_64

The exact minor version changes as updates arrive. Fix any DNF mirror, DNS, or signature error before continuing.

Step 2: Install Docker Engine and Compose

Docker Engine runs the containers, while the Compose plugin starts Docmost, PostgreSQL, Redis, and Caddy as one application stack.

If this is a fresh VPS, remove packages that can conflict with Docker’s container runtime. On a host already running Podman workloads, inspect those workloads before removing anything.

sudo dnf remove -y docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate docker-logrotate docker-engine podman runc

Add Docker’s RHEL-compatible repository. Docker lists RHEL 10 as supported, and this repository method is the appropriate package path for AlmaLinux 10; see the official Docker Engine RHEL instructions.

sudo dnf install -y dnf-plugins-core ca-certificates
sudo dnf config-manager --add-repo https://download.docker.com/linux/rhel/docker-ce.repo
sudo dnf makecache
sudo dnf install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
sudo systemctl enable --now docker

Check that the daemon and Compose plugin are available:

sudo systemctl is-active docker
sudo docker version --format 'Client {{.Client.Version}} / Server {{.Server.Version}}'
sudo docker compose version

Expected output is similar to this, although patch versions will change:

active
Client 29.x.y / Server 29.x.y
Docker Compose version v2.x.y

Step 3: Allow your SSH user to manage Docker

Docker’s Unix socket is root-owned by default. Adding only your trusted administration account to the docker group avoids repeated sudo prompts, but that membership provides root-equivalent control of the server.

Run this for a normal SSH account, replacing the placeholder with that account’s name. Skip it if you will deliberately run Docker as root or always use sudo.

sudo usermod -aG docker YOUR_LINUX_USER

Log out of SSH and reconnect, then check the group membership:

id -nG
docker info --format 'Server {{.ServerVersion}}'

The group list should include docker, and the second command should print the Engine version. Until you reconnect, use sudo docker and sudo docker compose.

Step 4: Create secure Docmost settings

Docmost needs a long application secret and one matching PostgreSQL password in two services. Generating both values as hexadecimal strings avoids URL-encoding problems inside DATABASE_URL.

sudo dnf install -y openssl
openssl rand -hex 32
openssl rand -hex 24
sudo mkdir -p /opt/docmost
cd /opt/docmost
sudo vi .env

In vi, create the file below. Replace every uppercase value with the corresponding output or your real domain; do not leave the example values in place.

APP_URL=https://YOUR_DOMAIN
APP_SECRET=REPLACE_WITH_64_HEX_CHARACTERS
DB_PASSWORD=REPLACE_WITH_48_HEX_CHARACTERS

Save the file and restrict it because it contains the database credential:

sudo chmod 600 /opt/docmost/.env

APP_URL must match the HTTPS address people will use. The current Docmost installation documentation requires an application secret of at least 32 characters and uses the same PostgreSQL and Redis connection pattern.

Step 5: Define Docmost and its HTTPS reverse proxy

The Compose file keeps PostgreSQL and Redis on Docker’s private network, binds Docmost itself to loopback, and lets Caddy handle public HTTP, HTTPS, certificates, and WebSockets.

Create the Caddy configuration first:

sudo vi /opt/docmost/Caddyfile

Use this content, replacing YOUR_DOMAIN with the same hostname from .env:

YOUR_DOMAIN {
    reverse_proxy docmost:3000
}

Now create /opt/docmost/docker-compose.yml:

sudo vi /opt/docmost/docker-compose.yml

Paste this configuration:

services:
  caddy:
    image: caddy:2
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - ./Caddyfile:/etc/caddy/Caddyfile:ro
      - caddy_data:/data
      - caddy_config:/config
    depends_on:
      - docmost
    restart: unless-stopped

  docmost:
    image: docmost/docmost:latest
    depends_on:
      - db
      - redis
    environment:
      APP_URL: ${APP_URL}
      APP_SECRET: ${APP_SECRET}
      DATABASE_URL: postgresql://docmost:${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: ${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:
  caddy_data:
  caddy_config:

The 127.0.0.1 binding means the application is reachable by Caddy and local health checks, but it is not directly exposed as an unauthenticated port 3000 service. The named volumes preserve pages, uploads, PostgreSQL data, Redis persistence, and Caddy’s certificate state across container recreation.

Step 6: Open firewalld and start the stack

Only Caddy’s web ports need to be reachable from the internet; firewalld blocks direct access to the private application port.

sudo systemctl enable --now firewalld
sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --permanent --add-service=https
sudo firewall-cmd --reload
sudo firewall-cmd --list-services

You should see http and https in the service list. Validate the Compose syntax before pulling images or creating containers:

cd /opt/docmost
sudo docker compose config --quiet
sudo docker compose pull
sudo docker compose up -d
sudo docker compose ps

The configuration check is silent when valid. After the image downloads, all four services should show Up:

NAME                 SERVICE   STATUS    PORTS
docmost-caddy-1      caddy     Up        0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp
docmost-docmost-1    docmost   Up
docmost-db-1         db        Up
docmost-redis-1      redis     Up

Container names may differ if Docker Compose chooses a different project name.

Verify the Docmost installation

First test the application health endpoint through HTTPS. This confirms DNS, Caddy’s certificate, the reverse proxy, and Docmost’s HTTP service in one request.

curl -fsS -o /dev/null -w 'HTTP %{http_code}\n' https://YOUR_DOMAIN/api/health

Expected output:

HTTP 200

Open https://YOUR_DOMAIN in a browser. The Docmost setup page should appear; enter a workspace name, administrator name, email address, and a strong login password, then create the workspace. After setup, open the dashboard and create a test page to confirm that storage and the editor work.

For a final service check, view recent logs without following them indefinitely:

cd /opt/docmost
sudo docker compose logs --tail=30 caddy docmost db redis

The logs should not show a repeating restart loop, database authentication failure, or certificate error.

Troubleshooting

APP_SECRET must be longer than or equal to 32 characters

The placeholder is still in .env, or the generated secret was truncated while copying it. Run openssl rand -hex 32 again, replace APP_SECRET, and recreate only the application container:

cd /opt/docmost
sudo docker compose up -d --force-recreate docmost
sudo docker compose logs --tail=40 docmost

Caddy cannot obtain an HTTPS certificate

The domain may not resolve to this server yet, or an upstream firewall/security group may block ports 80 or 443. Confirm the A record, verify firewalld lists http https, and test from outside the VPS; do not switch to a self-signed certificate for a public workspace.

502 Bad Gateway at the domain

Caddy is running but Docmost has not finished starting or the app container exited. Check the dependency and application logs, then restart the stack after correcting the reported error:

cd /opt/docmost
sudo docker compose ps
sudo docker compose logs --tail=80 docmost db redis
sudo docker compose restart

password authentication failed for user "docmost"

The DB_PASSWORD in .env does not match the password stored in an already-initialized PostgreSQL volume, commonly because it was changed after the first startup. Restore the original value in .env; do not use docker compose down -v on a server containing data because removing the volume deletes the database.

Hardening and maintenance

  • Keep port 3000 bound to 127.0.0.1 and expose only Caddy’s HTTPS endpoint. Do not publish PostgreSQL or Redis ports.
  • Back up the docmost, db_data, redis_data, caddy_data, and caddy_config volumes before upgrades or host maintenance.
  • Review image changes before applying them in production. For a planned update, run sudo docker compose pull followed by sudo docker compose up -d from /opt/docmost.
  • Keep .env readable only by root and use a different long password for the Docmost administrator account.

FAQ

Can I install Docmost without a domain?

You can test Docmost over an IP address by changing APP_URL and publishing port 3000, but that removes automatic HTTPS and is not a good public deployment. A domain pointing to the VPS lets Caddy issue a trusted certificate and supports secure WebSocket connections.

Why are PostgreSQL and Redis included?

PostgreSQL stores Docmost’s structured application data, while Redis provides the supporting cache and real-time infrastructure. Compose keeps both services on an internal network, so neither database is directly reachable from the internet.

Where does Docmost keep uploaded files?

The docmost named volume maps to /app/data/storage inside the application container. PostgreSQL data is in db_data, Redis persistence is in redis_data, and Caddy keeps certificates in caddy_data; back up these volumes as part of the same recovery plan.

How do I stop Docmost temporarily?

From /opt/docmost, run sudo docker compose stop to stop the containers without deleting volumes. Start them again with sudo docker compose start; your workspace data remains on the named volumes.

Samrat Ghosh
Written by

Samrat Ghosh

Founder & Infrastructure Engineer

Samrat Ghosh is the founder of VPSLake, where he builds and runs the remote desktop and VPS hosting infrastructure the company is built on. He writes hands-on guides about RDP, Windows Server, VPS management and secure remote access - the practical documentation he wishes had…

Previous Article

How to Transfer Files to RDP: 5 Easy Ways

Next Article

Remote Desktop Keeps Disconnecting? 8 Fixes That Work

Write a Comment

Leave a Comment

Your email address will not be published. Required fields are marked *

Subscribe to our Newsletter

Subscribe to our email newsletter to get the latest posts delivered right to your email.
Pure inspiration, zero spam ✨