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└── .dockerignoreCreating the Dockerfile
Create a Dockerfile:
FROM ddvtech/mistserver:latest
# Set environment variablesENV MistUsername=${MistUsername:-admin}ENV MistPassword=${MistPassword}
# Create directories for contentRUN mkdir -p /media/vod /media/recordings /config
# Expose ports# 4242 - Management interface# 8080 - HTTP streaming# 1935 - RTMP# 554 - RTSPEXPOSE 4242 8080 1935 554
# Health checkHEALTHCHECK --interval=30s --timeout=10s --start-period=30s --retries=3 \ CMD curl -f http://localhost:8080/ || exit 1
# Start MistServerCMD ["MistController", "-c", "/config/config.json"]Environment Variables Reference
| Variable | Required | Default | Description |
|---|---|---|---|
MistUsername | No | admin | Admin panel username |
MistPassword | Yes | - | Admin panel password |
MistConfig | No | - | Path to configuration file |
MistDebug | No | 0 | Debug level (0-10) |
Deploying MistServer on Klutch.sh
- Select HTTP as the traffic type
- Set the internal port to 8080 for streaming delivery
- Note: Additional ports may be needed for RTMP ingest
Create a Secure Admin Password
Generate a strong password for the admin interface:
openssl rand -base64 24Push Your Repository to GitHub
git initgit add Dockerfile .dockerignore README.mdgit commit -m "Initial MistServer deployment"git remote add origin https://github.com/yourusername/mistserver-deploy.gitgit push -u origin mainCreate 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:
Set Environment Variables
Configure your environment:
| Variable | Value |
|---|---|
MistUsername | Your admin username |
MistPassword | Your secure password |
Attach Persistent Volumes
Add volumes for content and configuration:
| Mount Path | Recommended Size | Purpose |
|---|---|---|
/config | 1 GB | Server configuration |
/media/vod | 100+ GB | Video on demand files |
/media/recordings | 100+ GB | DVR 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
- Access the management interface
- Navigate to Streams
- Click New Stream
- 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:
- Create a new stream with “Push” source
- Note the RTMP URL:
rtmp://your-server/live/streamname - 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:
- Navigate to stream settings
- Enable WebRTC output protocol
- Use MistServer’s player for WebRTC playback
Video on Demand (VOD)
Adding VOD Content
- Upload video files to
/media/vod - Create a new stream in the management interface
- Set source to the file path
- MistServer automatically handles adaptive delivery
Folder-Based VOD
Configure automatic VOD from a folder:
- Create a stream with folder source
- Point to
/media/vod - 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:
- Open stream settings
- Set DVR Window to desired duration
- Viewers can seek within the DVR window
Recording Streams
Set up automatic recording:
- Configure recording output in stream settings
- Set destination path:
/media/recordings - Choose recording format (MP4, TS)
- Optionally schedule recordings
API Integration
Stream Control via API
# List all streamscurl -u admin:password https://your-server/api/streams
# Create a new streamcurl -u admin:password -X POST \ -d '{"name":"mystream","source":"rtmp://source.com/live/stream"}' \ https://your-server/api/streams
# Get stream statisticscurl -u admin:password https://your-server/api/stats/mystreamViewer 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
- MistServer Official Website
- MistServer Documentation
- MistServer GitHub Repository
- MistServer API Reference
- Klutch.sh Persistent Volumes
- Klutch.sh Deployments
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.