The sidecar reads these environment variables. compose.yaml sets the ones an install usually needs from .env (see .env.example); add any other to the sidecar service's environment: in a compose.override.yaml (README: Configuration), since an upgrade replaces compose.yaml. Invalid values stop it at startup with a message naming every problem. Secrets are never configured here: the sidecar generates them into state/ on first start.
| Variable | Default | Description |
|---|---|---|
MTXUI_PUBLIC_URL |
required | URL of the UI as users reach it, e.g. https://mtx.example.com. Its scheme decides the cookies' Secure flag, and state-changing requests must come from its origin. No path, query or credentials. |
MTXUI_PUBLIC_HOST |
required | Hostname or IP address that stream clients connect to. Offered to WebRTC clients as the ICE host. |
MTXUI_TRUSTED_PROXIES |
not set | Comma-separated IPs or CIDRs of reverse proxies whose X-Forwarded-For and X-Forwarded-Proto headers are believed. For a proxy on the Docker host, the gateway of the stack subnet. Trusting every address (0.0.0.0/0, ::/0) is refused. |
MTXUI_STACK_SUBNET |
not set | CIDR of the stack's Docker network, used for MediaMTX's trusted proxies. Detected from the sidecar's own address when not set. |
MTXUI_LISTEN |
:9080 |
Public listener (UI, API, proxies): HTTPS with MTXUI_TLS=acme, else plain HTTP to publish only behind your reverse proxy. |
MTXUI_TLS |
off |
acme: get and renew a certificate for MTXUI_PUBLIC_URL's host from Let's Encrypt (or MTXUI_ACME_DIRECTORY) and serve HTTPS on MTXUI_LISTEN. Needs MTXUI_PUBLIC_URL on https:// with a domain name, and port 80 (MTXUI_HTTP_LISTEN) or 443 reachable from the internet. off: plain HTTP, for a reverse proxy in front. |
MTXUI_ACME_EMAIL |
not set | Contact address for the certificate authority (expiry warnings). Optional. |
MTXUI_ACME_DIRECTORY |
https://acme-v02.api.letsencrypt.org/directory |
The ACME directory. Let's Encrypt's staging directory (https://acme-staging-v02.api.letsencrypt.org/directory) is for trying things out. |
MTXUI_ACME_CA_CERT |
not set | Path of a PEM file to trust for the ACME server's own HTTPS (a private ACME server such as step-ca). Not needed for Let's Encrypt. |
MTXUI_HTTP_LISTEN |
:9082 |
With MTXUI_TLS=acme: plain HTTP for the certificate authority's challenges; every other request is redirected to HTTPS. Publish it as port 80. |
MTXUI_EXPOSURE_CONTROL |
off |
on: the Exposure page and automatic exposure open and close stream ports through the host helper mtx-portgate (docs/exposure-control.md). off: the stream ports are as published. |
MTXUI_INTERNAL_LISTEN |
:9081 |
Internal listener for MediaMTX's authentication callback and the healthcheck. Never publish it. |
MTXUI_INTERNAL_URL |
http://sidecar:9081 |
How MediaMTX reaches the internal listener; written into mediamtx.yml as the base of authHTTPAddress. |
MTXUI_MEDIAMTX_HOST |
mediamtx |
MediaMTX's hostname on the stack network. |
MTXUI_DATA_DIR |
/data |
Data root: config/ (mediamtx.yml), state/ (database and secrets), logs/, recordings/, hooks/, backups/. |
MTXUI_HOLDING_DIR |
/holding |
Holding clips, played while nobody streams to a stream. MediaMTX must see the directory at the same path (read-only), since mediamtx.yml names the files by it. |
MTXUI_RECORDINGS_MAX_GB |
0 |
Storage budget for recordings in GB (decimals allowed); the oldest segments are deleted, through MediaMTX's API, to stay under it. 0 means no budget (free space still applies). Files MediaMTX does not list count toward it but are never deleted; a banner says so when they alone exceed it. |
MTXUI_RECORDINGS_MIN_FREE_GB |
20 |
Free space to keep on the recordings filesystem: below it, the oldest segments are deleted. |
MTXUI_RECORDINGS_CRITICAL_FREE_GB |
5 |
Free space below which recording is switched off for every path (with a banner and an audit entry) until an admin switches it back on. Less than MTXUI_RECORDINGS_MIN_FREE_GB, unless that is 0. |
MTXUI_RECORDINGS_CHECK_EVERY |
1m |
How often recordings' disk use is measured and the budget enforced (1s to 1h). |
MTXUI_EXPORT_MAX_DURATION |
2h |
Longest range one recording export may cover (1m to 24h). |
MTXUI_EXPORT_MAX_GB |
8 |
Largest recording export in GB: the download stops there. |
MTXUI_EXPORT_CONCURRENCY |
2 |
Recording exports running at once (1 to 16); more are refused until one ends. An export holds its slot at most twice its range plus a minute, however slowly the client reads. |
MTXUI_HOLDING_MAX_GB |
3.9 |
Largest holding clip a stream may upload, in GB (0.01 to 3.9: MediaMTX reads no MP4 of 4 GB or more). The server needs twice that free while it stores one. |
MTXUI_UPDATE_CHECK |
on |
on: once a day the sidecar asks GitHub for the latest release, and admins see when there is a new one (they can switch it off on the dashboard). off: it never asks, for servers that must not reach the internet; the dashboard's switch stays off. |
MTXUI_PASSKEYS |
auto |
Passkeys (WebAuthn sign-in): auto offers them when MTXUI_PUBLIC_URL is HTTPS or localhost (browsers allow them only there; the relying party is its host), on (needs a domain name or localhost there, not an IP address) or off. |
MTXUI_MEDIAMTX_BIN |
/usr/libexec/mtxui/mediamtx |
The MediaMTX binary the image carries, used only to run --validate-conf on every config before it is written. |
MTXUI_MEDIAMTX_LOG_MAX_MB |
20 |
MediaMTX's log file is rotated (copy-truncate, gzipped) when it grows past this many MB (1 to 1024). |
MTXUI_MEDIAMTX_LOG_KEEP |
5 |
Rotated copies of MediaMTX's log to keep (0 to 50); the log viewer searches them too. |
MTXUI_HISTORY_DAYS |
30 |
Days of per-minute history (bandwidth, viewers, streams) kept for the charts (1 to 365). |
MTXUI_BACKUP_MAX_UPLOAD_MB |
2048 |
Largest backup file accepted for a restore, in MB (1 to 65536). Backups live in backups/ under the data root. |
MTXUI_LOG_LEVEL |
info |
debug, info, warn or error. |
MTXUI_SESSION_IDLE_TIMEOUT |
12h |
A session ends after this long without a request (5m to 720h). |
MTXUI_SESSION_MAX_AGE |
168h |
A session ends this long after sign-in, however active (at least the idle timeout, at most 2160h). |
MTXUI_LOGIN_RATE_PER_MINUTE |
20 |
Sign-in attempts allowed per client IP and minute (1 to 600). |
MTXUI_LOCKOUT_THRESHOLD |
5 |
Failed sign-ins for one username from one client address before that address is locked out of it (1 to 100), so a stranger cannot lock you out everywhere. Unknown usernames lock the same way, so locks reveal nothing. |
MTXUI_LOCKOUT_DURATION |
15m |
How long a locked username stays locked (1m to 24h). |