Skip to content
Kutrion
Browse docs

self-hosting

Install with Docker Compose

Connected install: configure .env, build and start the stack, verify health, and put a TLS reverse proxy in front.

Updated Oct 17, 2026

This is the connected install — a host with Docker and outbound network access. For an install with no network, see Air-gapped install.

Prerequisites

  • Docker Engine with the Compose plugin (docker compose).
  • The Kutrion repository on the host (the app image is built locally on a connected install).

Configure .env

All files live in deploy/onprem/. Copy the template and edit it; docker compose reads .env automatically.

cd deploy/onprem
cp .env.example .env

At minimum, set these before first boot. Generate each secret with openssl rand -hex 32.

VariableWhat it is
POSTGRES_PASSWORDpassword for the bundled Postgres
JWT_SECRETsession signing key, at least 32 bytes; boot fails under production with a weak or default value
DOCUMENT_SIGNING_SECRETsigning key for issued documents and links, at least 32 bytes; compose refuses to start without it
DEV_MASTER_KEY32-byte hex master key for the local key provider; wraps every stored credential
TRUST_PROXYcomma-separated CIDR/IP list of the reverse proxies in front of the app (172.29.254.1,127.0.0.1 for the shipped topology: the gateway of the compose network, named as a single host because the app refuses a range such as 172.16.0.0/12), or false if nothing proxies it; a bare hop count is refused
KUTRION_SUBNEToptional, default 172.29.254.0/24: the compose network’s subnet, pinned so TRUST_PROXY can name its gateway (.1); see below if the host already uses that range
PLATFORM_BIND_HOSToptional, default 0.0.0.0: the interface the admin plane listens on inside the container; leave it, the host-side exposure is set by ADMIN_BIND (default 127.0.0.1)
APP_BASE_URLthe public HTTPS URL where users reach the portal, including any base path
ADMIN_ORIGINSthe public origin of the admin console (for example https://admin.vault.example.com); the platform plane’s only allowed browser origin and the passkey relying party for admin sign-in
RP_ID / RP_ORIGINWebAuthn registrable domain (host only) and full origin; needs HTTPS or localhost
POSTGRES_PASSWORD=<strong-db-password>
JWT_SECRET=<openssl rand -hex 32>
DOCUMENT_SIGNING_SECRET=<openssl rand -hex 32>
TRUST_PROXY=172.29.254.1,127.0.0.1
DEV_MASTER_KEY=<openssl rand -hex 32>
APP_BASE_URL=https://vault.example.com
RP_ID=vault.example.com
RP_ORIGIN=https://vault.example.com

DEV_MASTER_KEY is the one value you cannot regenerate: losing it makes vault contents unrecoverable. Back it up out-of-band. See Core and database config for the database and URL variables, and Backups and recovery for the master key.

Before the first start, put the issued license.vtlic in deploy/onprem/license/ (see Licensing and activation): under NODE_ENV=production the app refuses to boot without a valid license. The app runs as the image’s node user (uid 1000) and writes its anti-rollback state next to the license, so make that directory writable by it: sudo chown -R 1000:1000 deploy/onprem/license. Without this the container restarts in a loop with EACCES ... /data/license.state.json.

If the app must reach a mail relay that speaks plain SMTP or STARTTLS, set SMTP_SECURE=false with SMTP_PORT (the default expects implicit TLS on 465). If your identity provider or other internal services use a private certificate authority, the app container must trust it; add a compose override that mounts the CA certificate and sets NODE_EXTRA_CA_CERTS to its path.

If 172.29.254.0/24 is already in use

The compose network is pinned to 172.29.254.0/24. On an upgrade, if the host already uses that range for something else, set KUTRION_SUBNET to a free range (for example 172.29.250.0/24) and change TRUST_PROXY to that range’s .1 address in the same edit (172.29.250.1,127.0.0.1). The two must move together: TRUST_PROXY names the network gateway, which is where the host’s reverse proxy appears to come from. docker compose up -d recreates the network with the new range.

Start the stack

docker compose up -d --build
docker compose logs -f app        # watch migrations apply, then "starting Kutrion"
curl -fsS http://localhost:4000/health

The app container applies database migrations on boot, then serves the API and web portal on :4000. A successful /health response means the stack is up.

Optional: RDP live viewer

RDP sessions in the browser need the Enterprise entitlement and two extra containers, a guacd and the Kutrion RDP gateway. They are an optional compose profile and are off by default: a plain docker compose up -d starts neither. To enable them, set these in .env (generate each key with openssl rand -hex 32):

COMPOSE_PROFILES=rdp
RDP_GATEWAY_URL=http://127.0.0.1:8089
RDP_GATEWAY_CRYPT_KEY=<openssl rand -hex 32>
RDP_GATEWAY_TOKEN=<openssl rand -hex 32>
RDP_GATEWAY_RECORDING_PATH=/var/lib/kutrion/rdp-recordings

Then docker compose up -d --build builds the gateway image and starts both. Both containers share the app’s network namespace, no port is published, and the browser reaches the gateway only through the app’s tunnel route. guacd must be able to reach your Windows hosts on port 3389. Recordings are written by guacd to a shared volume at RDP_GATEWAY_RECORDING_PATH (a one-shot init container makes it writable by both, uid 1000), and the app fetches them from the gateway for playback. With the profile off, starting an RDP session reports gateway_unconfigured. For an air-gapped host, build the bundle with ./bundle-offline.sh <version> --with-rdp so the gateway and guacd images travel with it.

Put a reverse proxy in front

The stack serves plain HTTP on :4000. Terminate TLS in a reverse proxy — WebAuthn and secure cookies require HTTPS, and localhost is the only exempt origin. A ready nginx sample ships in the bundle at deploy/onprem/reverse-proxy.example.conf, configured for post-quantum hybrid TLS key exchange (X25519MLKEM768), which protects the captured session against later quantum decryption and falls back to classical key exchange for clients that don’t offer the hybrid group.

server {
    listen 443 ssl;
    http2 on;
    server_name vault.example.com;

    ssl_certificate     /etc/ssl/kutrion/fullchain.pem;
    ssl_certificate_key /etc/ssl/kutrion/privkey.pem;
    ssl_protocols TLSv1.3 TLSv1.2;
    ssl_ecdh_curve X25519MLKEM768:X25519:prime256v1;

    location / {
        proxy_pass http://127.0.0.1:4000;
        proxy_http_version 1.1;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_read_timeout 1h;
    }
}

The hybrid group requires nginx built against OpenSSL 3.5+; older OpenSSL silently serves classical-only key exchange. The WebSocket headers above are required for the interactive terminal, port-forwarding, and multiplayer sessions.

Admin console

The bundle includes the platform admin console (License, System config, Audit chain, Platform admins and the other operator pages). It is built into the same image as the app, so there is no extra build step: docker compose up -d starts it as the admin service, published on 127.0.0.1:4200 (set ADMIN_CONSOLE_BIND to change the interface). Hosted-billing pages (subscriptions, plan catalog, coupons, revenue) do not appear on an on-prem install; the License page replaces them.

Only a platform admin can sign in. Register the operator account through the portal first, list its email in PLATFORM_ADMIN_EMAILS in .env, and recreate the app (docker compose up -d); the account is seeded as a platform admin at boot. Sign in at the console URL with the same credentials.

To reach it over HTTPS, give it its own host name and add the second server block from reverse-proxy.example.conf, which sends / to :4200, /auth/ to :4000 and /platform/ to :4100 (all loopback). Set ADMIN_ORIGINS to that origin. The console talks to /auth and /platform same-origin through the proxy, so it needs no CORS_ORIGINS entry; ADMIN_ORIGINS is what the platform plane and admin passkeys trust. The network allowlist in that block is required: it ships closed (loopback only), so add an allow line for your administration network, or bind its listener to an admin interface address, before the host is reachable. Never remove deny all;. Without a proxy, open an SSH tunnel to 127.0.0.1:4200 and use http://localhost:4200.

Keep the admin plane private

Proxy :4000 for the portal. The admin/platform plane on :4100 binds to loopback by default and must stay off the public internet; only the admin console’s /platform/ location above may reach it. Do not publish :4100 on a public address. Other containers on the compose network can also reach :4100; authentication still applies there.

Licensing tools

bind-master, provision-recovery and ratchet-master are compiled into the image; run them against the running app container, for example docker compose exec -T app node dist-tools/scripts/bind-master.js --gen. See Backups and recovery.

Next