If you’re tired of YouTube’s algorithm-driven feed, invasive tracking, unpredictable demonetization, and opaque content policies, it’s time to look at PeerTube — the open-source, federated video platform that lets you host, share, and stream video on your own terms.
PeerTube is not just a self-hosted video player. It’s a full-featured video platform with its own player, transcoding engine, user accounts, channels, playlists, and — most importantly — federation via ActivityPub. Your PeerTube instance can talk to other instances, share content, and let followers subscribe across servers. It’s the video layer of the fediverse, sitting alongside Mastodon, PixelFed, and Lemmy.
In this guide, we’ll cover why PeerTube matters, how to deploy it with docker, configure storage and transcoding, set up federation, and manage a production instance at scale.
Why Self-Host Your Video Platform
Running your own video server gives you benefits that no centralized platform can match:
Complete Content Control
No algorithm decides what your audience sees. No surprise demonetization. No opaque community guidelines enforced by a distant moderation team. You set the rules, you own the content, and your viewers choose to watch — not because an algorithm pushed it, but because they subscribed.
No Tracking or Ads
YouTube tracks every click, pause, rewind, and scroll. PeerTube collects none of this by default. There are no ads, no sponsored content mandates, and no watch-time optimization games. Your viewers watch in peace.
Data Sovereignty
Your video files, your metadata, your user database — all stored on hardware you control. No risk of platform shutdowns, account suspensions, or policy changes wiping your channel overnight.
Federation
This is PeerTube’s killer feature. A single instance can join a network of thousands of others. Content from your server can appear on remote instances, and vice versa. You get the reach of a centralized platform with the independence of self-hosting.
Cost Predictability
At small to medium scale, a VPS with decent storage is all you need. No per-view fees, no revenue sharing, no surprise bills. As your audience grows, costs scale linearly and transparently.
PeerTube at a Glance
| Feature | PeerTube | YouTube |
|---|---|---|
| Cost | Free (open source, self-hosted) | Free (you are the product) |
| Open Source | ✅ Fully (AGPL-3.0) | ❌ Proprietary |
| Ads | ❌ None | ✅ Everywhere |
| Tracking | ❌ Minimal by design | ✅ Extensive |
| Algorithm | ❌ Chronological + subscriptions | ✅ Opaque recommendation engine |
| Federation | ✅ ActivityPub (join the fediverse) | ❌ Walled garden |
| Transcoding | ✅ Built-in (WebTorrent + HLS) | ✅ Proprietary pipeline |
| Live Streaming | ✅ Built-in | ✅ Built-in |
| Custom Domain | ✅ Your server, your domain | ❌ youtube.com/yourchannel |
| Content Policy | ✅ You decide | ❌ Google decides |
| Monetization | ✅ Direct support (Liberapay, Patreon) | ✅ Ad revenue share (platform-controlled) |
| Storage | ✅ Your hardware / cloud | ✅ Google’s infrastructure |
| Mobile Apps | ⚠️ Third-party apps available | ✅ Official apps |
Architecture Overview
PeerTube is a Node.js application backed by PostgreSQL and powered by two key technologies:
WebTorrent — Peer-to-peer video delivery. When someone watches a video on your instance, their browser also seeds it to other viewers, reducing your bandwidth costs naturally.
ActivityPub — The W3C federated protocol. Your instance can follow and be followed by other PeerTube instances, as well as Mastodon accounts, PixelFed users, and any ActivityPub-compatible service.
The default stack includes:
- Node.js backend (TypeScript)
- PostgreSQL database
- NGINX as reverse proxy
- FFmpeg for video transcoding
- Redis for caching and job queues
- WebTorrent tracker for P2P delivery
Docker Deployment
The fastest way to get PeerTube running is with Docker Compose. The official repository provides a production-ready compose file.
Prerequisites
- A server with at least 2 CPU cores and 4 GB RAM (4 cores / 8 GB recommended for transcoding)
- 50+ GB of storage for videos (SSD preferred for the database, HDD for video storage)
- A domain name with DNS records pointing to your server
- Docker and Docker Compose installed
Step 1: Get the Docker Compose File
| |
Step 2: Configure Environment Variables
Create a .env file or edit the docker-compose.yaml directly. Here’s a minimal production setup:
| |
Step 3: Launch
| |
PeerTube will initialize the database, generate configuration, and start the application. The first startup takes a few minutes as it runs migrations.
Step 4: Set Up TLS with NGINX
The PeerTube Docker image includes a built-in NGINX configuration, but for production you’ll want proper TLS. The easiest approach is to use a reverse proxy container:
| |
Step 5: Initial Admin Setup
After startup, PeerTube creates a random admin password. Find it in the logs:
| |
Log in at https://video.example.com, change the password immediately, and configure your instance settings under Administration → Configuration.
Storage and Transcoding Configuration
Video hosting is storage-intensive. Proper configuration prevents disk-space surprises.
Transcoding Settings
PeerTube transcodes uploaded videos into multiple resolutions. Configure this under Administration → Configuration → Video Transcoding:
| Resolution | Bitrate | Use Case |
|---|---|---|
| 240p | 250 kbps | Mobile, low bandwidth |
| 360p | 500 kbps | Small screens, slow connections |
| 480p | 1000 kbps | Standard mobile |
| 720p | 2500 kbps | Desktop standard |
| 1080p | 5000 kbps | Full HD |
For a small instance, start with 360p and 720p only. Add more resolutions as your storage budget grows.
| |
Storage Quotas
Set per-user and per-video upload limits to prevent any single user from consuming all disk space:
| |
For multi-disk setups, mount a separate HDD for video storage and keep the SSD for the database and config:
| |
Cleanup and Maintenance
Enable automatic cleanup of failed uploads and temporary files:
| |
For larger instances, consider offminiong video storage to MinIO or Backblaze B2:
| |
Federation and the Fediverse
Federation is what makes PeerTube special. Instead of being a standalone island, your instance becomes part of a global network.
How Federation Works
When you subscribe to a channel on another PeerTube instance, your server periodically polls that remote server for new videos. When someone on a remote instance follows your channel, your server pushes video updates to theirs via ActivityPub.
Enabling and Configuring Federation
| |
Under Administration → Configuration → Federation:
- Allow following remote accounts: Enable to let your users follow channels on other instances
- Allow instance to follow: Enable to let your instance’s admin account follow remote channels
- Auto-follow index: Consider following
video.index.fediverse.observerfor content discovery
PeerTube ↔ Mastodon Integration
PeerTube integrates natively with Mastodon:
- When you publish a video, PeerTube can auto-post to a linked Mastodon account
- Mastodon users can follow PeerTube channels and see new videos in their timeline
- Video embeds appear as rich cards in Mastodon posts
Configure this under Administration → Configuration → Federation → ActivityPub:
| |
Instance Blocking and Moderation
You control what content appears on your instance:
| |
Performance Tuning
A well-tuned PeerTube instance can serve hundreds of concurrent viewers on modest hardware.
NGINX Caching
The built-in NGINX configuration already includes basic caching. For higher traffic, add explicit cache headers:
| |
Database Optimization
For PostgreSQL, tune these settings in postgresql.conf:
| |
Redis Configuration
PeerTube uses Redis for job queues and caching. For production:
| |
Monitoring
Use the built-in health check endpoint:
| |
For comprehensive monprometheusxport metrics to Prometheus:
| |
Backup and Disaster Recovery
Your video content is irreplaceable. Set up automated backups:
Database Backup
| |
Add to crontab:
| |
Video File Backup
| |
Full Instance Migration
To move your PeerTube instance to a new server:
- Stop the current instance:
docker compose down - Copy all volumes:
rsync -avz ./docker-volume/ new-server:/path/ - Copy database backup and restore on new server
- Update DNS to point to the new server IP
- Start on new server:
docker compose up -d
The domain name must remain the same for federation to work correctly. ActivityPub URLs are tied to the domain, and changing it breaks all existing followers.
Mobile Access and Third-Party Apps
PeerTube doesn’t have official mobile apps, but the fediverse ecosystem provides options:
| App | Platform | Notes |
|---|---|---|
| TubiTeka | Android | Dedicated PeerTube client, open source |
| PeerTube Mobile | Android | Lightweight viewer with subscription support |
| Fedilab | Android | Multi-protocol fediverse app (Mastodon + PeerTube) |
| Web PWA | Any | Install PeerTube as a Progressive Web App |
| Video web embeds | Any | Embed videos on any website or blog |
To enable PWA support, ensure your NGINX serves the service worker correctly — the default PeerTube configuration handles this automatically.
Common Pitfalls and Troubleshooting
Video Upload Fails
Check transcoding logs:
| |
Common causes: insufficient disk space, FFmpeg not available, or the video format is unsupported.
Federation Not Working
- Verify your domain resolves correctly:
dig video.example.com - Check that TLS is valid:
curl -I https://video.example.com - Ensure ActivityPub endpoints are reachable:
curl https://video.example.com/.well-known/webfinger?resource=acct:admin@video.example.com - Check the federation queue in Administration → Logs
High Bandwidth Usage
- Enable WebTorrent P2P — viewers seed to each other, reducing server bandwidth
- Set up redundancy with remote PeerTube instances that mirror your popular videos
- Configure transcoding to fewer resolutions to reduce total file size
- Consider a CDN or object storage for hot content
Database Growth
Over time, the PostgreSQL database grows with view counts, federation data, and activity logs. Clean up periodically:
| |
When PeerTube Is the Right Choice
PeerTube excels when:
- You want a YouTube-like experience without YouTube’s downsides
- You value content independence — your videos belong to you
- Your community benefits from federation and cross-instance discovery
- You need live streaming with open-source tooling
- You want direct monetization through viewer support rather than ad revenue
- You’re building a community platform where video is a core feature
It may not be the best fit if:
- You need massive scale (millions of concurrent viewers) — consider a CDN-first architecture
- You require official mobile apps with push notifications
- You want algorithmic content discovery and recommendation
Getting Started Today
The fastest path to your own PeerTube instance:
- Provision a VPS with 4 CPU cores, 8 GB RAM, and 100 GB storage
- Point a domain to the server IP
- Deploy with Docker Compose using the configuration above
- Set up TLS with Let’s Encrypt
- Create your first channel and upload a video
- Follow other instances to join the fediverse
The entire setup takes under 30 minutes. Your video platform, your rules, your data.
PeerTube repository: github.com/Chocobozzz/PeerTube Official documentation: docs.joinpeertube.org Fediverse instance directory: instances.joinpeertube.org
Frequently Asked Questions (FAQ)
Which one should I choose in 2026?
The best choice depends on your specific requirements:
- For beginners: Start with the simplest option that covers your core use case
- For production: Choose the solution with the most active community and documentation
- For teams: Look for collaboration features and user management
- For privacy: Prefer fully open-source, self-hosted options with no telemetry
Refer to the comparison table above for detailed feature breakdowns.
Can I migrate between these tools?
Most tools support data import/export. Always:
- Backup your current data
- Test the migration on a staging environment
- Check official migration guides in the documentation
Are there free versions available?
All tools in this guide offer free, open-source editions. Some also provide paid plans with additional features, priority support, or managed hosting.
How do I get started?
- Review the comparison table to identify your requirements
- Visit the official documentation (links provided above)
- Start with a Docker Compose setup for easy testing
- Join the community forums for troubleshooting