Environment variables
This page lists the environment variables that Keelson sets in your app container. Do not add any of them to env in keelson.yaml. Names beginning with KEELSON_ are reserved by the platform and cannot be used in env or secrets.
Always set
Section titled “Always set”| Variable | Description |
|---|---|
PORT | Port the app listens on. Read this value; do not set it |
TZ | Workspace time zone (for example, Asia/Tokyo) |
KEELSON_MODE | keelson. Use this to determine whether the app is running on Keelson. Not set locally |
KEELSON_APP_ID | Internal app ID |
KEELSON_WORKSPACE_ID | Internal workspace ID |
KEELSON_TENANT_ID | Compatibility alias for KEELSON_WORKSPACE_ID (same value) |
KEELSON_DEPLOY_ID | Internal ID of the current deploy |
KEELSON_APP_URL | App URL (https://<ws>--<app>.keelson.run). Use this when an absolute URL is required. Set when the host can be resolved |
KEELSON_DIRECTORY_BASE_URL | Directory API base URL. Used by the Identity SDK. Set under the same condition as KEELSON_APP_URL (when the host can be resolved) |
The former tenant-named variable remains accepted as a compatibility alias. No removal date is set.
Set when you enable a feature
Section titled “Set when you enable a feature”| Variable | Condition | Description |
|---|---|---|
KEELSON_DB_URL | db.mode: libsql | Managed SQLite connection URL |
KEELSON_DB_AUTH_TOKEN | db.mode: libsql | Managed SQLite authentication token |
TURSO_DATABASE_URL / TURSO_AUTH_TOKEN | db.mode: libsql | Aliases for the two variables above (for compatibility) |
KEELSON_FILES_BUCKET / KEELSON_FILES_PREFIX | Always | Storage location used by the Files SDK. Do not use directly |
KEELSON_INTERNAL_MEDIA_BASE_URL / KEELSON_APP_MEDIA_TOKEN | Always | Upload destination and authentication used by the Media SDK. Do not use directly |
KEELSON_MEDIA_URL_PREFIX | Always | Media delivery URL prefix (/__keelson/media/) |
KEELSON_DIRECTORY_TOKEN | After keelson apps directory enable | Directory API token used by the Identity SDK. Handle only on the server |
Not set
Section titled “Not set”NODE_ENV— Not set automatically. Declare"production"inenvinkeelson.yaml- External database connection details — Nothing is injected when
db.mode: none. Pass them as secrets
Used for local development
Section titled “Used for local development”These variables are used when running SDKs locally. They are not set on Keelson.
| Variable | Description |
|---|---|
KEELSON_FILES_DIR | Local storage location for the Files SDK (default: ./.keelson/files) |
MEDIA_DIR | Local storage location for the Media SDK (default: ./media) |
KEELSON_LOCAL_MODE=1 | Run the Identity SDK with dummy data |
KEELSON_LOCAL_USER_ID / KEELSON_LOCAL_USER_EMAIL / KEELSON_LOCAL_USER_NAME | Dummy user |
KEELSON_LOCAL_WORKSPACE_ID / KEELSON_LOCAL_WORKSPACE_ROLE / KEELSON_LOCAL_APP_ID | Dummy workspace, role, and app |
The former KEELSON_LOCAL_TENANT_ID and KEELSON_LOCAL_TENANT_ROLE names remain
accepted as compatibility aliases. No removal date is set.
Related pages
Section titled “Related pages”- Environment variables and secrets — Values you configure
- Files and media
- Using identity in your app