Skip to Content
SetupEnvironment

Environment

This page documents runtime environment variables used by Kōji server code.

How Env Is Loaded

Kōji loads .env by default. You can point to a different file by setting the ENV variable before starting the server.

ENV=.env.production koji

Variables

VariableRequiredDefaultUsed For
SCANNER_DB_URLYesNonePrimary scanner database connection.
CONTROLLER_DB_URLNoEmpty (falls back to scanner DB)Controller/instance DB connection for hybrid setups.
KOJI_DB_URLYesNoneKōji application database connection.
KOJI_SECRETNoEmptyBearer token for /api/v1/* and admin login password.
HOSTNo0.0.0.0HTTP bind host.
PORTNo8080HTTP bind port.
MAX_CONNECTIONSNo100DB pool max connections.
LOG_LEVELNoinfoServer and SQL log level (error|warn|info|debug|trace).
START_LATNo0.0Initial client map latitude from /config.
START_LONNo0.0Initial client map longitude from /config.
NOMINATIM_URLNohttps://nominatim.openstreetmap.org/Nominatim service URL for search/import.
TILE_SERVERNoEmptyOptional default tile server value exposed via /config.
DANGEROUSNoUnsetBoolean-like flag: if set, /config returns dangerous=true.
ENVNo.envSelects which env file dotenv loads at startup.

Deprecated Aliases

DeprecatedReplacementNotes
DATABASE_URLSCANNER_DB_URLStill accepted with warning log.
UNOWN_DB_URLCONTROLLER_DB_URLStill accepted with warning log.
UNOWN_DBCONTROLLER_DB_URLStill accepted with warning log.
⚠️

If KOJI_SECRET is empty, public /api/v1/* endpoints do not require Bearer auth.

Last updated on