Documentation

Deploy Desk by Hand

On a distribution other than Ubuntu, or to set everything up yourself, follow the steps the Ubuntu setup script runs. You need Node.js 26.12.1 or later installed as /usr/bin/node. Before you start, read what every deployment needs.

1. User and folders

Bash
sudo useradd --system --home /opt/desk --shell /usr/sbin/nologin desk
sudo mkdir -p /opt/desk /var/lib/desk/data/{public,private} /etc/desk
sudo chown -R desk: /opt/desk /var/lib/desk

2. The app

Bash
sudo -u desk git clone https://github.com/modelriver/desk.git /opt/desk
cd /opt/desk && sudo -u desk sh -c 'npm ci && npm run build'

3. Settings

Bash
sudo cp deploy/env.example /etc/desk/env && sudo chmod 600 /etc/desk/env
sudoedit /etc/desk/env

Set at least:

VariableValue
MODELRIVER_API_KEYYour project API key
DATA_DIR/var/lib/desk/data
DATABASE_PATH/var/lib/desk/desk.db
NODE_ENVproduction
DESK_SECRET_KEYThe output of openssl rand -base64 32
DESK_IDENTITY_SECRETThe output of openssl rand -base64 48
APP_URLYour Desk's address, like https://support.acme.com
TRUST_PROXY_HOPSThe number of proxies in front of Desk: 1 for nginx alone

4. The first admin

Bash
sudo /opt/desk/deploy/create-admin.sh

5. The service

Bash
sudo cp deploy/desk.service /etc/systemd/system/
sudo systemctl daemon-reload && sudo systemctl enable --now desk

Desk listens on 127.0.0.1:3000.

6. HTTPS

Put nginx or Caddy in front for HTTPS and proxy to 127.0.0.1:3000. With Caddy, the whole config is:

support.acme.com {
reverse_proxy 127.0.0.1:3000
}

TRUST_PROXY_HOPS must match the number of proxies that add to X-Forwarded-For (Cloudflare in front of nginx is 2), so rate limits see real visitor addresses. If your proxy puts the address in its own header, set CLIENT_IP_HEADER to that header instead, for example cf-connecting-ip.

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 /etc/desk/env with sudoedit /etc/desk/env:

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

Then restart: sudo systemctl restart desk.

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

Running it

  • Logs: journalctl -u desk -f.
  • Change settings: sudoedit /etc/desk/env, then sudo systemctl restart desk.
  • Back up: /var/lib/desk.
  • Update:
Bash
cd /opt/desk
sudo -u desk sh -c 'git pull && npm ci && npm run build'
sudo systemctl restart desk

Keep your data folder in its own repository if you like, but never commit /etc/desk/env: it holds your API key and secrets.