Wiki
Self-hosting

Configuration

Every environment variable, and which install path uses it.

Configuration lives in environment variables. Docker installs use a single root .env; local development uses per-app .env files.

Docker installs — root .env

Written by the installer; the annotated template is .env.example.

VariableRequiredDescription
POSTGRES_PASSWORDyesDatabase password (generated by the installer)
BETTER_AUTH_SECRETyesAuth signing secret, min 32 chars — placeholders are rejected
BETTER_AUTH_URL / CORS_ORIGINproductionPublic API URL / web origin (derived from domains in the overlay)
VITE_SERVER_URL / VITE_COLLAB_URLproductionURLs baked into the web bundle at build time
WEB_DOMAIN, API_DOMAIN, COLLAB_DOMAIN, ACME_EMAILproductionDomains + Let's Encrypt email for the Caddy overlay
# Generate each secret with:
openssl rand -base64 48

VITE_* values are compiled into the web bundle at build time. Changing one requires rebuilding the web image: docker compose ... up -d --build web.

Local development — per-app .env

For pnpm dev, each app reads its own file.

apps/server/.env

VariableRequiredDescription
DATABASE_URLyesPostgreSQL connection string
BETTER_AUTH_SECRETyesAuth signing secret (min 32 chars, no placeholders)
BETTER_AUTH_URLyesPublic URL of the server
CORS_ORIGINyesAllowed origin of the web app
NODE_ENVnodevelopment (default) / production / test
APP_NAMEnoDisplay name used by auth flows (white-labeling)
RATE_LIMIT_MAX / RATE_LIMIT_AUTH_MAXnoPer-IP requests/minute for the API / auth routes
RATE_LIMIT_SCIM_MAXnoPer-IP requests/minute for SCIM (default 1200)

apps/collab/.env

VariableRequiredDescription
DATABASE_URLyesSame database as the server
BETTER_AUTH_SECRETyesSame secret as the server (verifies collab tokens)
COLLAB_PORTnoWebSocket port (default 1234)

apps/web/.env

VariableRequiredDescription
VITE_SERVER_URLyesURL the browser uses to reach the API
VITE_COLLAB_URLyesWebSocket URL of the collab service (ws(s)://)

The collab service must share BETTER_AUTH_SECRET with the server — it verifies page-scoped collab tokens signed with it. See Collaboration architecture.

Ports at a glance

ServicePort
web3001
server3000
collab1234
postgres127.0.0.1:5432

In production, only Caddy (80/443) is published; the app ports are internal.

On this page