Skip to main content

Environment reference

Every key Crumb reads from .env, grouped by area. The authoritative copy lives in .env.example in the repository; this page mirrors it for browsing. Most installs never need to touch most of these, setup-env.sh fills in the values that matter for a first boot.

PostgreSQL

KeyDefaultNotes
POSTGRES_USERcrumb
POSTGRES_PASSWORDgeneratedstrong random value from setup-env.sh
POSTGRES_DBcrumb
DATABASE_URLderivedfull connection string used by api + recorder
DB_POOL_SIZEcode defaultconnection pool size; rule of thumb is roughly 2 * cameras + 10

Streaming (go2rtc)

Crumb's own go2rtc restreamer runs embedded in the recorder container. The values below are fallbacks: once you set the server's address in the admin console's Server & streaming settings, that value wins.

KeyDefaultNotes
CRUMB_GO2RTC_API_BASEemptyleave blank, internal compose defaults are correct
CRUMB_GO2RTC_RTSP_BASEemptyleave blank; set the public RTSP address in the admin console instead
GO2RTC_USERgeneratedrequired; compose fails fast if unset
GO2RTC_PASSgeneratedrequired; required to be strong, rotate with care (needs a recorder + api restart)
GO2RTC_EMBEDDEDtrueset false only if running an external restreamer
GO2RTC_RTSP_BASE / GO2RTC_API_BASEemptya separate, external Frigate go2rtc instance, only used for cameras served by it

Recording

KeyDefaultNotes
SEGMENT_SECONDS42 to 6 seconds; short segments mean near-instant seek

Motion-mode RAM cache

See Motion & Detection for the mechanism this configures.

KeyDefaultNotes
MOTION_CACHE_TMPFS_BYTES536870912 (512 MiB)tmpfs size for the pre/post-roll ring buffer; sizing rule of thumb in .env.example
MOTION_CACHE_DIR/cache/motiononly change alongside the compose tmpfs target
MOTION_RECORDING_SHADOW01 records everything as before but stamps each segment with the keep/discard verdict the buffer would have made, for validating before flipping a camera live

Timeline previews (scrubbing)

See Timeline scrubbing for what these do. All optional; the defaults work.

Five of these are also editable live from the admin console (Server settings → Scrub previews): the env value below is only the default until an operator sets it in the console, at which point the console value wins (no restart needed, takes effect within one scan interval / cache-sweep tick). The other two (THUMB_CACHE_DIR, THUMB_PREGEN_WIDTH) are env/compose-only, see the Notes column.

KeyDefaultConsole-editable?Notes
THUMB_PREGEN_ENABLEDfalseyesbuild scrub previews in the background so the first drag is instant too; costs some ongoing CPU + disk
THUMB_PREGEN_LOOKBACK_HOURS2yeshow far back to build previews when the worker starts (console clamps 0-168h)
THUMB_PREGEN_SCAN_SECS60yeshow often to build previews for newly-recorded footage (console clamps 5-3600s)
THUMB_PREGEN_WIDTH480no, env-onlypreview width in pixels; must equal the playback clients' scrub-still width or pre-generated previews go unused (silently wasted CPU/storage), which is why this one stays a deployment-time setting, not a console toggle
THUMB_CACHE_DIR(EXPORT_DIR)no, env-onlywhere the preview cache lives; point at an SSD/NVMe mount to keep scrubbing fast on a spinning-disk system (a filesystem mount, not a preference)
THUMB_EXTRACT_MAX_CONCURRENCYscales with coresnohow many previews Crumb builds at once; default is roughly half the CPU cores
THUMB_CACHE_MAX_BYTES21474836480 (20 GiB)yespreview cache size budget; oldest previews are dropped past this (console floors it at 100 MiB)
THUMB_CACHE_TTL_SECONDS2592000 (30 days)yespreview cache age budget (console clamps 1 hour-1 year)

Storage

KeyDefaultNotes
MEDIA_HOST_PATH./_datahost directory bind-mounted into both containers
MEDIA_ROOT/datacontainer-side root; all storage paths must live under it
LIVE_STORAGE_PATH/data/livedefault live bucket
ARCHIVE_STORAGE_PATH/data/archivedefault archive bucket; unset means archive shares the live disk

GPU / motion decode

KeyDefaultNotes
MOTION_HWACCELautoauto probes for NVDEC and falls back to CPU; cuda forces NVDEC, cpu forces software decode

See Hardware decode for enabling this.

API auth

KeyDefaultNotes
JWT_SECRETgeneratedat least 32 bytes; the API refuses to boot on the placeholder value
JWT_EXPIRY_SECONDS86400token lifetime, 24 hours

API server

KeyDefaultNotes
API_BIND0.0.0.0:8080set 127.0.0.1:8080 for localhost-only

Export

KeyDefaultNotes
EXPORT_DIR/exportsits own volume, not under the read-only /data mount
EXPORT_TTL_SECONDS86400how long a completed export survives before cleanup

Database backup

See Backups for the full picture.

KeyDefaultNotes
DB_BACKUP_ENABLEDtrue
DB_BACKUP_HOST_PATH./backupsmust be writable by uid 1001
DB_BACKUP_SCHEDULE03:15local wall-clock time
DB_BACKUP_KEEP_DAYS7
DB_BACKUP_KEEP_WEEKS4
DB_BACKUP_KEEP_MONTHS00 disables the monthly tier

Off-host backup copy (optional)

KeyDefaultNotes
BACKUP_OFFSITE_REMOTEemptyan rclone remote:path; leaving this empty makes the optional sidecar idle even if started
BACKUP_OFFSITE_SCHEDULE15 5 * * *5-field cron, not the HH:MM form the main backup uses
BACKUP_OFFSITE_RCLONE_CONF./rclone.confkeep this file out of the repository, same trust level as .env

Alerting

KeyDefaultNotes
ALERT_WEBHOOK_URLemptya generic JSON webhook (Discord/Slack-compatible) for recorder-death paging; empty means silent
CAMERA_OFFLINE_BOOT_GRACE_SECS180holds camera-offline alerts for this long after a recorder restart
MAINTENANCE_UNTILemptyunix-seconds timestamp to pre-arm a maintenance window at boot

Update-available check (issue #7)

KeyDefaultNotes
UPDATE_CHECK_ENABLEDfalseopt-in; when true, the api periodically asks github.com for the latest CrumbVMS release tag (version number only, nothing sent) so clients can show an "update available" notice. false means zero github.com requests, ever. The admin console's "Enable update checks" toggle (Server settings) overrides this once set — DB wins over env.

Seed (admin bootstrap)

KeyDefaultNotes
SEED_ADMIN_USERNAMEadmin
SEED_ADMIN_PASSWORDemptyplaintext; only needed for a headless install, otherwise create the admin in the browser wizard
SEED_ADMIN_PASSWORD_HASHemptyprecomputed argon2id hash, an alternative to the plaintext var above
SEED_DEFAULT_CAMERASfalsedev-only; keep false in any real deployment

Image source

KeyDefaultNotes
CRUMB_IMAGE_PREFIXghcr.io/badbread/crumbvmspoint at a different registry/namespace
CRUMB_VERSIONlatestpin a specific tag for reproducible upgrades

Frigate integration (optional, bring your own)

All of these are unset by default. See Integrations for the full setup.

KeyDefaultNotes
FRIGATE_MQTT_URLemptyleaving this unset disables the entire detection subsystem, no background task runs
FRIGATE_MQTT_USER / FRIGATE_MQTT_PASSWORD / FRIGATE_MQTT_PASSWORD_B64emptybroker auth, only if required
FRIGATE_MQTT_PREFIXfrigate
FRIGATE_API_BASEemptyfallback; the admin console setting overrides it
FRIGATE_MIN_SCORE0.3detection confidence floor
FRIGATE_CATCHUP_HOURS24how far back to backfill on startup