Documentation

Deploy Desk with Docker Compose

docker-compose.yml runs the published image, ghcr.io/modelriver/desk (amd64 and arm64), with Caddy in front, which gets and renews the HTTPS certificate. Node.js, SQLite and Caddy all come in the containers: the server needs Docker with Compose 2.23 or later, and no copy of the code. Before you start, read what every deployment needs.

1. Point your domain at the server

Add an A record (and AAAA for IPv6) for your Desk's domain, for example support.acme.com, pointing at the server, and open ports 80 and 443.

2. Download the two files

In an empty folder on the server (its name becomes part of the volume names):

Bash
curl -fsSLO https://raw.githubusercontent.com/modelriver/desk/main/docker-compose.yml
curl -fsSL https://raw.githubusercontent.com/modelriver/desk/main/deploy/docker/env.example -o .env

3. Fill in .env

Set these three:

VariableExample
DESK_DOMAINsupport.acme.com. Caddy gets the certificate for it
APP_URLhttps://support.acme.com
MODELRIVER_API_KEYYour project API key

Then generate the two secrets:

Bash
sed -i "s|^DESK_SECRET_KEY=.*|DESK_SECRET_KEY=$(openssl rand -base64 32)|" .env
sed -i "s|^DESK_IDENTITY_SECRET=.*|DESK_IDENTITY_SECRET=$(openssl rand -base64 48 | tr -d '\n')|" .env

.env also holds the optional settings: email (recommended, see Set up email), the widget's allowed sites, rate limits and how long archived conversations are kept.

4. Start it

Bash
docker compose up -d
docker compose exec desk node scripts/create-admin.ts

The second command asks for the first admin's email, name and password. Open https://support.acme.com/dashboard and sign in; your first sign-in sets up two-factor authentication.

What runs

ContainerWhat it does
deskDesk itself, as an unprivileged user with no extra Linux capabilities. Reads all of .env
caddyHTTPS and the redirect from HTTP. It's only given DESK_DOMAIN, never your keys
WhatWhere
Settings.env next to docker-compose.yml
Your dataThe desk-data volume: data/ (articles and notes), desk.db and support.config.json
CertificatesThe caddy-data volume

Set up email

Recommended. Raising and answering tickets, email verification for account lookups, and team notifications all need email (what changes without it). Use Resend, Postmark or Amazon SES, with EMAIL_FROM on a domain the provider has verified and SUPPORT_REPLY_TO set to a mailbox your team reads.

Add the settings to .env:

Bash
EMAIL_PROVIDER=resend
RESEND_API_KEY=re_…
EMAIL_FROM="Acme Support <[email protected]>"
SUPPORT_REPLY_TO=support@acme.com

Then apply them: docker compose up -d.

Then check it with Dashboard → Settings → Send a test email.

Running it

  • Logs: docker compose logs -f desk.
  • Change settings: edit .env, then docker compose up -d.
  • Another admin, or a lost password or phone: docker compose exec desk node scripts/create-admin.ts.
  • Back up: the volume's full name starts with your folder's name (docker volume ls). For a folder named desk:
Bash
docker run --rm -v desk_desk-data:/data -v "$PWD":/backup alpine tar czf /backup/desk-data.tgz -C /data .
  • Branding: set the logo, colors, fonts, titles and favicon under Dashboard → Settings, with no restart. The defaults under those are in support.config.json on the volume, with any logo next to it. To change it, copy it out, edit it, copy it back and restart:
Bash
docker compose cp desk:/data/support.config.json .
docker compose cp support.config.json desk:/data/
docker compose restart desk
  • Sample articles: set DESK_SAMPLE_DATA=true in .env before the first start.
  • Update: docker compose pull && docker compose up -d. See Updating to do it on a schedule.

Versions

The 1 tag follows every 1.x release. To stay on one version, set DESK_VERSION=1.0.1 in .env.

Your own proxy instead of Caddy

Remove the caddy service and the configs section, give desk a local port, and point your proxy at it:

YAML
1 ports:
2 - "127.0.0.1:3000:3000"

Keep TRUST_PROXY_HOPS=1 if exactly one proxy is in front, so rate limits see real visitor addresses.

Building from your own code

If you've changed Desk, build the image from your copy of the repository instead of pulling it:

Bash
docker compose -f docker-compose.yml -f docker-compose.source.yml up -d --build

Run it from a separate folder from the one you develop in: your development .env isn't the one Docker should use.