Introduction
PeerTube is a free and open-source video hosting platform developed by Framasoft. It uses ActivityPub for federation between instances and WebTorrent or HLS for peer-to-peer video delivery, reducing bandwidth costs while letting communities run independent video platforms that can still share content.
What PeerTube Does
- Hosts and streams video content on your own server with full administrative control
- Federates with other PeerTube instances via ActivityPub so users can follow remote channels
- Distributes video delivery load using WebTorrent peer-to-peer or HLS streaming
- Supports live streaming with RTMP/RTMPS ingest
- Provides plugin and theme systems for customizing instance behavior and appearance
Architecture Overview
PeerTube is built with Node.js and TypeScript on the back end, using PostgreSQL for data storage and Redis for caching and job queues. Video files are transcoded via FFmpeg into multiple resolutions. The front end is an Angular single-page application. Federation uses the ActivityPub protocol to share videos, comments, and user interactions across instances. Video delivery can use HLS with optional P2P via the p2p-media-loader library.
Self-Hosting & Configuration
- Requires Node.js 18+, PostgreSQL 13+, Redis 6+, and FFmpeg
- Configure instance name, description, and signup policies in the admin panel
- Set storage paths and transcoding options in
production.yaml - Enable or disable P2P delivery, live streaming, and auto-blacklist per instance
- Official Docker Compose setup available for streamlined deployment
Key Features
- Federation via ActivityPub connecting independent instances into a shared network
- Plugin system supporting custom auth providers, video filters, and UI themes
- Live streaming with chat, replay archiving, and latency controls
- Video redundancy system where instances can mirror popular content from peers
- Granular moderation tools including auto-tag, abuse reports, and instance-level blocks
Comparison with Similar Tools
- YouTube — Centralized, ad-supported, proprietary; PeerTube is self-hosted and ad-free
- Odysee/LBRY — Blockchain-based, centralized front end; PeerTube is fully federated
- MediaCMS — Simpler self-hosted video CMS, no federation support
- Owncast — Focused on live streaming only, no video library or federation
- Jellyfin — Personal media server, not designed for public video hosting or federation
FAQ
Q: How much bandwidth does PeerTube save with P2P? A: P2P delivery offloads a portion of traffic to viewers' browsers. Savings depend on concurrent viewers; popular videos with many simultaneous watchers benefit most.
Q: Can PeerTube instances communicate with Mastodon? A: Yes. PeerTube uses ActivityPub, so Mastodon users can follow PeerTube channels, comment on videos, and see new uploads in their feed.
Q: What transcoding formats does PeerTube support? A: PeerTube transcodes uploads into multiple HLS resolutions using FFmpeg. It supports H.264 and can be configured for H.265/VP9 via custom transcoding profiles.
Q: Is PeerTube suitable for large-scale video hosting? A: PeerTube is designed for community-scale instances. For very high traffic, the redundancy and P2P features help, but you should plan storage and bandwidth accordingly.