6 Federated (ActivityPub) video streaming platform using P2P (BitTorrent)
7 directly in the web browser with <a href="https://github.com/feross/webtorrent">WebTorrent</a>.
10 **PeerTube is sponsored by [Framasoft](https://framatube.org/#en), a non-profit
11 that promotes, spreads and develops free culture in general, and free-libre
12 software in particular. If you want to support this project, please [consider
13 donating them](https://soutenir.framasoft.org/en/).**
16 <strong>Client</strong>
20 <a href="https://david-dm.org/Chocobozzz/PeerTube?path=client">
21 <img src="https://david-dm.org/Chocobozzz/PeerTube.svg?path=client" alt="Dependency Status" />
24 <a href="https://david-dm.org/Chocobozzz/PeerTube?path=client#info=dev">
25 <img src="https://david-dm.org/Chocobozzz/PeerTube/dev-status.svg?path=client" alt="devDependency Status" />
30 <strong>Server</strong>
34 <a href="https://travis-ci.org/Chocobozzz/PeerTube">
35 <img src="https://travis-ci.org/Chocobozzz/PeerTube.svg?branch=develop" alt="Build Status" />
38 <a href="https://david-dm.org/Chocobozzz/PeerTube">
39 <img src="https://david-dm.org/Chocobozzz/PeerTube.svg" alt="Dependencies Status" />
42 <a href="https://david-dm.org/Chocobozzz/PeerTube#info=dev">
43 <img src="https://david-dm.org/Chocobozzz/PeerTube/dev-status.svg" alt="devDependency Status" />
46 <a href="http://standardjs.com/">
47 <img src="https://img.shields.io/badge/code%20style-standard-brightgreen.svg" alt="JavaScript Style Guide" />
50 <a href="https://kiwiirc.com/client/irc.freenode.net/#peertube">
51 <img src="https://img.shields.io/badge/%23peertube-on%20freenode-brightgreen.svg" alt="PeerTube Freenode IRC" />
58 <a href="https://peertube.cpy.re">
59 <img src="https://lutim.cpy.re/mRdBAdeD.png" alt="screenshot" />
65 Want to see it in action?
67 * [Demo server](http://peertube.cpy.re)
68 * [Video](https://peertube.cpy.re/videos/watch/f78a97f8-a142-4ce1-a5bd-154bf9386504)
69 to see how the "decentralization feature" looks like
70 * Experimental demo servers that share videos (they are in the same
71 network): [peertube2](http://peertube2.cpy.re),
72 [peertube3](http://peertube3.cpy.re). Since I do experiments with them,
73 sometimes they might not work correctly.
77 We can't build a FOSS video streaming alternatives to YouTube, Dailymotion,
78 Vimeo... with a centralized software. One organization alone may not have
79 enough money to pay for bandwidth and video storage of its servers.
81 So we need to have a decentralized network of servers seeding videos (as
82 [Diaspora](https://github.com/diaspora/diaspora) for example). But it's not
83 enough because one video could become famous and overload the server. It's the
84 reason why we need to use a P2P protocol to limit the server load. Thanks to
85 [WebTorrent](https://github.com/feross/webtorrent), we can make P2P (thus
86 bittorrent) inside the web browser, as of today.
91 - [X] Angular frontend
92 - [X] Join the fediverse
93 - [X] Follow other instances
94 - [X] Unfollow an instance
95 - [X] Get for the followers/following list
98 - [X] Send the meta data with ActivityPub to followers
99 - [X] Remove the video
100 - [X] List the videos
101 - [X] View the video in an HTML5 player with WebTorrent
106 - [X] Videos view counter
107 - [X] Videos likes/dislikes
108 - [X] Transcoding to different definitions
109 - [X] Download file/torrent
110 - [X] User video bytes quota
111 - [X] User video channels
112 - [X] NSFW warnings/settings
113 - [X] Video description in markdown
114 - [X] User roles (administrator, moderator)
115 - [X] User registration
116 - [X] Video privacy settings (public, unlisted or private)
117 - [X] Signaling a video to the admin origin PeerTube instance
118 - [ ] Videos comments
120 - [ ] User subscriptions (by tags, author...)
121 - [ ] Add "DDOS" security
126 See [wiki](https://github.com/Chocobozzz/PeerTube/wiki) for complete
127 installation commands.
129 ### Front compatibility
132 * Firefox (>= 42 for MediaSource support)
144 1. Install NodeJS 8.x (current LTS):
145 [https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions](https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions)
147 [https://yarnpkg.com/en/docs/install](https://yarnpkg.com/en/docs/install)
152 $ apt-get install ffmpeg postgresql openssl
157 1. Install NodeJS 8.x (current LTS): (same as Debian)
158 2. Install yarn: (same as Debian)
163 $ apt-get install ffmpeg postgresql openssl
171 $ pacman -S nodejs yarn ffmpeg postgresql openssl
174 #### Other distributions
176 Feel free to update this README file in a pull request!
178 ### Build from the sources
181 $ git clone -b master https://github.com/Chocobozzz/PeerTube
191 If you want to run PeerTube in production (which might be a bad idea for now :) ):
194 $ cp config/production.yaml.example config/production.yaml
197 Then edit the `config/production.yaml` file according to your webserver
198 configuration. Keys set in this file will override those of
199 `config/default.yml`.
201 Finally, run the server with the `NODE_ENV` environment variable set to
205 $ NODE_ENV=production npm start
208 The administrator password is automatically generated and can be found in the
209 logs. You can set another password with:
212 $ NODE_ENV=production npm run reset-password -- -u root
215 **Nginx template** (reverse proxy): https://github.com/Chocobozzz/PeerTube/tree/master/support/nginx <br />
216 **Systemd template**: https://github.com/Chocobozzz/PeerTube/tree/master/support/systemd
218 You can check the application (CORS headers, tracker websocket...) by running:
221 $ NODE_ENV=production npm run check
226 The following commands will upgrade the source (according to your current
227 branch), upgrade node modules and rebuild client application:
230 # systemctl stop peertube
231 $ npm run upgrade-peertube
232 # systemctl start peertube
235 ### Test with three fresh nodes
238 $ npm run clean:server:test
242 Then you will get access to the three nodes at `http://localhost:900{1,2,3}`
243 with the `root` as username and `test{1,2,3}` for the password.
247 To print all available commands, run:
255 See the [contributing
256 guide](https://github.com/Chocobozzz/PeerTube/blob/master/.github/CONTRIBUTING.md)
257 to see how to contribute to PeerTube. Spoiler alert: you don't need to be a
262 See [ARCHITECTURE.md](https://github.com/Chocobozzz/PeerTube/blob/master/ARCHITECTURE.md) for a more detailed explanation.
266 * The backend is a REST API.
267 * Servers communicate with each others with [Activity
268 Pub](https://www.w3.org/TR/activitypub/).
269 * Each server has its own users who query it (search videos, query where the
270 torrent URI of this specific video is...).
271 * If a user uploads a video, the server seeds it and sends its followers some
272 metadata (name, short description, torrent URI...).
273 * A server is a tracker responsible for all the videos uploaded in it.
274 * Even if nobody watches a video, it is seeded by the server (through
275 [WebSeed protocol](http://www.bittorrent.org/beps/bep_0019.html)) where the
278 Here are some simple schemes:
282 <img src="https://lutim.cpy.re/6Qut3ure.png" alt="Decentralized" />
284 <img src="https://lutim.cpy.re/NvRAcv6U.png" alt="Watch a video" />
286 <img src="https://lutim.cpy.re/pqKm3Q5S.png" alt="Watch a P2P video" />