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 hostThe 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.
# Build from the repo rootdocker build -t truss-api .
# Run with your env varsdocker 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-apiDocker 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:
DATABASE_URL— your Postgres connection stringCORS_ALLOWED_ORIGINS— comma-separated frontend origins (e.g.https://truss.yourdomain.com)- 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:
# Build dashboardcd apps/dashboard && npm run build
# Build admincd apps/admin && npm run buildSet the VITE_API_BASE_URL env var at build time to point at your API server:
VITE_API_BASE_URL=https://api.truss.yourdomain.com npm run buildDeploy the dist/ folder to Cloudflare Pages, Vercel, or any static host.
Full stack with services
For all features, you’ll want:
| Service | Purpose | Default Port |
|---|---|---|
| PostgreSQL 16+ | Database | 5432 |
| Ory Kratos | Authentication | 4433 (public), 4434 (admin) |
| Ory Keto | Authorization | 4466 (read), 4467 (write) |
| MinIO | S3 Storage | 9000 (S3), 9001 (console) |
| Ory Hydra | OAuth2/OIDC | 4444 (public), 4445 (admin) |
| Ory Oathkeeper | API Gateway | 4455 (proxy), 4456 (admin) |
See Configuration for all environment variables.