Skip to main content

Environment Variables

The CLI creates a development .env. Replace its placeholder secrets and service addresses before deployment.

Express API variables

VariableDescription
DATABASE_URLPrisma connection string. Use SQLite locally or PostgreSQL for production.
JWT_SECRETLong secret used to sign short-lived access tokens.
REFRESH_SECRETA different long secret used to sign refresh tokens.
REDIS_HOST / REDIS_PORTRedis connection used for token state, locks, OAuth state, and limits.

OAuth variables

VariableDescription
AUTHENIK8_OAUTH_PROVIDERSComma-separated google, github, or google,github for the OAuth template.
GOOGLE_* / GITHUB_*Provider client ID, secret, and exact callback URI for enabled providers.

OAuth callbacks

Configure http://localhost:3000/auth/google/callback and/or http://localhost:3000/auth/github/callback.

The provider dashboard and environment value must match exactly.

Full-stack variables

The fullstack preset uses a PostgreSQL URL, a single Redis URL, an exact web origin, and API-prefixed OAuth callbacks.

VariableDescription
WEB_ORIGINExact frontend origin allowed by CORS and cookie-origin checks.
DATABASE_URLPostgreSQL connection string used by the API workspace.
REDIS_URLRedis connection used for sessions, refresh rotation, OAuth exchanges, and rate limits.
JWT_SECRET / REFRESH_SECRETIndependent secrets with at least 32 characters each.
COOKIE_SECURESet to true when the deployed application uses HTTPS.
TRUST_PROXYEnable only behind a trusted proxy that overwrites forwarding headers.
RESEND_API_KEY / EMAIL_FROMProduction delivery for verification and recovery messages.
SEED_ADMIN_EMAIL / SEED_ADMIN_PASSWORDCredentials used by npm run db:seed.

Configure enabled providers with these local callbacks:

http://localhost:3000/api/auth/oauth/google/callback
http://localhost:3000/api/auth/oauth/github/callback

OAuth variables are required only for providers selected during generation.