Skip to Content

Environment variables

Every setting of the server, the worker, the CLI and your app's backend.

Every setting is an environment variable; nothing is read from a file except the keys serve keeps under CLIPMUX_DATA_DIR. The repository's .env.example lists each variable with an example. A test fails when the server reads a variable this page doesn't name, so the list is complete.

A value that doesn't parse stops the command at start, naming the variable.

clipmux serve

VariableDefaultWhat it does
DATABASE_URLrequiredPostgres. pgxpool options go in the URL (pool_max_conns=20); session settings too (statement_timeout=30s). Unset, every session gets statement_timeout=60s and idle_in_transaction_session_timeout=5min. serve waits up to a minute for Postgres at boot.
CLIPMUX_LISTEN:8080Where serve listens. Behind Caddy, keep it off the public interface.
CLIPMUX_DATA_DIR./dataFilesystem storage, the storage signing key, and the secrets key when CLIPMUX_SECRETS_KEY is unset. Back it up.
CLIPMUX_SECRETS_KEY{data_dir}/secrets.keyv1: and 64 hex digits; seals every secret kept in Postgres. Losing it makes every stored secret, and every output, unusable.
CLIPMUX_SECRETS_KEY_PREVIOUSunsetThe key being rotated away from, only until clipmux admin reseal-secrets has run.
CLIPMUX_BACKUP_URLfile://{data_dir}/backupsWhere backups go: s3://bucket/prefix?endpoint=https://…&region=… for an S3-compatible bucket (Backblaze B2, R2, S3), or file:///absolute/path. The default is the server's own disk.
CLIPMUX_BACKUP_ACCESS_KEY_ID, CLIPMUX_BACKUP_SECRET_ACCESS_KEYunsetThe bucket's credentials; required for an s3:// target. Use a key that can write and list but not delete.
CLIPMUX_BACKUP_INTERVAL1h; 24h for the default directoryTime between scheduled backups, a duration of at least 1m. 0 turns scheduled backups off; clipmux admin backup now still works.
CLIPMUX_BACKUP_RECIPIENTSnoneMore age recipients (age1…, comma-separated) every backup is encrypted to, such as a key you keep offline.
CLIPMUX_BACKUP_PING_URLunsetA URL fetched after each successful scheduled backup, for a dead man's switch such as healthchecks.io or an Uptime Kuma push monitor.
CLIPMUX_BACKUP_BEFORE_MIGRATEtrueBack the database up (kind pre_migrate) before applying pending migrations, at boot and in clipmux admin commands, and refuse to migrate if the backup fails. false migrates without one. A new database has nothing to back up.
CLIPMUX_PG_DUMPpg_dump on PATHThe PostgreSQL 18 pg_dump backups run. The image has it.
CLIPMUX_PUBLIC_URLchosen at first bootThe origin browsers and workers reach serve at. Set, it pins both URLs and the first-boot URL step is read-only.
CLIPMUX_MEDIA_URLCLIPMUX_PUBLIC_URLThe origin playback is served from (base_url); ideally another registrable domain. Needs CLIPMUX_PUBLIC_URL.
CLIPMUX_TRUSTED_PROXIESnoneAddresses or CIDR ranges (Caddy's) whose X-Forwarded-For, X-Forwarded-Proto and X-Request-Id are believed. Rate limits, sign-in limits, request IDs and the https redirect all depend on it.
CLIPMUX_MAX_UPLOAD_BYTESthe storage limit (~312 GiB)The largest declared upload.
CLIPMUX_BUILTIN_WORKERtrueStart clipmux worker as serve's child.
CLIPMUX_UNSANDBOXED_WORKERfalseRun the built-in worker where the media tool sandbox or Landlock doesn't hold. Only if the host isolates it another way. Where only Landlock is missing, the tools keep seccomp and the limits.
CLIPMUX_TOOL_MEMORY_MB8192Memory limit for each media tool. Passed to the built-in worker.
CLIPMUX_FFMPEG, CLIPMUX_FFPROBE, CLIPMUX_PACKAGER, CLIPMUX_WHISPERfound on PATHThe media tools. Shaka Packager must be 3.9.1 or later; whisper-cli is the pinned whisper.cpp from toolchain/build_whisper.sh, used only to transcribe.
CLIPMUX_LOG_FORMATtexttext or json. Passed to the built-in worker.
CLIPMUX_LOG_LEVELinfodebug, info, warn or error. Successful playback, storage and worker requests log at debug.
CLIPMUX_METRICS_ADDRunset (off)host:port for /metrics, a listener of its own with no auth: keep it off the internet.
CLIPMUX_PPROFfalseAdd Go's /debug/pprof/ to the metrics listener. Needs CLIPMUX_METRICS_ADDR.
CLIPMUX_SELF_DIALunsetWhere the setup test connects for every URL it checks, keeping each URL's hostname (compose: caddy).
CLIPMUX_CLOUDFLARE_APICloudflare's v4 APICloudflare's API base, for a proxy or a test double.
CLIPMUX_R2_ENDPOINThttps://{account_id}.r2.cloudflarestorage.comR2's S3 endpoint, e.g. the EU jurisdiction's.
CLIPMUX_RUNPOD_APIRunPod's v2 REST APIRunPod's API base, for a test double.
CLIPMUX_RUNPOD_CATALOGRunPod's v2 APIWhere RunPod's GPU prices come from, for a test double.
CLIPMUX_WORKER_IMAGEthe image this build namesThe image RunPod and Modal machines run.
CLIPMUX_EXECUTORS_ALLOW_PRIVATE_URLfalseConnect RunPod or Modal while the public URL is private: development only.

clipmux worker

A PC agent paired with --pair keeps its server and key in agent.json and needs none of these; the built-in worker gets its own from serve.

VariableDefaultWhat it does
CLIPMUX_SERVERfrom agent.jsonThe server's public URL.
CLIPMUX_WORKER_KEYfrom agent.jsonThe worker's key. Never in argv.
CLIPMUX_AGENT_DIRthe user's config directoryWhere agent.json, sources.json and agent.sock live.
CLIPMUX_ENCODERautoThe first encoder to try: auto, nvenc, vaapi, cuda-decode or cpu.
CLIPMUX_VAAPI_DEVICEevery /dev/dri/renderD*The VAAPI render node.
CLIPMUX_SPEECHautoWhether the worker transcribes subtitles: auto (on a GPU whose probe passes, CUDA first and then Vulkan, else on a CPU with at least 4 cores and 6 GiB), off, cpu, vulkan or cuda. serve passes it to the built-in worker.
CLIPMUX_FOLLOW_ON_SPEECHunsetSet by serve on a serverless machine woken for an encode, never by hand: the speech mode (auto) it proves speech in if serve hands it the asset's transcription after the encode. off or unset: it takes no transcription.
CLIPMUX_BAKED_MODELS_DIR/usr/share/clipmux/models in the image; unset elsewhereThe speech models baked into the image. A worker uses them when they are there, and downloads nothing. serve passes it to the built-in worker.
CLIPMUX_MODELS_DIRmodels/ in CLIPMUX_AGENT_DIR; the built-in worker's is models/ in serve's data directoryWhere a worker without baked models keeps the speech models it downloads by digest (about 0.9 GB), across restarts.
CLIPMUX_TOOL_MEMORY_MB, CLIPMUX_FFMPEG, CLIPMUX_FFPROBE, CLIPMUX_PACKAGER, CLIPMUX_WHISPER, CLIPMUX_LOG_FORMAT, CLIPMUX_LOG_LEVELas for serve

clipmux push and clipmux listen

VariableDefaultWhat it does
CLIPMUX_API_KEYrequiredThe app's API key. Never in argv.
CLIPMUX_PUSH_STATE_DIRthe user's cache directoryWhere unfinished pushes keep their upload tokens (0600).
CLIPMUX_LISTEN_SECRETgenerated once, kept beside agent.jsonThe whsec_ secret listen signs forwarded events with.

clipmux admin

clipmux admin reads DATABASE_URL, and where it needs secrets CLIPMUX_DATA_DIR, CLIPMUX_SECRETS_KEY and CLIPMUX_SECRETS_KEY_PREVIOUS, the same as serve. clipmux admin with no arguments lists its commands.

The installer and Compose

These live in /opt/clipmux/.env (or are set when you run the installer). Docker Compose and the installers read them; clipmux itself doesn't.

VariableDefaultWhat it does
CLIPMUX_VERSIONthe release installedThe image tag Compose runs. The installer changes only this line on an upgrade.
CLIPMUX_IMAGEghcr.io/visheshgubrani/clipmuxThe image, without its tag.
CLIPMUX_HTTP_PORT80The host port Caddy listens on for HTTP.
CLIPMUX_HTTPS_PORT443The host port Caddy listens on for HTTPS.
CLIPMUX_ADMIN_PORT8080The loopback port the app is published on, 127.0.0.1 only.
CLIPMUX_RELEASE_URLthe release on GitHubInstallers only: where to download the release's files from.

Your app's backend

These are not read by ClipMux: they are what an app's backend reads, as npx @clipmux/node init, clipmux admin create-integration and the dashboard's "Create credentials" write them. Keep them on the server; none belongs in a browser bundle.

VariableWhat it holds
CLIPMUX_URLThe server's public URL, which the backend calls.
CLIPMUX_API_KEYThe app's cmx_ API key, with uploads:write, assets:read and assets:write.
CLIPMUX_SIGNING_KIDThe kid of the app's signing key, the kid header of every playback token.
CLIPMUX_SIGNING_KEYThe ES256 private key (PKCS #8 PEM) as one double-quoted line with \n escapes, which dotenv, Next.js and node --env-file expand.
CLIPMUX_WEBHOOK_SECRETThe whsec_ secret webhook deliveries are signed with; only when a webhook URL was given.

On this page