Docmost is a collaborative wiki published under AGPL-3.0. The free Community edition covers spaces, real-time editing, page history and restore, comments, full-text search and Markdown, HTML or Notion imports. SSO, AI, page-level granular permissions and the Confluence importer are reserved for the Business and Enterprise editions, priced at $6 per seat per month billed annually with a 10-seat minimum (official pricing). It is our pick for team documentation in our roundup of open source Notion alternatives. Here is how to install it on a VPS, with the exact files and commands.

Prepare the server#

Connect over SSH, update the system and create a dedicated folder:

bash
ssh root@your-ip
apt update && apt upgrade -y
mkdir -p /opt/docmost && cd /opt/docmost

Before opening any ports, point your domain's A record at the VPS address, and add an AAAA record if the server has an IPv6 address. Caddy requests the certificate on first start: without correct DNS, Let's Encrypt returns an error and Caddy retries with a growing delay.

Check that Docker and the Compose plugin answer:

bash
docker --version
docker compose version

If either command fails, curl -fsSL https://get.docker.com | sh is a quick fix on a test server. In production, follow the official APT repository procedure in the Docker documentation for Ubuntu so security updates arrive through apt.

Then open the firewall, allowing SSH before enabling it so you do not lock yourself out:

bash
ufw allow OpenSSH
ufw allow 80/tcp
ufw allow 443/tcp
ufw enable
ufw status

Write the Docker Compose file#

First generate a long random application secret. The documentation requires at least 32 characters for APP_SECRET; openssl rand -hex 32 produces 64:

bash
openssl rand -hex 32

Then create /opt/docmost/docker-compose.yml. This configuration follows the official installation guide, with PostgreSQL 18, Redis 8 and the application port bound to localhost. Replace the domain, the secret and the database password:

yaml
services:
  docmost:
    image: docmost/docmost:latest
    depends_on:
      - db
      - redis
    environment:
      APP_URL: "https://wiki.example.com"
      APP_SECRET: "paste-the-generated-secret-here"
      DATABASE_URL: "postgresql://docmost: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: 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:

A few details matter here:

  • APP_URL must include the https:// prefix. Docmost uses it to build email links and to set the authentication cookie's secure flag.
  • The password in DATABASE_URL must match POSTGRES_PASSWORD. A mismatch produces password authentication failed for user "docmost" on startup.
  • The PostgreSQL volume points to /var/lib/postgresql, not /var/lib/postgresql/data: the PostgreSQL 18 image changed its default path. The ?schema=public suffix is optional.
  • Redis runs with appendonly yes and noeviction. Without noeviction, Redis may evict keys under memory pressure and break collaboration state.
  • Default size limits are 50 MB per uploaded file and 200 MB per import archive. Change them with FILE_UPLOAD_SIZE_LIMIT and FILE_IMPORT_SIZE_LIMIT (environment variables).

Start the three services:

bash
docker compose up -d
docker compose ps
curl -fsS http://127.0.0.1:3000/api/health

All three containers should be running, and the health endpoint should answer. The first start often takes about a minute because Docmost applies database migrations before accepting requests. If curl fails, docker compose logs --tail=100 docmost shows PostgreSQL or Redis connection errors.

Add HTTPS with Caddy#

Caddy obtains and renews Let's Encrypt certificates with no extra configuration. Install it from its official repository, using the commands from the Caddy install page:

bash
apt install -y debian-keyring debian-archive-keyring apt-transport-https curl
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | tee /etc/apt/sources.list.d/caddy-stable.list
chmod o+r /usr/share/keyrings/caddy-stable-archive-keyring.gpg
chmod o+r /etc/apt/sources.list.d/caddy-stable.list
apt update && apt install -y caddy

Replace the content of /etc/caddy/Caddyfile with:

text
wiki.example.com {
	reverse_proxy 127.0.0.1:3000
}

Validate the syntax before reloading, then confirm the service restarted:

bash
caddy validate --config /etc/caddy/Caddyfile
systemctl reload caddy
systemctl status caddy --no-pager

Open https://wiki.example.com: the workspace setup screen shows up. The first account you create becomes the workspace owner. Caddy also handles the WebSockets used by the real-time editor; if you put another proxy in front of Docmost, forward the Upgrade and Connection headers, otherwise the editor falls back to read-only (reverse proxy guide).

Configure invitation emails#

Without an SMTP server, Docmost cannot send invitations or password reset links. Add these variables to the docmost service's environment block, using your provider's credentials:

yaml
      MAIL_DRIVER: "smtp"
      SMTP_HOST: "smtp.example.com"
      SMTP_PORT: "587"
      SMTP_USERNAME: "[email protected]"
      SMTP_PASSWORD: "smtp-password"
      SMTP_SECURE: "false"
      MAIL_FROM_ADDRESS: "[email protected]"
      MAIL_FROM_NAME: "Docmost"

On port 587, keep SMTP_SECURE at false and let STARTTLS negotiate during the connection. On port 465, set it to true. Apply the change with docker compose up -d docmost, then send an invitation to an external address to check deliverability. The Configuration page also lists the Postmark driver and S3 or Azure storage.

Back up the database and files every night#

A SQL dump alone is not enough, and an archive you have never restored may be unusable on the day of a failure. The script below dumps the database and archives the attachment folder, which holds images and PDFs uploaded to pages. Create /opt/docmost/backup.sh:

bash
#!/usr/bin/env bash
set -euo pipefail
cd /opt/docmost
mkdir -p backups
STAMP="$(date +%F)"
docker compose exec -T db pg_dump -U docmost -d docmost | gzip > "backups/docmost-db-${STAMP}.sql.gz"
docker compose exec -T docmost tar czf - -C /app/data/storage . > "backups/docmost-files-${STAMP}.tar.gz"
find backups -type f \( -name 'docmost-db-*.sql.gz' -o -name 'docmost-files-*.tar.gz' \) -mtime +14 -delete

Make it executable, run it once by hand, then schedule it for 3 a.m.:

bash
chmod +x /opt/docmost/backup.sh
/opt/docmost/backup.sh
(crontab -l 2>/dev/null; echo "0 3 * * * /opt/docmost/backup.sh") | crontab -

Check the result: ls -lh /opt/docmost/backups should list two archives from today, and gzip -t backups/docmost-db-*.sql.gz should exit without errors. Keep fourteen days locally, but also copy the archives off the server with rclone or restic: a failed disk or ransomware wipes the database and its backups when both stay in the same place.

Restore onto an empty database, stopping the application first to avoid writes during the operation:

bash
cd /opt/docmost
docker compose stop docmost
gunzip -c backups/docmost-db-2026-10-22.sql.gz | docker compose exec -T db psql -U docmost -d docmost
docker compose run --rm --no-deps -T --entrypoint tar docmost xzf - -C /app/data/storage < backups/docmost-files-2026-10-22.tar.gz
docker compose start docmost

The database dump and the files must share the same timestamp: a 3 a.m. dump with 4 a.m. files leaves broken image links. Run this restore test on a staging VPS at least once a quarter, without overwriting production.

Update Docmost#

bash
cd /opt/docmost
./backup.sh
docker compose pull
docker compose up -d --force-recreate docmost

latest can move to a new minor version without warning. In production, pin a specific tag in the Compose file, test the update on a copy, then change the tag deliberately. Database migrations run when the container starts and are not always reversible: read the release notes, keep the previous night's dump, and plan a rollback by reinstalling the previous tag and restoring the database.

Keep the server healthy#

A wiki that works on day one can still fill its disk six months later. Two settings prevent most of the slow failures.

Docker's default json-file logging driver keeps container logs forever: max-size is unlimited unless you set it. A chatty container can eat gigabytes this way. Cap the logs in /etc/docker/daemon.json:

json
{
  "log-driver": "json-file",
  "log-opts": { "max-size": "10m", "max-file": "3" }
}

Restart Docker with systemctl restart docker. The new limits only apply to containers created afterwards, so recreate the stack with docker compose up -d --force-recreate (json-file driver documentation).

Then make sure the system patches itself. Ubuntu Server ships the unattended-upgrades package for security updates; systemctl status unattended-upgrades tells you whether it is running. If you installed Docker from its APT repository, as recommended above, engine updates arrive through the same channel. Reboots are still up to you: check for /var/run/reboot-required after a kernel update, and plan the restart outside working hours, since the editor goes offline while the containers come back.

Finally, watch the instance from outside. Any uptime monitor that polls https://wiki.example.com/api/health every few minutes will tell you about an expired certificate or a stopped container before your colleagues do.

Import from Notion or Confluence#

For Notion, export the workspace or pages as Markdown or HTML: Notion produces a ZIP archive. In Docmost, open the target space, click the ... menu next to "Pages", choose "Import pages", then "Notion" and upload the ZIP. Docmost recreates the page tree. Run a pilot import into a staging space first: databases and the most specific blocks sometimes need manual cleanup (import and export).

For Confluence, export the space as HTML from the space settings, then use the "Confluence" import. Formatting, page hierarchy, internal links, images and Draw.io diagrams are preserved. This importer is part of the Business edition; Notion, Markdown and HTML imports remain available in the Community edition.

If an archive exceeds the limit, raise FILE_IMPORT_SIZE_LIMIT (200 MB by default) or FILE_UPLOAD_SIZE_LIMIT (50 MB by default) in the environment block, then recreate the container with docker compose up -d docmost.

Troubleshooting#

  • 502 Bad Gateway: Docmost is not listening or the proxy targets the wrong port. Run docker compose ps, then curl -fsS http://127.0.0.1:3000/api/health. If the container restart loops, read docker compose logs --tail=200 docmost.
  • Editor in read-only mode: WebSockets are blocked. With Caddy, reverse_proxy handles them automatically; with Nginx or Traefik, forward the Upgrade and Connection headers.
  • password authentication failed: the DATABASE_URL password does not match POSTGRES_PASSWORD. Changing POSTGRES_PASSWORD after the volume is created does not alter the existing PostgreSQL role: fix DATABASE_URL or recreate the database.
  • No certificate: check DNS with dig +short wiki.example.com, confirm ports 80 and 443 are open, then inspect journalctl -u caddy -n 50 --no-pager.
  • Disk full: attachments live in the Docker volume. Monitor docker system df and du -sh /opt/docmost/backups, and move archives off the VPS before it fills up.

Frequently asked questions

How much does self-hosting Docmost cost?

The Community edition is free. Business costs $6 per seat per month billed annually, with a 10-seat minimum, so $60 per month for ten people; Enterprise is custom-priced. On the server side, budget $5 to $10 per month for a 2 GB KVM VPS outside promotions, plus $10 to $15 per year for the domain name.

Can I install Docmost on shared hosting?

No. Docmost needs Docker, PostgreSQL and Redis, which shared hosting plans cannot run. You need a VPS or a dedicated server.

How do I import Notion pages into Docmost?

Export your Notion workspace as Markdown or HTML; the export is a ZIP archive. In the target space, open "Import pages", choose "Notion" and upload the ZIP. Pages and hierarchy are preserved; complex blocks may need manual review.

How do I restore a backup?

Stop Docmost, restore the SQL dump into an empty database, then extract the files archive into /app/data/storage with a throwaway container: gunzip -c backups/docmost-db-YYYY-MM-DD.sql.gz | docker compose exec -T db psql -U docmost -d docmost followed by docker compose run --rm --no-deps -T --entrypoint tar docmost xzf - -C /app/data/storage < backups/docmost-files-YYYY-MM-DD.tar.gz. Then restart the service.

What is the difference between Community and Business?

Community covers pages, spaces, real-time editing, full-text search, comments and Markdown, HTML and Notion imports. Business adds SAML/OIDC/LDAP SSO, AI, page-level granular permissions, Bases and Kanban, the Confluence importer and email support.

Can I use Nginx or Traefik instead of Caddy?

Yes. Keep Docmost bound to 127.0.0.1:3000 and point the proxy at it. The one setting people miss is WebSockets: forward the Upgrade and Connection headers, otherwise the editor drops to read-only. You also have to configure the Let's Encrypt certificate in that proxy, a step Caddy handles without any configuration.

Sources#

Official pages consulted on 22 October 2026.