Owncast: Self-Hosted Live Streaming
Twitch alternative for your homelab. Live streaming with chat and customization.
Owncast is a free, open-source live streaming and chat server that gives you complete control over your broadcasts. It’s a self-hosted alternative to platforms like Twitch, YouTube Live, and Facebook Live - with no ads, no algorithms, and no corporate oversight.
What is Owncast?
Owncast is a single-user live streaming server designed for independent streamers, content creators, and communities who want to own their platform. Built with modern web technologies, it provides professional streaming capabilities while respecting your privacy and giving you full ownership of your content and audience.
Why Choose Owncast?
Complete Independence:
- No platform restrictions or TOS changes
- Own your content and audience data
- No risk of arbitrary bans or demonetization
- Stream whatever you want (within legal limits)
Privacy-Focused:
- No tracking or analytics sharing
- Viewer data stays on your server
- Optional anonymous viewing
- No third-party data collection
Professional Features:
- HLS adaptive streaming for quality selection
- Built-in chat with moderation tools
- Social features and notifications
- Custom branding and theming
- Multi-bitrate transcoding
Zero Recurring Costs:
- No subscriptions or platform fees
- No revenue sharing required
- Pay only for your hosting/bandwidth
- Unlimited streaming hours
Owncast vs. Streaming Platforms
| Feature | Owncast | Twitch | YouTube Live |
|---|---|---|---|
| Monthly Cost | $0 | $0 (keeps 50%) | $0 (keeps 45%) |
| Content Ownership | Full | Limited | Limited |
| Privacy | Complete | Minimal | Minimal |
| Customization | Unlimited | Themes only | Minimal |
| Hardware Transcoding | Included | N/A | N/A |
| Viewer Analytics | Private | Public | Public |
| Monetization Control | 100% yours | Platform fees | Platform fees |
Prerequisites
Before starting, ensure you have:
- Docker and Docker Compose installed
- At least 2GB RAM (4GB+ recommended for transcoding)
- CPU with hardware transcoding (Intel Quick Sync or NVIDIA GPU recommended)
- Storage for recordings (optional)
- Domain name (optional but recommended)
- Stable upload bandwidth (5-10 Mbps minimum for 1080p)
Understanding Owncast Architecture
Owncast consists of several components:
Streaming Server: Receives RTMP streams from broadcasting software Web Server: Serves the web interface to viewers Transcoder: Converts incoming stream to multiple quality levels Chat Server: Real-time messaging with WebSocket Storage: Saves recordings and temporary HLS segments
Directory Structure
Create organized directories for Owncast:
# Create Owncast directories
mkdir -p /opt/owncast/{data,recordings}
# Set ownership
sudo chown -R $USER:$USER /opt/owncast Directory Explanation:
/opt/owncast/data: Configuration, database, stream key/opt/owncast/recordings: Optional saved streams
Docker Compose Configuration
Basic Setup
Create /opt/owncast/docker-compose.yml:
version: '3.8'
services:
owncast:
image: owncast/owncast:latest
container_name: owncast
restart: unless-stopped
ports:
- "8080:8080" # Web interface
- "1935:1935" # RTMP streaming
volumes:
- /opt/owncast/data:/app/data
environment:
- TZ=America/New_York Configuration Notes:
- Port 8080: Web interface for viewers
- Port 1935: RTMP input for streaming software
- Data persists in
/opt/owncast/data
With Hardware Transcoding (Intel Quick Sync)
Add device mapping for Intel hardware transcoding:
version: '3.8'
services:
owncast:
image: owncast/owncast:latest
container_name: owncast
restart: unless-stopped
ports:
- "8080:8080"
- "1935:1935"
devices:
- /dev/dri/renderD128:/dev/dri/renderD128
- /dev/dri/card0:/dev/dri/card0
group_add:
- "109" # render group ID - check with: getent group render
volumes:
- /opt/owncast/data:/app/data
- /opt/owncast/recordings:/app/data/recordings
environment:
- TZ=America/New_York Verify render group:
getent group render
# render:x:109:
# Use the number (109) in group_add With NVIDIA GPU Transcoding
For NVIDIA hardware transcoding:
version: '3.8'
services:
owncast:
image: owncast/owncast:latest
container_name: owncast
restart: unless-stopped
runtime: nvidia
ports:
- "8080:8080"
- "1935:1935"
environment:
- NVIDIA_VISIBLE_DEVICES=all
- NVIDIA_DRIVER_CAPABILITIES=compute,video,utility
- TZ=America/New_York
volumes:
- /opt/owncast/data:/app/data
- /opt/owncast/recordings:/app/data/recordings Prerequisites for NVIDIA:
- NVIDIA Container Toolkit installed
- Compatible GPU (GTX 1650+, RTX series)
- Recent drivers (version 470+)
Deployment
Verify Hardware Access
For Intel Quick Sync:
# Check devices exist
ls -la /dev/dri/
# Verify permissions
groups $USER
# Add if missing
sudo usermod -a -G video,render $USER For NVIDIA:
# Test NVIDIA runtime
docker run --rm --runtime=nvidia nvidia/cuda:12.0-base nvidia-smi Start Owncast
cd /opt/owncast
docker-compose up -d Monitor Startup
# Watch logs
docker logs -f owncast
# Look for successful startup
# "Web server is listening on port 8080" Access Web Interface
# Get your server IP
ip addr show | grep "inet " | grep -v 127.0.0.1
# Access admin interface
# http://YOUR-SERVER-IP:8080/admin Default Credentials:
- Username: admin
- Password: abc123
Change immediately after first login!
Initial Configuration
Admin Setup
Access http://YOUR-SERVER-IP:8080/admin and log in with default credentials.
Step 1: Change Admin Password
- Navigate to Settings → General
- Scroll to “Administrator Password”
- Enter strong password (16+ characters)
- Save changes
Step 2: Server Configuration
- Settings → General
- Instance Details:
- Server Name: Your Stream Name
- Server Summary: Brief description
- Server Logo: Upload your logo (300x300px recommended)
- Tags: Categories that describe your content
- NSFW Content: Mark if applicable
Step 3: Server URL
- Settings → General → Server URL
- Enter your domain:
https://stream.yourdomain.com - Or use IP:
http://YOUR-SERVER-IP:8080 - This appears in metadata and social sharing
Step 4: Get Stream Key
- Settings → General → Stream Key
- Copy your unique stream key
- Keep this secret - it’s like a password
- Regenerate if compromised
Configuring Streaming Settings
Video Quality Settings
- Navigate to Settings → Video
- Configure quality variants for viewers
Recommended Quality Ladder:
Source Passthrough (if bandwidth allows):
- Video Bitrate: Passthrough
- CPU Usage: Low
- This streams your exact output without transcoding
1080p High Quality:
- Video Bitrate: 4500 kbps
- Encoder Preset: veryfast
- Framerate: 30 or 60 fps
- CPU Usage: Medium
720p Medium Quality:
- Video Bitrate: 2500 kbps
- Encoder Preset: veryfast
- Framerate: 30 fps
- CPU Usage: Low
480p Low Quality (for mobile/slow connections):
- Video Bitrate: 1000 kbps
- Encoder Preset: ultrafast
- Framerate: 30 fps
- CPU Usage: Very Low
Audio Settings:
- Audio Bitrate: 128 kbps (all variants)
- Audio Passthrough: Enabled (if source is good)
Hardware Acceleration
Enable Hardware Transcoding:
- Settings → Video → Video Codec
- Select based on your hardware:
- Intel Quick Sync:
h264_qsvorh264_vaapi - NVIDIA NVENC:
h264_nvenc - CPU only:
libx264(slower)
- Intel Quick Sync:
Quality Preset for Hardware:
- Intel/NVIDIA: Medium or Fast
- CPU: Ultrafast or Veryfast
Test transcoding: Start streaming and monitor resource usage:
Intel:
intel_gpu_top NVIDIA:
watch -n 1 nvidia-smi CPU:
htop Storage and Recordings
Enable Stream Recording:
- Settings → Storage
- Enable “Save streams to disk”: Checked
- Recording location:
/app/data/recordings - Automatically remove recordings: Set retention (7 days, 30 days, etc.)
Storage Requirements:
- 1 hour 1080p stream: ~2-3GB
- 1 hour 720p stream: ~1-1.5GB
- Plan storage accordingly for your retention period
OBS Studio Configuration
Install OBS Studio
Download from obsproject.com for your platform:
- Windows, macOS, Linux supported
- Free and open source
Basic OBS Setup
Step 1: Scene Setup
- Create new scene: “Main Stream”
- Add sources:
- Display Capture (for screen sharing)
- Video Capture Device (for webcam)
- Image (for overlays/logos)
- Text (for titles/information)
Step 2: Configure Streaming
- Settings → Stream
- Service: Custom
- Server:
rtmp://YOUR-SERVER-IP:1935/live - Stream Key: Your Owncast stream key from admin panel
Step 3: Output Settings
Settings → Output → Streaming
For Hardware Encoding (NVIDIA):
- Encoder: NVIDIA NVENC H.264
- Rate Control: CBR
- Bitrate: 6000 kbps (1080p60) or 4500 kbps (1080p30)
- Keyframe Interval: 2
- Preset: Quality
- Profile: high
- GPU: 0
For Hardware Encoding (Intel Quick Sync):
- Encoder: QuickSync H.264
- Rate Control: CBR
- Bitrate: 6000 kbps
- Keyframe Interval: 2
- Preset: Quality
For CPU Encoding:
- Encoder: x264
- Rate Control: CBR
- Bitrate: 4500 kbps
- Keyframe Interval: 2
- Preset: veryfast
- Profile: high
Step 4: Video Settings
- Settings → Video
- Base Resolution: 1920x1080
- Output Resolution: 1920x1080
- FPS: 30 or 60
- Downscale Filter: Lanczos (best quality)
Step 5: Audio Settings
- Settings → Audio
- Sample Rate: 48 kHz
- Channels: Stereo
- Desktop Audio: Your system audio device
- Mic/Auxiliary Audio: Your microphone
Streaming Workflow
Start Streaming:
- Arrange your scenes and sources
- Check audio levels (peak at -6 dB)
- Click “Start Streaming”
- Verify stream in Owncast admin panel
Monitor Your Stream:
- Open Owncast admin panel
- Navigate to Dashboard
- Check viewer count, stream health
- Monitor chat if enabled
End Stream:
- Click “Stop Streaming” in OBS
- Stream ends on Owncast after ~10 seconds
- Recording saved if enabled
Chat Configuration
Enable Chat
- Settings → Chat
- Enable chat: Checked
- Configure chat settings:
- Require authentication: Optional (recommended)
- User display name rules: Set requirements
- Disable chat: Toggle during streams if needed
Moderation Tools
Moderator Accounts:
- Settings → Chat → Moderators
- Add moderator usernames
- Moderators can:
- Delete messages
- Ban users
- Set slow mode
Chat Rules:
- Create clear chat rules
- Display in chat description
- Enforce consistently
Ban Management:
- Settings → Chat → Banned Users
- View and manage banned IP addresses
- Temporary or permanent bans
Chat Integration
Webhooks:
- Settings → Webhooks
- Add webhook URL for notifications
- Receive events:
- New messages
- User join/leave
- Stream start/stop
Browser Source for OBS:
- Settings → Chat → Chat URL
- Copy chat overlay URL
- In OBS: Add Browser Source
- Paste URL, set dimensions
- Chat appears in stream
Federation and Social Features
Social Connections
Fediverse Integration (ActivityPub):
- Settings → Federation
- Enable Fediverse features: Checked
- Your Owncast instance appears in Fediverse
- Users can follow you from Mastodon, etc.
Configuration:
- Account name:
@[email protected] - Bio: Your stream description
- Avatar: Upload profile image
Benefits:
- Reach Fediverse audience
- Followers notified when live
- Decentralized social presence
Notifications
Stream Notifications:
- Settings → Notifications
- Configure notification methods:
- Discord webhook
- Browser notifications
- Custom webhooks
Discord Integration:
- Create Discord webhook in server settings
- Copy webhook URL
- Settings → Notifications → Discord
- Paste URL
- Sends message when stream starts
Custom Branding and Theming
Customize Appearance
Logo and Colors:
- Settings → General → Appearance
- Upload custom logo (SVG or PNG)
- Set primary color (hex code)
- Set background color
- Choose light or dark theme default
Custom CSS:
- Settings → Advanced → Custom Styles
- Add CSS to customize appearance:
/* Example: Custom chat background */
.chat-container {
background-color: #1a1a1a;
}
/* Custom primary color */
:root {
--theme-primary: #6366f1;
} Custom Pages
About Page:
- Settings → General → About
- Write about your stream
- Supports Markdown formatting
- Links, images, formatting
Social Links:
- Settings → General → Social Links
- Add your social media:
- Twitter/X
- YouTube
- Discord
- GitHub
- Custom links
Remote Access
Option 1: Caddy Reverse Proxy (Recommended)
Install Caddy:
docker run -d --name caddy --restart unless-stopped --network host -v /opt/caddy/Caddyfile:/etc/caddy/Caddyfile -v /opt/caddy/data:/data caddy:latest Create Caddyfile at /opt/caddy/Caddyfile:
stream.yourdomain.com {
reverse_proxy localhost:8080
} Configure DNS:
- Create A record:
stream.yourdomain.com→ Your public IP - Caddy automatically gets SSL certificate
Update Owncast:
- Settings → General → Server URL
- Set to:
https://stream.yourdomain.com - Save
Option 2: Cloudflare Tunnel
For streaming without port forwarding:
Install Cloudflared:
docker run -d --name cloudflared --restart unless-stopped cloudflare/cloudflared:latest tunnel --no-autoupdate run --token YOUR-TUNNEL-TOKEN Benefits:
- No port forwarding needed
- DDoS protection
- Free SSL certificate
- Bandwidth acceleration
Firewall Configuration
# Allow web access
sudo ufw allow 8080/tcp
# Allow RTMP streaming
sudo ufw allow 1935/tcp
# If using reverse proxy
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp Advanced Features
Multi-Bitrate Streaming
Configure multiple quality variants for adaptive streaming:
- Settings → Video
- Add video stream variants
- Each variant creates different quality:
- High: 1080p 4500 kbps
- Medium: 720p 2500 kbps
- Low: 480p 1000 kbps
Benefits:
- Viewers choose quality based on connection
- Better experience for mobile users
- Reduced buffering
Stream Latency
Reduce Latency:
- Settings → Video → Latency
- Latency Level:
- Standard: 8-12 seconds (most reliable)
- Low: 3-5 seconds (good balance)
- Ultra-low: 1-2 seconds (experimental)
Trade-offs:
- Lower latency = less buffer for network issues
- Higher latency = more stable for viewers
- Recommend Low for most use cases
Custom RTMP Endpoints
Multiple Stream Forwarding: Send your stream to other platforms simultaneously:
- Settings → Stream Output
- Add RTMP destinations:
- Twitch:
rtmp://live.twitch.tv/app/YOUR-KEY - YouTube:
rtmp://a.rtmp.youtube.com/live2/YOUR-KEY - Custom server
- Twitch:
Multi-streaming Benefits:
- Reach multiple audiences
- Backup streaming
- Archive to multiple locations
Performance Optimization
Transcoding Optimization
For Intel Quick Sync:
- Use
h264_qsvencoder - Preset: Medium
- Expected: 3-5 simultaneous transcodes
For NVIDIA GPU:
- Use
h264_nvencencoder - Preset: Quality or Performance
- Expected: 5-8 simultaneous transcodes
CPU Only:
- Use
libx264encoder - Preset: Ultrafast or Veryfast
- Limit quality variants to 1-2
Bandwidth Requirements
Upload Bandwidth Needed:
- 1080p60: 6-8 Mbps
- 1080p30: 4-5 Mbps
- 720p30: 2.5-3 Mbps
- 480p30: 1-1.5 Mbps
Plus viewer bandwidth:
- Each viewer downloads selected quality
- Use CDN for many viewers
- Monitor bandwidth usage
Storage Optimization
Recording Storage:
# Check disk usage
du -sh /opt/owncast/recordings
# Clean old recordings
find /opt/owncast/recordings -name "*.mp4" -mtime +30 -delete HLS Segment Cleanup: Owncast automatically cleans up temporary segments after stream ends.
Monitoring and Analytics
Built-in Analytics
Viewer Statistics:
- Admin Dashboard
- View metrics:
- Current viewers
- Peak viewers
- Total view time
- Chat messages
Stream Health:
- Incoming bitrate
- Dropped frames
- Stream uptime
- Quality variant usage
External Monitoring
Prometheus Metrics:
Owncast exposes metrics at /api/admin/prometheus:
# Add to prometheus.yml
scrape_configs:
- job_name: 'owncast'
static_configs:
- targets: ['YOUR-SERVER-IP:8080']
metrics_path: '/api/admin/prometheus' Grafana Dashboard: Visualize metrics:
- Viewer count over time
- Chat activity
- Stream quality
- System resources
Troubleshooting
Common Issues
Issue: Cannot Connect to Stream
Check RTMP connection:
# Test RTMP endpoint
telnet YOUR-SERVER-IP 1935
# Check container logs
docker logs owncast
# Verify firewall
sudo ufw status Solutions:
- Verify RTMP port 1935 is open
- Check stream key is correct
- Ensure container is running
Issue: Hardware Transcoding Not Working
Diagnostics:
# Check device access
docker exec owncast ls -la /dev/dri/
# Verify codec availability
docker exec owncast ffmpeg -codecs | grep h264 Solutions:
- Verify device mapping in docker-compose
- Check group_add for render group
- Ensure drivers are installed on host
Issue: Viewers Experience Buffering
Solutions:
- Lower your streaming bitrate in OBS
- Reduce quality variants in Owncast
- Increase keyframe interval to 2-4 seconds
- Check your upload bandwidth
- Enable hardware transcoding
Issue: Chat Not Working
Solutions:
- Clear browser cache
- Check if chat is enabled in settings
- Verify WebSocket connections aren’t blocked
- Check browser console for errors
Issue: High CPU Usage
Solutions:
- Enable hardware transcoding
- Reduce number of quality variants
- Increase encoder preset speed (veryfast, ultrafast)
- Limit concurrent streams
Security Best Practices
Stream Key Security
Protect Your Stream Key:
- Never share publicly
- Don’t commit to version control
- Regenerate if exposed
- Use different keys for different streams
Regenerate Stream Key:
- Settings → General → Stream Key
- Click “Regenerate”
- Update in OBS
Network Security
Firewall Configuration:
# Restrict admin access to local network
sudo ufw allow from 192.168.1.0/24 to any port 8080
# Or use reverse proxy with authentication HTTPS Only:
- Always use SSL for web access
- Protect admin login
- Encrypt viewer connections
Content Moderation
Chat Moderation:
- Assign trusted moderators
- Set clear chat rules
- Use banned word filters
- Enable slow mode if needed
DMCA Compliance:
- Only stream content you own or have rights to
- Respond promptly to DMCA notices
- Keep logs for compliance
- Consider terms of service
Backup and Recovery
Configuration Backup
Backup Owncast Data:
# Stop container
cd /opt/owncast
docker-compose down
# Create backup
tar -czf owncast-backup-$(date +%Y%m%d).tar.gz /opt/owncast/data
# Restart
docker-compose up -d Automated Backup Script:
#!/bin/bash
# /opt/scripts/backup-owncast.sh
BACKUP_DIR="/backups/owncast"
DATE=$(date +%Y%m%d_%H%M%S)
mkdir -p $BACKUP_DIR
cd /opt/owncast
docker-compose down
tar -czf $BACKUP_DIR/owncast-data-$DATE.tar.gz /opt/owncast/data
docker-compose up -d
# Keep last 14 backups
ls -t $BACKUP_DIR/owncast-data-*.tar.gz | tail -n +15 | xargs -r rm
echo "Backup completed: $BACKUP_DIR/owncast-data-$DATE.tar.gz" Schedule with Cron:
# Run weekly on Sunday at 3 AM
0 3 * * 0 /opt/scripts/backup-owncast.sh Disaster Recovery
Restore from Backup:
# Stop container
docker-compose down
# Remove current data
mv /opt/owncast/data /opt/owncast/data.old
# Extract backup
tar -xzf owncast-backup-20250115.tar.gz -C /
# Restore ownership
sudo chown -R $USER:$USER /opt/owncast/data
# Start container
docker-compose up -d Next Steps
Immediate Actions
After completing basic setup:
- Test stream with OBS Studio
- Configure quality variants for your hardware
- Set up chat moderation tools
- Enable hardware transcoding
- Configure remote access with domain
- Create automated backups
Advanced Configurations
Full Streaming Stack:
- Owncast for live streaming
- Jellyfin for VOD archive
- Automated recording uploads
- Multi-platform streaming
Content Distribution:
- CDN for global viewers
- Multiple Owncast instances
- Load balancing
- Geographic distribution
Automation:
- Stream schedule automation
- Recording processing
- Social media announcements
- Analytics reporting
Resources
Official Documentation:
- owncast.online: Official website
- github.com/owncast/owncast: Source code
- owncast.online/docs: Complete documentation
Community Support:
- Discord: Real-time help
- GitHub Issues: Bug reports
- Community forums
Related Guides:
- OBS Studio setup and optimization
- Hardware transcoding guide
- Jellyfin for VOD
- Reverse proxy configuration
Start streaming on your own terms with complete control and ownership!