Skip to content

Deploying MistServer

Introduction

MistServer is a highly capable, open-source streaming media server designed for professional broadcasting and video delivery. Supporting a comprehensive range of protocols including HLS, DASH, RTMP, RTSP, WebRTC, and more, MistServer provides the flexibility to deliver content to virtually any device or platform.

Built by DDVTech, MistServer is designed from the ground up for efficiency and scalability. The server uses minimal resources while supporting thousands of concurrent viewers, making it suitable for everything from personal streaming projects to large-scale broadcasting operations.

Key highlights of MistServer:

  • Multi-Protocol Support: HLS, DASH, RTMP, RTSP, WebRTC, SRT, CMAF, and more
  • Universal Player: Built-in adaptive player for maximum device compatibility
  • Live and VOD: Support for both live streaming and video-on-demand
  • Transcoding: Real-time transcoding and transmuxing capabilities
  • DVR Functionality: Record live streams and enable time-shifting
  • Analytics: Detailed viewer statistics and stream health monitoring
  • Embedding: Easy-to-use embed codes for websites and applications
  • API Control: RESTful API for programmatic configuration
  • Low Latency: WebRTC and CMAF for sub-second streaming
  • Clustering: Scale horizontally with server clustering
  • GPU Acceleration: Hardware transcoding support
  • Open Source: AGPL licensed with optional commercial support

This guide covers deploying MistServer on Klutch.sh, configuring streaming protocols, and setting up live and VOD content delivery.

Why Deploy MistServer on Klutch.sh

Deploying MistServer on Klutch.sh provides significant advantages:

Simplified Deployment: Klutch.sh automatically builds and deploys MistServer from your Dockerfile. Push to GitHub, and your streaming server deploys automatically.

HTTPS by Default: Klutch.sh provides automatic SSL certificates for secure streaming, essential for HLS and DASH delivery to modern browsers.

Persistent Storage: Attach volumes for recorded content, configurations, and VOD files that survive restarts.

Scalable Resources: Allocate CPU and memory based on transcoding needs and concurrent viewer counts.

GitHub Integration: Connect your repository for automatic deployments on configuration updates.

Environment Variable Management: Securely store API keys and sensitive configuration.

Custom Domains: Use your own domain for professional streaming infrastructure.

Always-On Availability: Your streaming server remains accessible 24/7.

Prerequisites

Before deploying MistServer on Klutch.sh, ensure you have:

  • A Klutch.sh account
  • A GitHub account with a repository for your configuration
  • Basic familiarity with Docker and streaming concepts
  • Understanding of streaming protocols (HLS, RTMP, etc.)
  • (Optional) Content for VOD streaming
  • (Optional) A custom domain for your streaming server

Understanding MistServer Architecture

MistServer operates with several key components:

Controller: The main process managing all operations and the web interface.

Input Handlers: Accept content from various sources (RTMP push, file, pull streams).

Output Handlers: Deliver content via different protocols (HLS, DASH, WebRTC).

Transcoder: Optional real-time transcoding for adaptive bitrate streaming.

Buffer: Manages stream data in memory for efficient delivery.

Triggers: Automate actions based on stream events.

Preparing Your Repository

Repository Structure

mistserver-deploy/
├── Dockerfile
├── README.md
└── .dockerignore

Creating the Dockerfile

Create a Dockerfile:

FROM ddvtech/mistserver:latest
# Set environment variables
ENV MistUsername=${MistUsername:-admin}
ENV MistPassword=${MistPassword}
# Create directories for content
RUN mkdir -p /media/vod /media/recordings /config
# Expose ports
# 4242 - Management interface
# 8080 - HTTP streaming
# 1935 - RTMP
# 554 - RTSP
EXPOSE 4242 8080 1935 554
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=30s --retries=3 \
CMD curl -f http://localhost:8080/ || exit 1
# Start MistServer
CMD ["MistController", "-c", "/config/config.json"]

Environment Variables Reference

VariableRequiredDefaultDescription
MistUsernameNoadminAdmin panel username
MistPasswordYes-Admin panel password
MistConfigNo-Path to configuration file
MistDebugNo0Debug level (0-10)

Deploying MistServer on Klutch.sh

    Create a Secure Admin Password

    Generate a strong password for the admin interface:

    Terminal window
    openssl rand -base64 24

    Push Your Repository to GitHub

    Terminal window
    git init
    git add Dockerfile .dockerignore README.md
    git commit -m "Initial MistServer deployment"
    git remote add origin https://github.com/yourusername/mistserver-deploy.git
    git push -u origin main

    Create a New Project on Klutch.sh

    Navigate to the Klutch.sh dashboard and create a project named “mistserver” or “streaming”.

    Create a New App

    Create a new app and connect your GitHub repository.

    Configure HTTP Traffic

    In deployment settings:

    • Select HTTP as the traffic type
    • Set the internal port to 8080 for streaming delivery
    • Note: Additional ports may be needed for RTMP ingest

    Set Environment Variables

    Configure your environment:

    VariableValue
    MistUsernameYour admin username
    MistPasswordYour secure password

    Attach Persistent Volumes

    Add volumes for content and configuration:

    Mount PathRecommended SizePurpose
    /config1 GBServer configuration
    /media/vod100+ GBVideo on demand files
    /media/recordings100+ GBDVR recordings

    Deploy Your Application

    Click Deploy to build and launch MistServer.

    Access Management Interface

    The admin interface is available at https://your-app-name.klutch.sh:4242. Log in with your configured credentials.

Configuring Streaming

Adding a Live Stream

  1. Access the management interface
  2. Navigate to Streams
  3. Click New Stream
  4. Configure stream settings:
    • Name: Unique identifier for the stream
    • Source: RTMP push, pull URL, or file
    • Buffer: Time in seconds to buffer

Configuring RTMP Ingest

For live streaming via RTMP:

  1. Create a new stream with “Push” source
  2. Note the RTMP URL: rtmp://your-server/live/streamname
  3. Configure your encoder (OBS, FFmpeg) with this URL

Setting Up HLS Output

HLS is automatically available for all streams:

  • URL: https://your-server/hls/streamname/index.m3u8
  • Compatible with all modern browsers and devices

WebRTC for Low Latency

Enable WebRTC for sub-second latency:

  1. Navigate to stream settings
  2. Enable WebRTC output protocol
  3. Use MistServer’s player for WebRTC playback

Video on Demand (VOD)

Adding VOD Content

  1. Upload video files to /media/vod
  2. Create a new stream in the management interface
  3. Set source to the file path
  4. MistServer automatically handles adaptive delivery

Folder-Based VOD

Configure automatic VOD from a folder:

  1. Create a stream with folder source
  2. Point to /media/vod
  3. All files in the folder become available

Universal Embed Player

MistServer includes a universal player that automatically selects the best protocol:

<script src="https://your-server/player.js"></script>
<div id="player"></div>
<script>
var player = new MistPlayer({
target: document.getElementById('player'),
source: 'https://your-server/stream/name'
});
</script>

The player automatically:

  • Detects browser capabilities
  • Selects optimal protocol (WebRTC, HLS, DASH)
  • Handles adaptive bitrate switching
  • Falls back gracefully when needed

DVR and Recording

Enabling DVR

Configure time-shifted viewing:

  1. Open stream settings
  2. Set DVR Window to desired duration
  3. Viewers can seek within the DVR window

Recording Streams

Set up automatic recording:

  1. Configure recording output in stream settings
  2. Set destination path: /media/recordings
  3. Choose recording format (MP4, TS)
  4. Optionally schedule recordings

API Integration

Stream Control via API

Terminal window
# List all streams
curl -u admin:password https://your-server/api/streams
# Create a new stream
curl -u admin:password -X POST \
-d '{"name":"mystream","source":"rtmp://source.com/live/stream"}' \
https://your-server/api/streams
# Get stream statistics
curl -u admin:password https://your-server/api/stats/mystream

Viewer Analytics

Access detailed viewer statistics:

  • Current viewer count
  • Geographic distribution
  • Playback quality metrics
  • Buffer health

Troubleshooting

Stream Not Playing

  • Verify source is online and accessible
  • Check protocol compatibility with player
  • Review stream status in management interface

High Latency

  • Enable WebRTC for lowest latency
  • Reduce buffer size
  • Check network conditions

Transcoding Performance

  • Allocate sufficient CPU resources
  • Consider GPU acceleration
  • Reduce output quality/resolution

RTMP Connection Issues

  • Verify port 1935 is accessible
  • Check stream key/name
  • Review firewall settings

Additional Resources

Conclusion

MistServer on Klutch.sh provides a professional-grade streaming solution with support for virtually every streaming protocol and use case. Whether delivering live broadcasts, VOD content, or low-latency interactive streams, MistServer’s efficient architecture handles it all. With automatic HTTPS, persistent storage for recordings, and the universal player for maximum compatibility, you can build sophisticated streaming infrastructure without managing complex server setups.