Skip to content

Environment Variables

Environment variables configure server-level behavior. Most users don’t need to change these — the Docker image sets sensible defaults.

VariableDefaultDescription
PORT3000Server port
NODE_ENV(unset)Environment mode. Set to production in Docker; any other value (including unset) runs in development mode.
CORS_ORIGINhttp://localhost:5173Allowed CORS origin for the frontend. Only needed in development or split-origin deployments.
CONFIG_PATH./configDirectory for the database, settings, and other config files.
DATABASE_URL./config/narratorr.dblibSQL/SQLite database path. The file: prefix is optional and is stripped if present.
AUTH_BYPASSfalseDisable authentication entirely. Development/recovery only — never use in production.
URL_BASE/Subpath for reverse proxy deployments (e.g., /narratorr). All routes and assets are served under this prefix.
TRUSTED_PROXIES(unset)Comma-separated reverse-proxy IPs/CIDRs (e.g. 10.0.0.0/8,192.168.0.0/16) so the real client IP is read from X-Forwarded-For. Set this when running behind a reverse proxy — required for forms-auth Secure cookies and the local-network bypass to work correctly. See the Security docs.
LOG_LEVELinfoInitial log verbosity at boot: fatal, error, warn, info, debug, trace, silent. The General settings log level overrides this once the server is running.
MONITOR_INTERVAL_CRON*/30 * * * * *Download-monitor poll cadence as a cron expression. Advanced — rarely changed.
NARRATORR_SECRET_KEY(auto-generated)32-byte hex string used to encrypt credentials at rest (AES-256-GCM). If not set, a key is auto-generated and saved to CONFIG_PATH/secret.key on first run. Set this explicitly if you want the same key across container rebuilds without persisting the config volume.
AUDIBLE_REGIONusFallback region for metadata lookups when not configured in Settings > General. Values: us, ca, uk, au, fr, de, jp, it, in, es.

The Docker image and docker-compose.yml set these automatically:

NODE_ENV=production
CONFIG_PATH=/config
DATABASE_URL=file:/config/narratorr.db

You generally don’t need to override these unless you have a custom volume layout.

The library root is not set via an environment variable — it’s a Settings value (Settings > General > Library). The container conventionally mounts your library at /audiobooks, and you point Settings at that path.

You can pass TZ to the Docker container for timezone-aware log timestamps:

environment:
- TZ=America/New_York

The app does not read TZ directly — it’s handled by the Node.js runtime and OS. This affects how timestamps appear in logs, not application behavior.

Add variables to the environment section:

services:
narratorr:
image: narratorr/narratorr:latest
environment:
- PORT=8080
- AUDIBLE_REGION=uk
- PUID=1000
- PGID=1000
ports:
- "8080:8080"
volumes:
- ./config:/config
- /data/audiobooks:/audiobooks

PUID and PGID set the UID/GID the container runs as (linuxserver.io base image convention, default 911). Set them to your host user’s IDs for correct file ownership on the mounted /config and /audiobooks volumes.