Environment variables

Config surface for a KeyRouter instance. The full list lives in .env.example in the repository.

.env (baseline)
# 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
VariableRequiredDescription
JWT_SECRETYesLong random secret for session signing.
INITIAL_PASSWORDYesInitial dashboard password, change it after first login.
DATA_DIRYesData directory. Defaults to ~/.keyrouter.
PORTNoServer port. Defaults to 20131.
API_KEY_SECRETNoSecret for API keys issued by the endpoint proxy.
MACHINE_ID_SALTNoSalt for machine identity.
CLOUD_URLNoCloud sync endpoint. Off by default; set your own domain to enable.
BASE_URLNoPublic base URL of this instance.
HTTP_PROXY / HTTPS_PROXYNoOptional 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/.keyrouter to persist)