General
Environment variables are configurable for Directus Enterprise Cloud projects via our Customer Success team. You can also set environment variables in self-hosted projects.
| Variable | Description | Default Value |
|---|---|---|
CONFIG_PATH | Where your config file is located. See Deploying Directus. | .env |
HOST | IP or host the API listens on. | 0.0.0.0 |
PORT | What port to run the API under. | 8055 |
UNIX_SOCKET_PATH | The Unix socket the API listens on, PORT and HOST will be ignored if this is provided. | |
PUBLIC_URL | URL where your API can be reached on the web. used for things like OAuth redirects, forgot-password emails, and publicly-accessible logos. | / |
ROOT_REDIRECT | Redirect the root of the application / to a specific route. Accepts a relative path, absolute URL, or false to disable. | ./admin |
SERVE_APP | Whether or not to serve the Data Studio web application. | true |
OPENAPI_ENABLED | Whether or not to enable OpenAPI Specification output. | true |
GRAPHQL_INTROSPECTION | Whether or not to enable GraphQL Introspection. | true |
GRAPHQL_SCHEMA_CACHE_CAPACITY | How many user GraphQL schemas to store in memory. | 100 |
GRAPHQL_SCHEMA_GENERATION_MAX_CONCURRENT | How many GraphQL schemas can be generated simultaneously. | 5 |
ROBOTS_TXT | What the /robots.txt endpoint should return. | User-agent: *\nDisallow: / |
TEMP_PATH | Where Directus' temporary files should be managed. | ./node_modules/.directus |
PUBLIC_URL must be a qualified URL when using licensing features beyond Core Plan and/or when configuring SSOLicense
See Licensing for a full explanation of license keys, license tokens and source precedence.
| Variable | Description | Default Value |
|---|---|---|
LICENSE_KEY | License key in the format DXXXX-XXXXX-XXXXX-XXXXX-XXXXC. Activated against the Directus licensing service on first use and revalidated periodically. Takes precedence over LICENSE_TOKEN and any key set through the Studio. | |
LICENSE_TOKEN | Pre-issued license token for offline use. Validated locally on each startup and never contacts the licensing service. Mutually exclusive with LICENSE_KEY — setting both is a configuration error and Directus will refuse to start. |
LICENSE_KEY or LICENSE_TOKEN is set in the environment, any license key management actions are disabled. To change the license, update the environment variable and restart Directus.Server
| Variable | Description | Default Value |
|---|---|---|
SERVER_KEEP_ALIVE_TIMEOUT | Timeout in milliseconds for socket to be destroyed. | server.keepAliveTimeout |
SERVER_HEADERS_TIMEOUT | Timeout in milliseconds to parse HTTP headers. | server.headersTimeout |
SERVER_SHUTDOWN_TIMEOUT | Timeout in milliseconds before the server is forcefully shut down. | 1000 |
Additional Server Variables
All SERVER_* environment variables are merged with server instance properties created from http.Server. This allows to configure server behind a proxy, a load balancer, etc. Be careful to not override methods of this instance otherwise you may incur into unexpected behaviors.
First Admin User
The following commands set details for the first admin user created when the project is bootstrapped.
| Variable | Description | Default Value |
|---|---|---|
ADMIN_EMAIL | The email address of the first user that's automatically created during bootstrapping. | |
ADMIN_PASSWORD | The password of the first user that's automatically created during bootstrapping. | |
ADMIN_TOKEN | The API token of the first user that's automatically created during bootstrapping. |
Telemetry
To more accurately gauge the frequency of installation, version fragmentation, and general size of the user base, Directus collects usage data about your environment.
| Variable | Description | Default Value |
|---|---|---|
TELEMETRY | Allow Directus to collect usage data about your environment. Whether it can be disabled depends on your license. See Telemetry for more information. | true |
TELEMETRY_URL | URL that the usage report is submitted to. | https://telemetry.directus.io |
TELEMETRY_AUTHORIZATION | Optional authorization header value. |
Project Owner Registration
The first time an owner is set for your instance, Directus sends a one-time registration that associates the project with a point of contact. Alongside the owner, this includes details such as organization name, how the project is used, and whether you opted in to product updates.
| Variable | Description | Default Value |
|---|---|---|
PROJECT_OWNER | Registered owner and primary contact responsible for your Directus instance. | |
PROJECT_OWNER_ENABLED | Whether Directus sends the project owner registration information. | true |
Get once-a-month release notes & real‑world code tips...no fluff. 🐰