Environment variables
Config surface for a KeyRouter instance. The full list lives in .env.example in the repository.
# Required
JWT_SECRET=change-me-to-a-long-random-secret
INITIAL_PASSWORD=change-me
DATA_DIR=/var/lib/keyrouter
# Recommended
PORT=20131
NODE_ENV=production| Variable | Required | Description |
|---|---|---|
| JWT_SECRET | Yes | Long random secret for session signing. |
| INITIAL_PASSWORD | Yes | Initial dashboard password, change it after first login. |
| DATA_DIR | Yes | Data directory. Defaults to ~/.keyrouter. |
| PORT | No | Server port. Defaults to 20131. |
| API_KEY_SECRET | No | Secret for API keys issued by the endpoint proxy. |
| MACHINE_ID_SALT | No | Salt for machine identity. |
| CLOUD_URL | No | Cloud sync endpoint. Off by default; set your own domain to enable. |
| BASE_URL | No | Public base URL of this instance. |
| HTTP_PROXY / HTTPS_PROXY | No | Optional outbound proxy for upstream calls. |
Where data is stored
- macOS / Linux:
~/.keyrouter/db/data.sqlite - Windows:
%APPDATA%/keyrouter/db/data.sqlite - Docker:
/app/data/db/data.sqlite(mount$HOME/.keyrouterto persist)