Skip to content

Configuration

Environment variables that control backd at runtime.

All runtime configuration comes from environment variables. At startup backd checks all of them and reports every problem at once, then exits with a non-zero status if any are invalid.

VariableRequiredDefaultPurpose
CONFIG_DIRyes—Root of the realm/database/collection tree
MONGO_URIyes—MongoDB connection string. MongoDB must run as a replica set (a single node is fine; see MongoDB)
HTTP_ADDRno:8080Listen address
PROVISION_MODEnoapplyapply creates or updates collections, validators and indexes; verify only compares them and refuses to start on differences
LOG_LEVELnoinfodebug, info, warn or error (case-insensitive)
MAX_BODY_BYTESno1048576Maximum request body size in bytes; larger bodies get 413
BACKD_MAX_UPLOAD_BYTESno104857600Largest file a proxy upload may carry (100 MiB). A field’s own max_size applies as well; the smaller wins
BACKD_IMAGE_MAX_PIXELSno40000000Most pixels (width × height) an image may have to get versions: 40 megapixels. Read from the file’s header, so a larger image is refused without being decoded. A field’s max_pixels may only lower it, and a higher one stops startup
BACKD_IMAGE_TIMEOUTno30sHow long a worker may take to decode one image and make all its versions; over it, the versions fail with timeout
BACKD_IMAGE_CONCURRENCYnoderivedHow many images one worker process makes versions of at once. Derived from the container’s limits: half the CPUs, and no more than fit in half the memory at 4 bytes per pixel of the largest allowed image (at least 1); the value in effect is logged at startup. See sizing the worker
MONGO_OP_TIMEOUTno10sDeadline for the storage work of each document request; exceeding it returns 503
SHUTDOWN_TIMEOUTno15sHow long in-flight requests may take to finish after SIGTERM
TRUSTED_PROXIESnononeComma-separated IP addresses or CIDR networks of your reverse proxies; only they may set X-Forwarded-For (see client addresses behind a proxy)
PASSWORD_HASH_CONCURRENCYnoGOMAXPROCS (which follows a container’s CPU limit), capped by half the memory limit / 64 MiBMaximum password hashes running at once in one process (see Users and passwords)
BACKD_EXECUTOR_URL, BACKD_EXECUTOR_TOKEN, BACKD_INTERNAL_ADDR, BACKD_CALLBACK_URL, BACKD_CALLBACK_KEYwith functions— (:8081 for the address)The functions executor and the internal listener: see Running the executor
BACKD_SECRETS_KEY (or BACKD_SECRETS_KEY_FILE)with functions that declare secrets—The master key functions’ secrets are encrypted under
BACKD_ADMIN_APInotruefalse makes this instance serve no /v1/{realm}/_admin route: they answer 404 like any unknown route. For public instances when an internal instance has the admin API (see Production deployment)
BACKD_ADMIN_UInofalsetrue serves the admin web interface at /_ui/ when the binary was built with it (release images are); it needs the admin API on the same instance, or startup fails
BACKD_ADMIN_UI_IDLEno30mhow long the admin interface may sit untouched before it signs out and revokes its session
BACKD_DEVnofalsetrue rebuilds function sources automatically as they change (see Dev mode); serve refuses to start unless HTTP_ADDR is bound to localhost. Local development only
BACKD_DEV_ANY_ADDRnofalsetrue lets BACKD_DEV=true run on an address that isn’t localhost, for a container whose ports are published on the host’s localhost only (the local docker stack). Never set it where anything else can reach backd
WORKER_CONCURRENCYno10Async jobs one worker process runs at once, on backd worker or backd serve --with-worker

backd functions build also reads DENO, the Deno binary to bundle with (default: deno on the PATH); BACKD_DEV reads the same variable. backd executor and backd egress have their own variables (see Running the executor and Egress); backd worker reuses BACKD_EXECUTOR_URL/BACKD_EXECUTOR_TOKEN/BACKD_CALLBACK_URL/BACKD_CALLBACK_KEY (see Running the worker).

Durations use Go syntax, for example 500ms, 10s or 1m30s.

Example:

CONFIG_DIR=./config MONGO_URI='mongodb://localhost:27017/?replicaSet=rs0' backd serve
Edit this page · Last updated 08 Oct 2026