Skip to content

About

No description, website, or topics provided.

Resources

Contributing

Security policy

Stars

30 stars

Watchers

1 watching

Forks

Repository files navigation

MediaMTX UI

A web UI for MediaMTX: run your own streaming server, installed with one command.

Streams with their own pages and keys, a live view and multi-view, recordings, users and roles, forwarding to other platforms, holding screens, logs and backups. HTTPS with Let's Encrypt is built in.

CI Release License: MIT

The dashboard

Install

On a fresh Linux machine (Ubuntu, Debian, Raspberry Pi OS; a cloud server, a home server or a Raspberry Pi):

1. Run the installer

curl -fsSL https://github.com/greatmastix/MediaMTXUI/releases/latest/download/install.sh | sudo bash

It installs Docker if it is missing and asks how people will reach the server:

  • on the internet, at your domain with HTTPS from Let's Encrypt (the domain must point at the server, and ports 80 and 443 must be open), or
  • on your local network only, at http://<server address>:8080, with nothing open to the internet.

2. Open the address it prints and enter the setup token it prints with it.

3. Create the first admin and choose the protocols your encoders use. Then create a stream on the Streams page and point OBS (or ffmpeg, a camera) at the address and key it shows.

That's it. To upgrade later, run the same command again. What the installer does, its options, and how to read it before running it: Install script.

Install by hand

If you prefer to see every step, or Docker is already set up the way you like: you need Docker with the Compose plugin, and a domain name pointing at the host (an A record: see Ports). For a local network without a domain, follow Local network only instead. Every step explained: Install.

1. Get the two files of the latest release

mkdir mediamtx-ui && cd mediamtx-ui
curl -fsSLO https://github.com/greatmastix/MediaMTXUI/releases/latest/download/compose.yaml
curl -fsSL -o .env https://github.com/greatmastix/MediaMTXUI/releases/latest/download/env.example

2. Set your domain in .env (and an e-mail address for Let's Encrypt, if you like):

DOMAIN=stream.example.com
ACME_EMAIL=you@example.com

3. Start it

docker compose up -d

4. Open https://stream.example.com and create the first admin with the setup token:

docker compose exec sidecar /mtxui setup-token

The certificate is requested on the first start and renewed by itself.

Tip

Trying it out? Add ACME_DIRECTORY=https://acme-staging-v02.api.letsencrypt.org/directory to .env to use Let's Encrypt's staging server, which has generous rate limits (browsers will warn about its certificate). To switch to the real certificate, remove the line and run docker compose up -d again.

Ports

For a server on the internet, open these in your firewall or cloud provider's security group (on a local network only, nothing needs opening; the UI is on port 8080 there):

Port Protocol For
80, 443 TCP The UI (HTTPS), and Let's Encrypt's check of your domain
1935 TCP RTMP: OBS and most encoders
8554 TCP RTSP: cameras and players
8890 UDP SRT
8189 UDP WebRTC: watching in the browser, WHIP encoders

Only open the stream ports you use. MediaMTX's API, metrics and playback server are never published: the sidecar answers for them, behind its sign-in.

The ports are published on the host's IPv4 addresses only (0.0.0.0), so the domain needs an A record. An AAAA record alone does not work, and next to an A record it sends IPv6 clients to a closed port first. Publishing on IPv6 ([::]) is not supported: the stack's Docker network has no IPv6, so Docker would relay every IPv6 connection to the containers from the network's gateway, and sign-in limits and address rules could no longer tell those clients apart.

Features

  • Streams with their own page, keys and encoder settings (OBS presets, health checks while you are live), owned by streamer accounts that see only their own streams. New streams are public, with a watch link anyone can open; the stream's owner, an operator or an admin can make one private.
  • Live view in the browser over WebRTC, with an HLS fallback, a multi-view grid with saved layouts, and live charts of bandwidth and viewers (an hour live, 30 days of history).
  • Recordings on a timeline per stream: play, download a range as MP4, delete. A storage budget deletes the oldest, and a free-space guard stops recording before the disk fills up.
  • Forwarding to YouTube, Twitch and other servers, and holding screens that play while nobody streams (your own clip, transcoded in the browser, or a built-in "offline" screen).
  • Guest keys: let someone stream or watch for a while, without an account.
  • Configuration of MediaMTX with guided setups and every setting, a raw YAML editor and the full history of every change. Every config is validated before MediaMTX sees it, and edits touch only the lines they change.
  • People and roles (admin, operator, viewer, streamer), invitations by one-time join code, authenticator apps and passkeys, "confirm it's you" before admin-level changes, and an audit log of everything anyone changed.
  • Logs of MediaMTX and the UI, live and searchable, and backups: encrypted with your passphrase, daily and on demand, restorable on a fresh server.
  • Runs on amd64 and ARM (arm64, armv7: a Raspberry Pi will do).
Multi-view A stream's page
Configuration Logs

Documentation

The documentation covers everything in detail:

Upgrading

Installed with the installer: run it again, it keeps your settings.

curl -fsSL https://github.com/greatmastix/MediaMTXUI/releases/latest/download/install.sh | sudo bash

Installed by hand: download the new release's compose.yaml (and any override you use), then recreate the stack:

curl -fsSLO https://github.com/greatmastix/MediaMTXUI/releases/latest/download/compose.yaml
docker compose pull && docker compose up -d

The database migrates by itself. Never upgrade one image alone: each release's compose.yaml names the sidecar and the MediaMTX it was tested with. Details, and how to go back: Upgrading.

Backups

Set a passphrase on the Backups page: from then on a backup is made every night, encrypted with it. Download one now and then to keep a copy off the server, and keep the passphrase safe: without it, nobody can open a backup. Restoring and moving to a new server: Backups.

Security

  • Nothing anonymous: MediaMTX asks the sidecar about every connection (authMethod: http), and its open-relay defaults never reach the config. Publishing always takes a key. Watching without an account takes one only for a private stream: streams are public when they are created, and the stream's owner, an operator or an admin can make one private (and public again).
  • Both containers run as an unprivileged user on a read-only filesystem with every capability dropped. The sidecar holds no host credentials and does not see the Docker socket.
  • Secrets are generated on the first start and kept in the state volume; none goes into .env or the compose file.
  • Passwords are hashed with argon2id; sign-in is rate-limited and locks out guessing; sessions are server-side.
  • Optional second factors (authenticator app, passkeys), and a fresh confirmation before admin-level changes.

docs/security.md has the whole list, with the test or check behind each item, and the decisions to know about. Found a vulnerability? See SECURITY.md.

Exposure control (advanced): stream ports that stay closed except when they are needed. Admins open them for an address or a while, and automatic rules (all on by default) let an encoder's address in while its stream page is open, and open the ports to anyone while a stream is live or has a holding screen, or a guest publish key is valid. It needs a firewall in front of Docker that ufw rules control; see docs/exposure-control.md.

Troubleshooting

  • No certificate / the browser warns: docker compose logs sidecar says why. Usually the domain does not point at this host yet, or ports 80 and 443 are not reachable from the internet.
  • The encoder cannot connect: is the stream port open in the firewall, and is the protocol on (Configuration → Quick setup → Choose the protocols to serve)? The stream's page says what it sees, and Logs shows MediaMTX's side.
  • The browser plays nothing, or only after a while: WebRTC needs UDP 8189; without it the player falls back to HLS. Encoders that send B-frames (OBS's x264 default) can only be watched over HLS.
  • Lost the only admin's password: docker compose exec sidecar /mtxui reset-password --username NAME, then open /join and enter the code it prints.

Everything else, by symptom, and what each warning in the UI means: Troubleshooting.

Development

Everything runs in pinned containers: you need bash and Docker. ./dev up starts a dev stack on 127.0.0.1, ./dev ci runs the checks and ./dev e2e the end-to-end tests. CONTRIBUTING.md has the details.

License

MIT. MediaMTX UI is not affiliated with the MediaMTX project; it runs the official MediaMTX image (MIT) alongside its own.

About

No description, website, or topics provided.

Resources

Contributing

Security policy

Stars

30 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages