Overview
Discover what makes PeerTube powerful
PeerTube is a self‑hosted, federated video platform that replaces centralized services like YouTube with an open‑source, community‑owned network. From a developer’s perspective it is a full‑stack application that bundles video ingestion, transcoding, storage, and distribution while exposing a rich REST/JSON‑API for integration. The core goal is to give operators complete control over data, moderation policies, and monetization while still allowing cross‑instance discovery via ActivityPub.
Backend
Frontend
Media Pipeline
Federation
Overview
PeerTube is a self‑hosted, federated video platform that replaces centralized services like YouTube with an open‑source, community‑owned network. From a developer’s perspective it is a full‑stack application that bundles video ingestion, transcoding, storage, and distribution while exposing a rich REST/JSON‑API for integration. The core goal is to give operators complete control over data, moderation policies, and monetization while still allowing cross‑instance discovery via ActivityPub.
Technical Stack
- Backend: Written in Node.js with the
expressframework, leveragingpassportfor authentication andsequelizeas an ORM. - Frontend: Angular (v12+) delivers a SPA experience; the client talks to the backend through JSON endpoints and WebSocket streams for live events.
- Media Pipeline: Video files are processed by
ffmpeg(via thefluent-ffmpegwrapper) into HLS and DASH manifests, then stored in a PostgreSQL‑backed database for metadata and an S3/MinIO compatible object store for the actual media files. - Federation: ActivityPub is implemented using
activitypub-node, enabling instances to share videos, comments, and follow relationships. - Database: PostgreSQL (>=12) for relational data; Redis is optional for caching and job queues.
- Background Workers: Node‑based workers (using
bull/Redis) handle transcoding, thumbnail generation, and federation tasks asynchronously.
Core Capabilities
- REST/JSON API: CRUD operations for videos, channels, playlists, and user accounts; OAuth2 support for third‑party clients.
- Webhooks & ActivityPub: Subscribe to events such as new uploads or instance joins; publish and consume ActivityPub objects for federation.
- Transcoding Jobs: Expose job status, progress, and logs via API; allow custom transcoding profiles.
- Plugin System: Loadable modules (npm packages) that hook into lifecycle events, add routes, or extend the UI.
- CLI Tools:
peertube-clifor database migrations, instance checks, and media cleanup.
Deployment & Infrastructure
PeerTube can be deployed on any Linux distribution with Node.js, PostgreSQL, and a compatible object store. Docker Compose is the official deployment method; images are available on Docker Hub (chocobozzz/peertube). Kubernetes manifests (Helm chart) are community‑maintained. For scaling, horizontal pod autoscaling can be applied to the worker pool; media files are served via a CDN or edge cache (e.g., Cloudflare R2). The application is stateless except for the database and object store, making it straightforward to add replicas.
Integration & Extensibility
- Custom Authentication: Replace the default passport strategies with LDAP, SAML, or OAuth providers.
- External Analytics: Expose raw event streams that can be consumed by Prometheus or Grafana dashboards.
- Content Moderation: Hook into the moderation API to integrate AI‑based filtering or external policy engines.
- UI Themes: Angular components can be overridden via CSS variables and custom component bundles.
Developer Experience
The documentation is hosted on the official website and includes a dedicated “Developer” section with API reference, SDK examples (JavaScript/TypeScript), and migration guides. The community is active on GitHub Discussions, Matrix rooms, and a dedicated Mastodon instance, providing quick support for integration questions. The open‑source license (AGPLv3) encourages customization while ensuring that improvements remain community‑shared.
Use Cases
- Educational Institutions: Host lecture videos on a private federated network, avoiding third‑party trackers.
- NGOs & Advocacy Groups: Create a resilient platform that can interoperate with other activist networks (e.g., Mastodon).
- Enterprise Video Portals: Deploy an internal video hub with custom authentication and analytics, while still allowing selective federation.
- Open‑Source Projects: Provide a community channel for demos, tutorials, and release videos without vendor lock‑in.
Advantages
- No Vendor Lock‑In: Operators own the code, data, and moderation policies.
- Federated Growth: Small instances can interconnect, creating a larger audience without central servers.
- Performance & Flexibility: Node.js + Angular offers modern, responsive UI; the transcoding pipeline is fully configurable.
- Open‑Source Licensing: AGPLv3 ensures that any modifications are shared, fostering a healthy ecosystem.
- Scalable Architecture: Stateless API servers, worker queues, and CDN‑compatible storage make horizontal scaling straightforward.
PeerTube delivers a developer‑friendly platform that balances modern web technologies with the principles of decentralization, giving you full control over your video distribution while still tapping into a growing federated community.
Open SourceReady to get started?
Join the community and start self-hosting PeerTube today
Related Apps in other
Immich
Self‑hosted photo and video manager
Syncthing
Peer‑to‑peer file sync, no central server
Strapi
Open-source headless CMS for modern developers
reveal.js
Create stunning web‑based presentations with HTML, CSS and JavaScript
Stirling-PDF
Local web PDF editor with split, merge, convert and more
MinIO
Fast, S3-compatible object storage for AI and analytics
Weekly Views
Repository Health
Information
Explore More Apps
Ergo
Modern, feature‑rich IRC server in Go
Ghostfolio
Track and analyze your investments with privacy-first precision
OpenTrashmail
Disposable email service with web UI, API, RSS and hooks
Ghost
Professional publishing for modern audiences
Routr
Cloud‑native SIP proxy, registrar and location server
Gitea
Fast, lightweight self-hosted Git platform