# PeerTube

PeerTube is a free and open-source, decentralized, ActivityPub federated video platform. It can use peer-to-peer technology to reduce load on individual servers when videos get popular.
Started in 2017 by a programmer known as Chocobozzz, development of PeerTube is now supported by the French non-profit Framasoft. The aim is to provide an alternative to centralized platforms such as YouTube, Vimeo, and Dailymotion.
As an ActivityPub platform, it is part of the federated network known as the Fediverse.

## Operation

Each PeerTube instance provides a website to browse and watch videos, and is by default independent from others in terms of appearance, features and rules.
Several instances, with common rules (e.g. allowing for similar content, requiring registration) can form federations, where they follow one's videos, even though each video is stored only by the instance that published it. Federations are independent from each other and asymmetrical: one instance can follow another to display their videos without them having to do the same. Instances' administrators can each choose to mirror individual videos or whole friend instances, creating an incentive to build communities of shared bandwidth.
Videos are made available via HTTP to download, but playback favors a peer-to-peer playback using HLS and WebRTC P2P. (not to be confused with WebTorrent which Peertube previously also supported but discontinued beginning with version 6) Users connected to the platform act as relay points that send pieces of video to other users, lessening the bandwidth of each to the server and thus allowing smaller hardware to operate at a lower cost.

## Origins and history

PeerTube was created by a web developer known as Chocobozzz as a peer-to-peer alternative to YouTube, initially utilizing the WebTorrent protocol to share videos. He was contacted in 2017 by Framasoft, which had a campaign called Contributopia, the goal of which is to create alternatives to centralized platforms. In order to support him and his work, notably on improving the design and usability, Framasoft hired the developer.
In 2018, Framasoft launched a crowdfunding on KissKissBankBank which raised €53,100 — more than double the initial goal of €20,000.
The first beta of PeerTube was released in March 2018 and the first stable version in October 2018. In June 2018, only a few months after the first beta, 113 instances are publicly available on the web that together host more than 10,000 videos.
In June 2018, as a result of its videos disappearing amid changes regarding the monetization of YouTube channels, the Blender Foundation began experimenting with hosting a PeerTube instance to distribute copies of the foundation's videos.
In May 2020, Framasoft published a roadmap of the software for the later half of the year and created a fundraising campaign requiring €60,000 for aiding the development. Five months later (in October 2020), PeerTube announced that they reached their fundraising goal of €60,000 after a €10,000 donation from Debian. Throughout the later half of 2020, PeerTube has added features such as global search, improved playlists, and more moderation tools.
End 2020, the meta-search engine Sepia Search was launched by Framasoft, allowing a global search on all PeerTube instances at once. To-date (2021) Sepia Search totalises close to 800 individual instances.
In January 2021, Framasoft announced the release of PeerTube v3.0 with the help of the successful fundraising campaign. The release highlighted peer-to-peer live streaming as the major feature of the release.
On April, the 28th of 2022, the European Data Protection Supervisor (EDPS) launched a pilot ActivityPub video platform EU Video of the EU institutions, bodies and agencies (EUIs), based on PeerTube. The pilot project was officially closed on 18 May 2024, without an official continuation.
Official Android and iOS mobile apps were released, that provide ability to play content from PeerTube instances. Andoid app, available via F-Droid and Google Play, allow for access from all or limited number of instances, respectively. iOS app available via Apple App Store provides content from a narrow list of selected instances.

## Technology

PeerTube up until version 6.0.0 offered both HLS over WebRTC-P2P (often referred to as "HLS with P2P") and WebTorrent technology. WebTorrent is basically the BitTorrent protocol re-implemented on top of WebRTC. With WebTorrent each server hosts a torrent tracker and each web browser viewing a video also shares it. Normally HLS is implemented using "hls.js" and doesn't have any P2P functionality. The PeerTube project extended it with a custom loader that simultaneously downloads video chunks from both the webserver as well as via other viewers via WebRTC. This allows to share the load between the server itself and the clients as well as the bandwidth used through P2P technology.
The system works via a federation of instances run by independent entities. Each PeerTube server can host any number of videos by itself, and can additionally federate with other servers to let users watch their videos in the same user interface. This federation permits collectively hosting a large number of videos in a unified platform, without having to build an infrastructure comparable to that of the web giants. Each server is operated by and stays under the sole administration of a distinct entity.
PeerTube uses the ActivityPub protocol in order to allow decentralization and compatibility with other fediverse services, which can prevent vendor lock-in and makes it more resilient against censorship.
The software relies on the PostgreSQL DBMS.
Unofficial PeerTube video playback integrations exist for popular platforms like Reddit and Kodi.