Here's the reality every streaming DJ faces sooner or later: you spend months building an audience on Twitch, YouTube, or Facebook Live, and then — algorithm change, policy shift, or platform shutdown — your community evaporates overnight. Your content lives on someone else's servers, subject to someone else's rules.

What if you could stream your video, to your audience, on your infrastructure, without any platform gatekeeper in between?

That's exactly what MediaMTX makes possible. It's a free, open-source media server that turns any VPS or home server into a professional-grade video streaming endpoint. Think of it as Icecast for video — but faster, more versatile, and engineered for the modern multi-protocol world of RTMP, WebRTC, HLS, and SRT.

For a comprehensive guide on building your stream from the ground up, read our OBS Studio for DJs guide covering scene composition, audio routing, and professional streaming presets.

In this guide, you'll learn what MediaMTX is, why it matters for DJs, and how to set it up in under 15 minutes with OBS Studio.

What Is MediaMTX?

MediaMTX (formerly known as rtsp-simple-server) is a media router built in Go. You publish a stream to it using one protocol — say, RTMP from OBS — and viewers can watch it using any protocol they want, on any device, simultaneously. A viewer on a laptop can watch via WebRTC (sub-second latency). A viewer on a phone can watch via HLS (a few seconds delay but works everywhere). The same stream, automatically transcoded and served over whatever protocol the client requests.

MediaMTX logo
MediaMTX — open-source media router

Key capabilities out of the box:

  • Publish via RTMP, RTSP, SRT, WebRTC (WHIP), MPEG-TS, or RTP
  • View via WebRTC (WHEP), HLS (including LL-HLS), RTSP, RTMP, or SRT
  • Record streams to disk automatically or on-demand
  • Playback recorded streams as video-on-demand
  • Proxy streams to other servers for redundancy or CDN routing
  • Authentication via internal credentials or external HTTP API
  • Zero dependencies — a single binary, no database, no Nginx required

It's the technology Grooveline uses to power our video streaming infrastructure. And because it's MIT-licensed, you can run it anywhere — a $5 VPS, a Raspberry Pi at home, or a full rack of servers.

Why Self-Host Video as a DJ?

Self-hosting your video stream isn't about abandoning commercial platforms — it's about owning your primary feed while feeding those platforms simultaneously. Here's the architecture that smart DJs are adopting in 2026:

OBS → MediaMTX (your server)
                ├── WebRTC → viewers on your site
                ├── HLS → embedded player
                ├── RTMP → Twitch
                ├── RTMP → YouTube
                └── Record → local archive

Your audience watches on your domain first. The commercial platforms become distribution channels, not your home. If Twitch changes its DMCA policy tomorrow, your stream keeps running on your own MediaMTX server — viewers just switch to your website instead.

Other reasons self-hosting makes sense for DJs in 2026:

  • Zero latency on WebRTC: Sub-500ms delay is achievable, compared to 10–30 seconds on traditional HLS. Viewers can interact with you in real time without the "you're 30 seconds ahead of me" problem.
  • No algorithm dependency: Your viewers come because they want your music and your show, not because an algorithm decided to show them your stream. Building on your own infrastructure means you keep that connection.
  • Unlimited simultaneous streams: MediaMTX can serve the same input stream to hundreds of viewers over WebRTC without re-encoding. Each WebRTC connection is lightweight and peer-to-peer where possible.
  • Record everything automatically: Every stream gets archived as an MP4 file on your server. No need to remember to hit "record" in OBS or deal with local disk space.
  • Privacy and exclusivity: Password-protect your stream, restrict access by IP, or run it on a private network. Perfect for paid subscriber streams, private events, or DJ competitions.

Step 1: Install MediaMTX on Your Server

MediaMTX runs on Linux, macOS, and Windows. The simplest path is a single binary download — no dependencies, no package manager required.

For a Linux VPS (the recommended DJ setup — DigitalOcean, Hetzner, or Linode $5–$10/month droplet):

# Download the latest Linux binary
wget https://github.com/bluenviron/mediamtx/releases/latest/download/mediamtx_linux_amd64.tar.gz
tar -xzf mediamtx_linux_amd64.tar.gz
sudo mv mediamtx /usr/local/bin/

# Create a config directory
sudo mkdir -p /etc/mediamtx
sudo mv mediamtx.yml /etc/mediamtx/

# Run it
mediamtx /etc/mediamtx/mediamtx.yml

That's it. Your server is now accepting streams on port 1935 (RTMP), 8554 (RTSP), and 8889 (WebRTC). For a production setup, run it as a systemd service so it starts automatically and restarts on crash.

# Create a systemd service
sudo tee /etc/systemd/system/mediamtx.service << EOF
[Unit]
Description=MediaMTX Media Server
After=network.target

[Service]
ExecStart=/usr/local/bin/mediamtx /etc/mediamtx/mediamtx.yml
Restart=always
User=mediamtx

[Install]
WantedBy=multi-user.target
EOF

sudo useradd -r -s /bin/false mediamtx
sudo systemctl daemon-reload
sudo systemctl enable --now mediamtx

Check it's running with sudo systemctl status mediamtx. You should see an active (running) service.

Step 2: Configure OBS to Publish to MediaMTX

With MediaMTX running, connecting OBS takes about 30 seconds:

  1. Open OBS Studio → Settings → Stream
  2. Service: Custom...
  3. Server: rtmp://your-server-ip:1935/live
  4. Stream Key: mystream (this becomes the path — viewers will access it at /mystream)
  5. Click OK, then Start Streaming
💡 Pro Tip

Add authentication by editing mediamtx.yml: set publishUser: "djname" and publishPass: "securepassword". OBS will need these in the stream URL: rtmp://djname:securepassword@your-server:1935/live/mystream. This prevents anyone else from publishing to your server.

Step 3: Watch Your Stream

MediaMTX includes a built-in web interface for viewing streams. If you used the default config, open a browser and navigate to:

http://your-server-ip:8889/mystream

This opens a WebRTC player — sub-second latency, works in Chrome, Firefox, Safari, and Edge. Alternatively, you can embed this player in your own website using the MediaMTX WebRTC (WHEP) endpoint:

https://your-server-ip:8889/mystream/whep

For viewers on mobile or with unstable connections, MediaMTX also serves HLS at:

http://your-server-ip:8888/mystream/index.m3u8

This works with any HLS player — native iOS/Android players, video.js, hls.js, or VLC. The latency is higher (5–15 seconds) but reliability is excellent.

Step 4: Record Every Stream Automatically

One of MediaMTX's most useful features for DJs is automatic recording. Add this to your mediamtx.yml:

paths:
  mystream:
    record: true
    recordPath: /var/mediamtx/recordings/%path/%Y-%m-%d_%H-%M-%S.mp4

Every stream you broadcast is saved as an MP4 file with a timestamp in the filename. No more forgetting to hit record in OBS. No more corrupted files from unexpected crashes. Every set is archived automatically.

You can also enable recordOnDemand to start/stop recording via the MediaMTX Control API, or set recordSegmentDuration to break long streams into manageable chunks.

Advanced: Multi-Destination Streaming

While MediaMTX is receiving your stream, you can forward it to multiple platforms simultaneously — removing the need to run multiple instances of OBS or buy expensive encoder hardware:

paths:
  mystream:
    runOnPublish: |
      ffmpeg -i rtsp://localhost:8554/mystream \
        -c copy -f flv rtmp://live.twitch.tv/app/STREAM_KEY_TWITCH \
        -c copy -f flv rtmp://a.rtmp.youtube.com/live2/STREAM_KEY_YT

When you start streaming, MediaMTX runs that command automatically, forwarding your stream to Twitch and YouTube in parallel. Your primary feed stays on your server, but the big platforms get fed from it — no extra CPU on your DJ laptop.

Dedicated Hardware: Single-Board Media Servers

Not every DJ wants to rent a VPS. MediaMTX is lightweight enough to run on a Raspberry Pi 4 or 5, turning a $50 board into a dedicated media server that sits next to your DJ rig:

  • Raspberry Pi 4/5 — Runs MediaMTX smoothly for a single 1080p stream. Add a USB SSD for recordings.
  • Home server or NUC — More power for multiple simultaneous streams or AI upscaling.
  • $5–$10 VPS (Hetzner, DigitalOcean, Linode) — Best for 24/7 availability. Your stream stays online even when your DJ laptop is off.

For home setups, use Tailscale or Cloudflare Tunnel to expose the WebRTC endpoint without opening ports or dealing with consumer ISP NAT issues.

Security Considerations

Running a public-facing media server means locking it down:

  • Always enable authentication — set publishUser/publishPass for publishing, and optionally readUser/readPass for viewers
  • Use HTTPS/WSS — WebRTC requires HTTPS for getUserMedia, and browsers won't connect to insecure WebRTC endpoints in 2026
  • Put it behind a reverse proxy — Nginx or Caddy in front of MediaMTX gives you TLS termination, rate limiting, and access logging
  • Firewall it — Only expose the ports you need (1935 for RTMP publishing, 8889 for WebRTC playback, 8888 for HLS)

The default mediamtx.yml is well-documented with hundreds of commented parameters. Run mediamtx --help or check the official GitHub repo for the full configuration reference.

Is Self-Hosting Right for You?

Self-hosting with MediaMTX isn't for every DJ — it requires a bit of server knowledge and comfort with the command line. But the payoff is substantial: complete ownership of your stream, zero algorithm gatekeeping, sub-second latency, and automatic archiving of everything you broadcast.

If you're ready to level up from single-platform streaming to owning your own broadcast infrastructure, MediaMTX is the lowest-friction path available in 2026. One binary, one config file, and you're running a professional media server that rivals commercial solutions costing thousands per year.

The streaming DJs who will thrive in the next few years aren't the ones with the best decks or the most followers — they're the ones who own their distribution pipeline. MediaMTX puts that ownership in your hands.


Sources & Further Reading

Ready to take your broadcast further? Grooveline is a free platform for DJs to build profiles, book slots, and stream — with MediaMTX-powered video infrastructure included. Create your profile and go live today.