Skip to main content

Environment Variables

Strapi environment config lives in:

apps/strapi/.env
apps/strapi/.env.example
apps/strapi/config

This starter extends Strapi's default environment variables. See the official Strapi Environment Variables docs.

warning

Do not leave empty values such as DATABASE_PASSWORD= in .env. Empty values are treated as set, so default config fallbacks will not be used. Remove or comment the line when you want the default.

Reference

VarRequiredUsed by
HOSTNoServer bind host. Defaults to 0.0.0.0.
PORTNoServer port. Defaults to 1337.
APP_URLProductionPublic Strapi URL; admin links; SSO callback URLs.
APP_KEYSYesStrapi session cookie signing keys.
API_TOKEN_SALTYesStrapi API token signing salt.
ADMIN_JWT_SECRETYesStrapi admin JWT secret.
JWT_SECRETYesUsers & Permissions JWT secret.
TRANSFER_TOKEN_SALTWhen transfer is usedStrapi transfer token signing salt.
CRON_ENABLEDNoEnables Strapi cron tasks. See Cron Jobs.
WEBHOOKS_POPULATE_RELATIONSNoEnables populated relations in Strapi webhooks.
STRAPI_MCP_ENABLEDNoToggles the built-in MCP server at /mcp (default true in development, false elsewhere). See Strapi MCP.
AUTO_SEED_ENABLEDNoEnables automatic seed import before Strapi starts. See Data Seeding.
AUTO_SEED_MODENoControls automatic seed behavior: empty, prompt, force, or skip.
STRAPI_LICENSEWhen licensed features are usedStrapi license key.
DATABASE_URLProduction or hosted DBFull database connection string; has priority over individual database fields.
DATABASE_CLIENTYesDatabase client, usually postgres.
DATABASE_HOSTYes without DATABASE_URLDatabase host.
DATABASE_PORTYes without DATABASE_URLDatabase port.
DATABASE_NAMEYes without DATABASE_URLDatabase name.
DATABASE_USERNAMEYes without DATABASE_URLDatabase username.
DATABASE_PASSWORDYes without DATABASE_URLDatabase password.
DATABASE_SSLProductionEnables database SSL.
DATABASE_SCHEMANoPostgreSQL schema. Defaults to public.
DATABASE_POOL_MIN / DATABASE_POOL_MAXNoDatabase pool limits.
DATABASE_CONNECTION_TIMEOUTNoDatabase connection timeout.
TEST_DATABASE_FILENAMETestsSQLite filename for test setups.
SENTRY_DSNWhen Sentry is usedStrapi-side error tracking. See Observability → Sentry.
LOG_LEVELNoLog verbosity for structured logging. See Observability.
OTEL_SERVICE_NAMENoOpenTelemetry service name on logs/spans (default strapi).
APPLICATIONINSIGHTS_CONNECTION_STRINGWhen Azure Monitor is usedEnables the Azure Monitor telemetry provider. Inert when unset.
CLIENT_URLPreview and frontend linksFrontend base URL; preview links; admin CORS allowed origin.
STRAPI_PREVIEW_ENABLEDNoEnables Strapi Preview button configuration.
STRAPI_PREVIEW_SECRETWhen preview is enabledShared secret for Strapi Preview and the UI preview route. See Strapi Preview.
CLIENT_ACCOUNT_ACTIVATION_URLWhen account activation emails are usedFrontend account activation link in backend email templates.
ADMIN_PANEL_CONFIG_API_AUTH_TOKENWhen admin runtime config injection is usedProtects the custom admin panel config endpoint.
Provider and plugin variables

Additional environment variables depend on enabled Strapi plugins and providers. See Upload Providers, Email Providers, Strapi Preview, Microsoft SSO, and Observability.