Skip to content

Self-Hosting

Truss is designed to be self-hosted. The API server runs as a Docker container; the dashboard, admin panel, and docs are static SPAs that deploy to any CDN (Cloudflare Pages, Vercel, Netlify, etc.).

Architecture overview

apps/
api/ Express API server (port 8787) → Docker / Coolify
dashboard/ React SPA (port 5173) → Cloudflare Pages / static host
admin/ React SPA (port 5174) → Cloudflare Pages / static host
docs/ Astro Starlight (port 5175) → Cloudflare Pages / static host

The API server is the only component that needs a server runtime. Everything else is static HTML/JS.

Docker deployment

The API has its own Dockerfile at apps/api/Dockerfile. A root-level Dockerfile also works for platforms like Coolify that build from the repo root.

Terminal window
# Build from the repo root
docker build -t truss-api .
# Run with your env vars
docker run -d \
--name truss-api \
-p 8787:8787 \
-e DATABASE_URL=postgres://postgres:postgres@host.docker.internal:5432/postgres \
-e TRUSS_AUTH_REQUIRED=false \
truss-api

Docker Compose

A minimal compose setup with Postgres and the Truss API:

services:
postgres:
image: postgres:16
environment:
POSTGRES_PASSWORD: postgres
volumes:
- pgdata:/var/lib/postgresql/data
ports:
- "5432:5432"
truss-api:
build: .
ports:
- "8787:8787"
environment:
DATABASE_URL: postgres://postgres:postgres@postgres:5432/postgres
TRUSS_AUTH_REQUIRED: "false"
depends_on:
- postgres
volumes:
pgdata:

Coolify deployment

Truss works well with Coolify. Point Coolify at your Git repo, set the build context to the repo root, and configure these env vars in the Coolify dashboard:

  1. DATABASE_URL — your Postgres connection string
  2. CORS_ALLOWED_ORIGINS — comma-separated frontend origins (e.g. https://truss.yourdomain.com)
  3. Any optional service URLs (Kratos, Keto, MinIO, etc.)

The API binds to 0.0.0.0:8787 by default, which is required for Docker/Traefik proxying.

Frontend deployment

Each frontend app builds to static output:

Terminal window
# Build dashboard
cd apps/dashboard && npm run build
# Build admin
cd apps/admin && npm run build

Set the VITE_API_BASE_URL env var at build time to point at your API server:

Terminal window
VITE_API_BASE_URL=https://api.truss.yourdomain.com npm run build

Deploy the dist/ folder to Cloudflare Pages, Vercel, or any static host.

Full stack with services

For all features, you’ll want:

ServicePurposeDefault Port
PostgreSQL 16+Database5432
Ory KratosAuthentication4433 (public), 4434 (admin)
Ory KetoAuthorization4466 (read), 4467 (write)
MinIOS3 Storage9000 (S3), 9001 (console)
Ory HydraOAuth2/OIDC4444 (public), 4445 (admin)
Ory OathkeeperAPI Gateway4455 (proxy), 4456 (admin)

See Configuration for all environment variables.