---
title: 'Self-Host Docmost with Docker Compose and Traefik: Complete Guide'
description: Learn how to self-host Docmost on your own server using Docker Compose and Traefik as a reverse proxy. A step-by-step tutorial for GDPR-compliant documentation.
image:
  src: /images/blog/self_host_docmost_with_docker_and_traefik.jpeg
authors:
  - name: Florian Karbus
    to: /about/floriankarbus
    avatar:
      src: /images/blog/authors/florian.png
date: 2026-01-14
lastUpdated: 2026-03-14
published: true
---

# Self-Host Docmost: Your Private Documentation Platform

Cloud-based documentation tools like Notion or Confluence store your sensitive data on third-party servers, often outside the EU. The solution? Self-hosting **Docmost** – an open-source platform that gives you full control. In this guide, we'll set up Docmost with Docker Compose and Traefik.

## What is Docmost?

Docmost is a modern, open-source documentation and wiki platform. Think of it as a self-hosted alternative to Notion or Confluence. It offers:

- **Real-time collaboration**: Multiple users can edit documents simultaneously
- **Nested pages**: Organize your documentation in a hierarchical structure
- **Rich text editor**: A powerful WYSIWYG editor with markdown support
- **Workspaces**: Separate spaces for different teams or projects
- **Full-text search**: Find any document instantly

### Why Self-Host Docmost?

**Data Sovereignty**: Your documentation contains sensitive business information. Self-hosting ensures this data never leaves your infrastructure.

**GDPR Compliance**: By hosting in Germany or the EU, you maintain full compliance with data protection regulations.

**No Vendor Lock-in**: You own your data and can migrate or back it up whenever you want.

**Cost Savings**: No per-user pricing. Host unlimited users on your own server.

## Technical Requirements

Before we start, make sure you have:

- A server or VPS with at least **2 GB RAM** (4 GB recommended)
- **[Docker](/en/blog/how-docker-works)** and **[Docker Compose](/en/blog/docker-compose-for-beginners)** installed ([official installation guide](https://docs.docker.com/engine/install/){:target="\_blank"})
- A **domain name** pointing to your server
- Basic knowledge of the command line

For this tutorial, we'll use a Hetzner Cloud server, but any VPS provider works.

## Understanding the Architecture

Our setup consists of four main components:

1. **Docmost**: The main application
2. **[PostgreSQL](/en/blog/postgresql-helm-chart-kubernetes)**: Database for storing all documentation data
3. **Redis**: Cache and session storage for better performance
4. **Traefik**: Reverse proxy handling SSL certificates and routing

Here's how they work together:

```
Internet → Traefik (SSL) → Docmost → PostgreSQL/Redis
```

Traefik automatically obtains Let's Encrypt SSL certificates, so your documentation is always served over HTTPS.

## Step 1: Prepare Your Server

First, connect to your server via SSH and create a directory for Docmost:

```bash
mkdir -p ~/docmost
cd ~/docmost
```

## Step 2: Create the Docker Network

Traefik needs a shared network to communicate with Docmost:

```bash
docker network create web
```

## Step 3: Set Up Traefik

Create a directory for Traefik and its configuration:

```bash
mkdir -p ~/traefik
cd ~/traefik
```

Create the Traefik configuration file `traefik.yml`:

```yaml
entryPoints:
  web:
    address: ':80'
    http:
      redirections:
        entryPoint:
          to: websecure
          scheme: https
  websecure:
    address: ':443'

certificatesResolvers:
  letsencrypt:
    acme:
      email: your-email@example.com
      storage: /letsencrypt/acme.json
      httpChallenge:
        entryPoint: web

providers:
  docker:
    exposedByDefault: false
    network: web
```

Create the Traefik `docker-compose.yml`:

```yaml
services:
  traefik:
    image: traefik:v3.6
    container_name: traefik
    restart: always
    ports:
      - '80:80'
      - '443:443'
    volumes:
      - ./traefik.yml:/etc/traefik/traefik.yml:ro
      - ./letsencrypt:/letsencrypt
      - /var/run/docker.sock:/var/run/docker.sock:ro
    networks:
      - web

networks:
  web:
    external: true
```

Create the Let's Encrypt storage file:

```bash
mkdir -p letsencrypt
touch letsencrypt/acme.json
chmod 600 letsencrypt/acme.json
```

Start Traefik:

```bash
docker compose up -d
```

## Step 4: Set Up Docmost

Navigate back to the Docmost directory:

```bash
cd ~/docmost
```

Generate a secure secret key for your application:

```bash
openssl rand -hex 32
```

Create the `docker-compose.yml` for Docmost:

```yaml
services:
  docmost:
    image: docmost/docmost:latest
    depends_on:
      - db
      - redis
    environment:
      APP_URL: 'https://docs.your-domain.de'
      APP_SECRET: 'REPLACE_WITH_LONG_SECRET'
      DATABASE_URL: 'postgresql://docmost:STRONG_DB_PASSWORD@db:5432/docmost?schema=public'
      REDIS_URL: 'redis://redis:6379'
    restart: unless-stopped
    volumes:
      - docmost:/app/data/storage
    networks:
      - web
      - internal
    labels:
      - 'traefik.enable=true'
      - 'traefik.http.routers.docmost.rule=Host(`docs.your-domain.de`)'
      - 'traefik.http.routers.docmost.entrypoints=websecure'
      - 'traefik.http.routers.docmost.tls.certresolver=letsencrypt'
      - 'traefik.http.services.docmost.loadbalancer.server.port=3000'

  db:
    image: postgres:16-alpine
    environment:
      POSTGRES_DB: docmost
      POSTGRES_USER: docmost
      POSTGRES_PASSWORD: STRONG_DB_PASSWORD
    restart: unless-stopped
    volumes:
      - db_data:/var/lib/postgresql/data
    networks:
      - internal

  redis:
    image: redis:7.2-alpine
    restart: unless-stopped
    volumes:
      - redis_data:/data
    networks:
      - internal

volumes:
  docmost:
  db_data:
  redis_data:

networks:
  web:
    external: true
  internal:
```

Replace `REPLACE_WITH_LONG_SECRET` with the secret key you generated using `openssl rand -hex 32`, and `STRONG_DB_PASSWORD` with a secure database password (you can generate one the same way).

## Step 5: Configure DNS

Before starting Docmost, make sure your DNS is configured:

1. Log into your domain registrar
2. Create an **A record** pointing `docs.your-domain.de` to your server's IP address
3. Wait for DNS propagation (usually a few minutes)

## Step 6: Launch Docmost

Start all services:

```bash
docker compose up -d
```

Check if everything is running:

```bash
docker compose ps
```

You should see all three containers (docmost, db, redis) in a "running" state.

## Step 7: Initial Setup

Open `https://docs.your-domain.de` in your browser. You'll be greeted by the Docmost setup wizard:

1. Create your admin account
2. Set up your first workspace
3. Start documenting!

## Maintenance

### Updating Docmost

To update to the latest version:

```bash
cd ~/docmost
docker compose pull
docker compose up -d
```

## Security Best Practices

1. **Use strong passwords**: Generate random passwords for the database and APP_SECRET
2. **Enable firewall**: Only expose ports 80 and 443
3. **Regular updates**: Keep Docker images up to date

## The Easier Way: Deploy with lowcloud

While this tutorial gives you full control, setting up Docmost manually requires:

- Server provisioning and SSH configuration
- Docker installation and management
- Traefik configuration for SSL

**What if all of this could be automated?**

With **lowcloud**, you can deploy Docmost – or any application with a Docker Compose file – with just a few clicks:

1. **Connect your Hetzner account** – link your infrastructure with an API token
2. **Configure your compose service** – paste your `docker-compose.yml`
3. **Hit deploy** – lowcloud handles the rest

lowcloud automatically provisions your VM, sets up the reverse proxy with SSL, and keeps everything updated. Whether it's Docmost, n8n, or your own custom stack – if it runs with Docker Compose, lowcloud can deploy it. Your data stays on your own server in Germany, fully GDPR-compliant.

**The result**: All the benefits of self-hosting without the DevOps overhead.

Ready to simplify your deployment workflow? [Get started with lowcloud](https://app.lowcloud.de){:target="\_blank"} and deploy Docmost in under 10 minutes.

---

_For more information about Docmost, visit the [official documentation](https://docmost.com/docs){:target="\_blank"}. Questions about deployment? The lowcloud team is happy to help._
