]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame_incremental - support/doc/dependencies.md
Fixed openapi.yml link url
[github/Chocobozzz/PeerTube.git] / support / doc / dependencies.md
... / ...
CommitLineData
1# Dependencies
2
3<!-- START doctoc generated TOC please keep comment here to allow auto update -->
4<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
5
6
7- [Debian / Ubuntu and derivatives](#debian--ubuntu-and-derivatives)
8- [Arch Linux](#arch-linux)
9- [CentOS 7](#centos-7)
10- [Fedora](#fedora)
11- [FreeBSD](#freebsd)
12- [macOS](#macos)
13- [Gentoo](#gentoo)
14- [Other distributions](#other-distributions)
15
16<!-- END doctoc generated TOC please keep comment here to allow auto update -->
17
18## Debian / Ubuntu and derivatives
19
201. On a fresh Debian/Ubuntu, as root user, install basic utility programs needed for the installation
21
22```
23# apt-get install curl sudo unzip vim
24```
25
262. It would be wise to disable root access and to continue this tutorial with a user with sudoers group access
27
283. Install certbot (choose instructions for nginx and your distribution) :
29[https://certbot.eff.org/all-instructions](https://certbot.eff.org/all-instructions)
304. Install NodeJS 10.x:
31[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)
325. Install yarn, and be sure to have [a recent version](https://github.com/yarnpkg/yarn/releases/latest):
33[https://yarnpkg.com/en/docs/install#linux-tab](https://yarnpkg.com/en/docs/install#linux-tab)
34
356. Run:
36
37```
38sudo apt update
39sudo apt install nginx ffmpeg postgresql postgresql-contrib openssl g++ make redis-server git python-dev
40ffmpeg -version # Should be >= 4.1
41g++ -v # Should be >= 5.x
42```
43
44Now that dependencies are installed, before running PeerTube you should start PostgreSQL and Redis:
45
46```
47sudo systemctl start redis postgresql
48```
49
50## Arch Linux
51
521. Run:
53
54```
55sudo pacman -S nodejs-lts-dubnium yarn ffmpeg postgresql openssl redis git wget unzip python2 base-devel npm nginx
56```
57
58Now that dependencies are installed, before running PeerTube you should start PostgreSQL and Redis:
59
60```
61sudo systemctl start redis postgresql
62```
63
64## CentOS 7
65
661. Install NodeJS 10.x:
67[https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora](https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora)
68
692. Install yarn:
70[https://yarnpkg.com/en/docs/install](https://yarnpkg.com/en/docs/install)
71
723. Install or compile ffmpeg:
73
74* Install - [https://linoxide.com/linux-how-to/install-ffmpeg-centos-7/](https://linoxide.com/linux-how-to/install-ffmpeg-centos-7/)
75* Compile - [https://gist.github.com/mustafaturan/7053900#file-latest-ffmpeg-centos6-sh](https://gist.github.com/mustafaturan/7053900#file-latest-ffmpeg-centos6-sh)
76
774. Install Packages:
78
79```
80sudo yum update
81sudo yum install epel-release centos-release-scl
82sudo yum update
83sudo yum install nginx postgresql postgresql-server postgresql-contrib openssl gcc-c++ make wget redis git devtoolset-7
84```
85
865. You need to use a more up to date version of G++ in order to run the yarn install command, hence the installation of devtoolset-7.
87
88```
89sudo scl enable devtoolset-7 bash
90```
91
92Later when you invoke any node command, please prefix them with `CC=/opt/rh/devtoolset-7/root/usr/bin/gcc CXX=/opt/rh/devtoolset-7/root/usr/bin/g++`, such as with:
93
94```
95sudo -H -u peertube CC=/opt/rh/devtoolset-7/root/usr/bin/gcc CXX=/opt/rh/devtoolset-7/root/usr/bin/g++ yarn install --production --pure-lockfile
96```
97
986. Initialize the PostgreSQL database:
99
100```
101sudo postgresql-setup initdb
102```
103
104Now that dependencies are installed, before running PeerTube you should enable and start PostgreSQL and Redis:
105
106```
107sudo systemctl enable --now redis
108sudo systemctl enable --now postgresql
109```
110
111## Centos 8
112
1131. Install NodeJS 10.x:
114[https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora](https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora)
115
1162. Install yarn:
117[https://yarnpkg.com/en/docs/install](https://yarnpkg.com/en/docs/install)
118
1193. Install or compile ffmpeg:
120
121* Install - [https://linuxize.com/post/how-to-install-ffmpeg-on-centos-8/](https://linuxize.com/post/how-to-install-ffmpeg-on-centos-8/)
122
1234. Install packages:
124
125```
126sudo dnf update
127sudo dnf install epel-release
128sudo dnf update
129sudo dnf install nginx postgresql postgresql-server postgresql-contrib openssl gcc-c++ make wget redis git
130```
131
1325. You'll need a symlink for python3 to python for youtube-dl to work
133
134```
135sudo ln -s /usr/bin/python3 /usr/bin/python
136```
137
1386. Initialize the PostgreSQL database:
139
140```
141sudo postgresql-setup initdb
142```
143
144Now that dependencies are installed, before running PeerTube you should enable and start PostgreSQL and Redis:
145
146```
147sudo systemctl enable --now redis
148sudo systemctl enable --now postgresql
149```
150
151
152## Fedora
153
1541. Upgrade your packages:
155
156```
157dnf upgrade
158```
159
1602. Add a user with sudoers group access:
161
162```
163useradd my-peertube-user
164passwd my-peertube-user
165usermod my-peertube-user -a -G wheel # Add my-peertube-user to sudoers
166su my-peertube-user
167```
168
1693. (Optional) Install certbot (choose instructions for nginx and your distribution):
170[https://certbot.eff.org/all-instructions](https://certbot.eff.org/all-instructions)
171
1724. Install NodeJS 10.x:
173[https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora](https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora)
174
1755. Install yarn:
176[https://yarnpkg.com/en/docs/install](https://yarnpkg.com/en/docs/install)
177
1786. Enable [RPM Fusion](https://rpmfusion.org) for Fedora (available for x86, x86_64, armhfp)
179
180```
181sudo dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm
182```
183This is necessary because `ffmpeg` is not in the Fedora repos.
184
1857. Run:
186
187```
188sudo dnf install nginx ffmpeg postgresql-server postgresql-contrib openssl gcc-c++ make redis git
189ffmpeg -version # Should be >= 4.1
190g++ -v # Should be >= 5.x
191```
192
1938. Post-installation
194
195_from [PostgreSQL documentation](https://www.postgresql.org/download/linux/redhat/):_
196> Due to policies for Red Hat family distributions, the PostgreSQL installation will not be enabled for automatic start or have the database initialized automatically.
197
198```
199# PostgreSQL
200sudo postgresql-setup initdb
201sudo systemctl enable postgresql.service
202sudo systemctl start postgresql.service
203# Nginx
204sudo systemctl enable nginx.service
205sudo systemctl start nginx.service
206# Redis
207sudo systemctl enable redis.service
208sudo systemctl start redis.service
209```
210
2119. Firewall
212
213By default, you cannot access your server via public IP. To do so, you must configure firewall:
214
215```
216# Ports used by peertube dev setup
217sudo firewall-cmd --permanent --zone=public --add-port=3000/tcp
218sudo firewall-cmd --permanent --zone=public --add-port=9000/tcp
219# Optional
220sudo firewall-cmd --permanent --zone=public --add-service=http
221sudo firewall-cmd --permanent --zone=public --add-service=https
222# Reload firewall
223sudo firewall-cmd --reload
224```
225
22610. Configure max ports
227
228This is necessary if you are running dev setup, otherwise you will have errors with `nodemon`
229
230```
231echo fs.inotify.max_user_watches=582222 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
232```
233
234[More info](https://stackoverflow.com/questions/34662574/node-js-getting-error-nodemon-internal-watch-failed-watch-enospc#34664097)
235
236## FreeBSD
237
238On a fresh install of [FreeBSD](https://www.freebsd.org), new system or new jail:
239
2401. bootstrap pkg, initialize db and install peertube's dependencies, always as root (sudo not yet installed):
241
242```
243pkg
244pkg update
245pkg install -y sudo bash wget git python nginx pkgconf vips postgresql96-server postgresql96-contrib redis openssl node npm yarn ffmpeg unzip
246```
247
2482. Allow users in the wheel group (hope you don't forgot to add your user on wheel group!) to use sudo.
249
250```
251# visudo
252```
253
254Uncomment the line 90
255
256```
257%wheel ALL=(ALL) ALL
258```
259
2603. Enable nginx, redis, postgresql services and initialize database.
261
262```
263sysrc postgresql_enable="YES"
264sysrc redis_enable="YES"
265sysrc nginx_enable="YES"
266```
267
268Initialize database and start services
269
270```
271service postgresql initdb
272service postgresql start
273service redis start
274service nginx start
275```
276
277## macOS
278
2791. Add the packages:
280
281```
282brew install ffmpeg nginx postgresql openssl gcc make redis git yarn
283```
284
2852. Run the services:
286
287```
288brew services run postgresql
289brew services run redis
290```
291
292## Gentoo
293
2941. Add this to ``/etc/portage/sets/peertube``:
295
296```
297net-libs/nodejs
298sys-apps/yarn
299media-video/ffmpeg[x264] # Optionnally add vorbis,vpx
300dev-db/postgresql
301dev-db/redis
302dev-vcs/git
303app-arch/unzip
304dev-lang/python:2.7
305www-servers/nginx
306
307# Optional, client for Let’s Encrypt:
308# app-crypt/certbot
309# app-crypt/certbot-nginx
310```
311
3122. If you are on a "stable" Gentoo you need to accept the testing keyword ~amd64 yarn:
313
314```
315mkdir -p /etc/portage/package.keywords
316cat << EOF >> /etc/portage/package.keywords/peertube
317# required by yarn (argument) for PeerTube
318sys-apps/yarn ~amd64
319EOF
320```
321
3223. Compile the peertube set:
323
324```
325emerge -a @peertube
326```
327
3284. Initialize the PostgreSQL database if you just merged it:
329
330```
331emerge --config postgresql
332```
333
3345. (For OpenRC) Enable and then start the services (replace with the correct PostgreSQL slot):
335
336```
337rc-update add redis
338rc-update add postgresql-11
339rc-service redis start
340rc-service postgresql-11 start
341```
342
343## Other distributions
344
345Feel free to update this file in a pull request!