Self-Hosting
Environment Variables Complete reference of environment variables for configuring Appstrate.
Every variable below is defined in packages/env/src/index.ts with strict Zod validation. Required vars throw at boot if missing.
Variable Required Default Description NODE_ENVNo developmentdevelopment | production | testPORTNo 3000Server port APP_URLNo http://localhost:3000Public URL for OAuth callbacks. Must be HTTPS when NODE_ENV=production TRUSTED_ORIGINSNo http://localhost:3000,http://localhost:5173CORS origins, comma-separated TRUST_PROXYNo falsefalse | true | number of trusted reverse-proxy hops (X-Forwarded-For)COOKIE_DOMAINNo — Cross-subdomain session cookies LOG_LEVELNo infodebug | info | warn | error
Variable Required Default Description BETTER_AUTH_SECRETYes — Session signing secret UPLOAD_SIGNING_SECRETYes — Min 16 chars. Signs file-upload tokens (separate from BETTER_AUTH_SECRET so it can rotate independently) CONNECTION_ENCRYPTION_KEYYes — 32 bytes, base64. Encrypts stored credentials RUN_TOKEN_SECRETNo — Signs run tokens issued to sidecars. Tokens are unsigned if absent GOOGLE_CLIENT_IDNo — Enables Google sign-in. Paired with GOOGLE_CLIENT_SECRET GOOGLE_CLIENT_SECRETNo — Google OAuth secret GITHUB_CLIENT_IDNo — Enables GitHub sign-in. Paired with GITHUB_CLIENT_SECRET GITHUB_CLIENT_SECRETNo — GitHub OAuth secret
Generate the required secrets with:
Variable Required Default Description DATABASE_URLNo — PostgreSQL URL. Falls back to PGlite if absent PGLITE_DATA_DIRNo ./data/pglitePGlite data directory
Variable Required Default Description REDIS_URLNo — Redis URL. Falls back to in-process adapters: LocalQueue (cron evaluator), LocalPubSub (EventEmitter), RateLimiterMemory
Variable Required Default Description S3_BUCKETNo — S3 bucket name. Absent = filesystem storage S3_REGIONConditional — Required when S3_BUCKET is set S3_ENDPOINTNo — Custom S3 endpoint (MinIO, R2, etc.) S3_PUBLIC_ENDPOINTNo S3_ENDPOINTBrowser-facing URL for presigned URLs. Falls back to S3_ENDPOINT FS_STORAGE_PATHNo ./data/storageFilesystem fallback path when S3 is not configured
Variable Required Default Description RUN_ADAPTERNo processdocker or process. Docker is required for credential isolationDOCKER_SOCKETNo /var/run/docker.sockPath to the Docker socket SIDECAR_POOL_SIZENo 2Pre-warmed sidecar containers ready to accept runs. 0 disables the pool PI_IMAGENo appstrate-pi:latestAgent runtime Docker image SIDECAR_IMAGENo appstrate-sidecar:latestSidecar proxy Docker image PLATFORM_API_URLNo auto-detected How the sidecar reaches the platform. Defaults to http://host.docker.internal:{PORT}
Variable Required Default Description MODULESNo oidc,webhooksComma-separated module list. Set to empty to disable. External npm packages supported OIDC_INSTANCE_CLIENTSNo "[]"JSON array of instance-level OIDC OAuth clients (used by satellite dashboards)
Both variables accept any JSON object at the env layer; keys are strictly validated at boot by apps/api/src/services/run-limits.ts. See Rate Limits for the full semantics.
Variable Default Description PLATFORM_RUN_LIMITS"{}"Caps every run (classic + inline + scheduled). Keys: timeout_ceiling_seconds (default 1800), per_org_global_rate_per_min (default 200), max_concurrent_per_org (default 50) INLINE_RUN_LIMITS"{}"Caps POST /api/runs/inline. Keys: rate_per_min (default 60), manifest_bytes (65536), prompt_bytes (200000), max_skills (20), max_tools (20), max_authorized_uris (50), wildcard_uri_allowed (false), retention_days (30)
The five SMTP variables are individually optional at the schema level. When you enable email (verification, invitations), the mail service validates at boot that the full set is present — leaving any one out disables the feature without failing the boot.
Variable Required Default Description SMTP_HOSTNo (required for email) — SMTP host SMTP_PORTNo 587SMTP port SMTP_USERNo (required for email) — SMTP username SMTP_PASSNo (required for email) — SMTP password SMTP_FROMNo (required for email) — Sender email address
Variable Required Default Description SYSTEM_PROXIESNo "[]"JSON array of system-wide HTTP proxies selectable per-run PROXY_URLNo — Outbound HTTP proxy for sidecar containers SYSTEM_PROVIDER_KEYSNo "[]"JSON array of built-in LLM providers (id, label, api, baseUrl, apiKey, models[])
Variable Required Default Description LEGAL_TERMS_URLNo — Terms of service URL shown in the UI footer LEGAL_PRIVACY_URLNo — Privacy policy URL shown in the UI footer