]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - support/doc/dependencies.md
Generate translations
[github/Chocobozzz/PeerTube.git] / support / doc / dependencies.md
CommitLineData
afe81767 1# Dependencies
63bfad7e 2
92340699
RK
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
e5203ffa 18## Debian / Ubuntu and derivatives
ab87af11
DK
19
201. On a fresh Debian/Ubuntu, as root user, install basic utility programs needed for the installation
955f14a4 21
bc2fc1a7 22```
99402413 23# apt-get install curl sudo unzip vim
bc2fc1a7 24```
955f14a4 25
ab87af11
DK
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)
63bfad7e 34
ab87af11 356. Run:
63bfad7e 36
afe81767 37```
ab87af11
DK
38sudo apt update
39sudo apt install nginx ffmpeg postgresql postgresql-contrib openssl g++ make redis-server git python-dev
40ffmpeg -version # Should be >= 3.x
41g++ -v # Should be >= 5.x
63bfad7e
C
42```
43
30274d67 44If you still have a 2.x version of FFmpeg on Ubuntu:
ab87af11 45
955f14a4 46```
ab87af11
DK
47sudo add-apt-repository ppa:jonathonf/ffmpeg-3
48sudo apt-get update
49sudo apt install ffmpeg
955f14a4
MB
50```
51
81cdf382 52Now that dependencies are installed, before running PeerTube you should start PostgreSQL and Redis:
ab87af11 53
81cdf382 54```
ab87af11 55sudo systemctl start redis postgresql
81cdf382
RK
56```
57
afe81767 58## Arch Linux
63bfad7e 59
ab87af11 601. Run:
63bfad7e 61
afe81767 62```
ab87af11 63sudo pacman -S nodejs-lts-dubnium yarn ffmpeg postgresql openssl redis git wget unzip python2 base-devel npm nginx
63bfad7e
C
64```
65
81cdf382 66Now that dependencies are installed, before running PeerTube you should start PostgreSQL and Redis:
ab87af11 67
81cdf382 68```
ab87af11 69sudo systemctl start redis postgresql
81cdf382
RK
70```
71
053ad3a3
EC
72## CentOS 7
73
ab87af11
DK
741. Install NodeJS 10.x:
75[https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora](https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora)
76
772. Install yarn:
78[https://yarnpkg.com/en/docs/install](https://yarnpkg.com/en/docs/install)
79
803. Install or compile ffmpeg:
81
82* Install - [https://linoxide.com/linux-how-to/install-ffmpeg-centos-7/](https://linoxide.com/linux-how-to/install-ffmpeg-centos-7/)
83* Compile - [https://gist.github.com/mustafaturan/7053900#file-latest-ffmpeg-centos6-sh](https://gist.github.com/mustafaturan/7053900#file-latest-ffmpeg-centos6-sh)
84
854. Run:
053ad3a3
EC
86
87```
ab87af11
DK
88sudo yum update
89sudo yum install epel-release centos-release-scl
90sudo yum update
91sudo yum install nginx postgresql postgresql-server postgresql-contrib openssl gcc-c++ make wget redis git devtoolset-7
0414ed10
O
92```
93
ab87af11
DK
945. 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.
95
4c86a254 96```
ab87af11 97sudo scl enable devtoolset-7 bash
053ad3a3
EC
98```
99
d4557fd3
RK
100Later 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:
101
102```
ab87af11 103sudo -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
d4557fd3
RK
104```
105
ab87af11
DK
106Initialize the PostgreSQL database:
107
f60e85ce 108```
ab87af11 109sudo postgresql-setup initdb
f60e85ce
W
110```
111
ab87af11
DK
112Now that dependencies are installed, before running PeerTube you should enable and start PostgreSQL and Redis:
113
81cdf382 114```
ab87af11
DK
115sudo systemctl enable redis
116sudo systemctl enable postgresql
117sudo systemctl start redis
118sudo systemctl start postgresql
81cdf382
RK
119```
120
0a314a99 121## Fedora
122
ab87af11
DK
1231. Upgrade your packages:
124
0a314a99 125```
126dnf upgrade
127```
ab87af11
DK
128
1292. Add a user with sudoers group access:
130
0a314a99 131```
132useradd my-peertube-user
133passwd my-peertube-user
134usermod my-peertube-user -a -G wheel # Add my-peertube-user to sudoers
135su my-peertube-user
136```
ab87af11
DK
137
1383. (Optional) Install certbot (choose instructions for nginx and your distribution):
0a314a99 139[https://certbot.eff.org/all-instructions](https://certbot.eff.org/all-instructions)
ab87af11
DK
140
1414. Install NodeJS 10.x:
0a314a99 142[https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora](https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora)
ab87af11
DK
143
1445. Install yarn:
0a314a99 145[https://yarnpkg.com/en/docs/install](https://yarnpkg.com/en/docs/install)
ab87af11
DK
146
1476. Enable [RPM Fusion](https://rpmfusion.org) for Fedora (available for x86, x86_64, armhfp)
148
0a314a99 149```
150sudo dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm
151```
152This is necessary because `ffmpeg` is not in the Fedora repos.
153
ab87af11
DK
1547. Run:
155
0a314a99 156```
157sudo dnf install nginx ffmpeg postgresql-server postgresql-contrib openssl gcc-c++ make redis git
158ffmpeg -version # Should be >= 3.x
159g++ -v # Should be >= 5.x
160```
ab87af11
DK
161
1628. Post-installation
0a314a99 163
164_from [PostgreSQL documentation](https://www.postgresql.org/download/linux/redhat/):_
165> Due to policies for Red Hat family distributions, the PostgreSQL installation will not be enabled for automatic start or have the database initialized automatically.
ab87af11 166
0a314a99 167```
168# PostgreSQL
169sudo postgresql-setup initdb
170sudo systemctl enable postgresql.service
171sudo systemctl start postgresql.service
172# Nginx
173sudo systemctl enable nginx.service
174sudo systemctl start nginx.service
175# Redis
176sudo systemctl enable redis.service
177sudo systemctl start redis.service
178```
ab87af11
DK
179
1809. Firewall
0a314a99 181
51c35447 182By default, you cannot access your server via public IP. To do so, you must configure firewall:
ab87af11 183
0a314a99 184```
185# Ports used by peertube dev setup
186sudo firewall-cmd --permanent --zone=public --add-port=3000/tcp
187sudo firewall-cmd --permanent --zone=public --add-port=9000/tcp
188# Optional
189sudo firewall-cmd --permanent --zone=public --add-service=http
190sudo firewall-cmd --permanent --zone=public --add-service=https
191# Reload firewall
192sudo firewall-cmd --reload
193```
0a314a99 194
ab87af11
DK
19510. Configure max ports
196
197This is necessary if you are running dev setup, otherwise you will have errors with `nodemon`
198
0a314a99 199```
200echo fs.inotify.max_user_watches=582222 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
201```
ab87af11 202
0a314a99 203[More info](https://stackoverflow.com/questions/34662574/node-js-getting-error-nodemon-internal-watch-failed-watch-enospc#34664097)
204
4c86a254
GN
205## FreeBSD
206
207On a fresh install of [FreeBSD](https://www.freebsd.org), new system or new jail:
208
ab87af11
DK
2091. bootstrap pkg, initialize db and install peertube's dependencies, always as root (sudo not yet installed):
210
4c86a254 211```
ab87af11
DK
212pkg
213pkg update
214pkg install -y sudo bash wget git python nginx pkgconf vips postgresql96-server postgresql96-contrib redis openssl node npm yarn ffmpeg unzip
4c86a254
GN
215```
216
ab87af11
DK
2172. Allow users in the wheel group (hope you don't forgot to add your user on wheel group!) to use sudo.
218
4c86a254
GN
219```
220# visudo
221```
222
ab87af11
DK
223Uncomment the line 90
224
4c86a254
GN
225```
226%wheel ALL=(ALL) ALL
227```
228
ab87af11 2293. Enable nginx, redis, postgresql services and initialize database.
4c86a254 230
4c86a254 231```
ab87af11
DK
232sysrc postgresql_enable="YES"
233sysrc redis_enable="YES"
234sysrc nginx_enable="YES"
4c86a254
GN
235```
236
ab87af11
DK
237Initialize database and start services
238
4c86a254 239```
ab87af11
DK
240service postgresql initdb
241service postgresql start
242service redis start
243service nginx start
4c86a254
GN
244```
245
2f7ac618 246## macOS
2f7ac618 247
ab87af11
DK
2481. Add the packages:
249
250```
251brew install ffmpeg nginx postgresql openssl gcc make redis git yarn
252```
253
2542. Run the services:
2f7ac618 255
ab87af11
DK
256```
257brew services run postgresql
258brew services run redis
259```
396f224b
HM
260
261## Gentoo
262
ab87af11
DK
2631. Add this to ``/etc/portage/sets/peertube``:
264
396f224b
HM
265```
266net-libs/nodejs
267sys-apps/yarn
268media-video/ffmpeg[x264] # Optionnally add vorbis,vpx
269dev-db/postgresql
270dev-db/redis
271dev-vcs/git
272app-arch/unzip
273dev-lang/python:2.7
274www-servers/nginx
396f224b 275
ab87af11 276# Optional, client for Let’s Encrypt:
396f224b
HM
277# app-crypt/certbot
278# app-crypt/certbot-nginx
279```
280
ab87af11
DK
2812. If you are on a "stable" Gentoo you need to accept the testing keyword ~amd64 yarn:
282
bfc6bb94
W
283```
284mkdir -p /etc/portage/package.keywords
285cat << EOF >> /etc/portage/package.keywords/peertube
286# required by yarn (argument) for PeerTube
287sys-apps/yarn ~amd64
288EOF
289```
290
ab87af11
DK
2913. Compile the peertube set:
292
396f224b
HM
293```
294emerge -a @peertube
295```
296
ab87af11
DK
2974. Initialize the PostgreSQL database if you just merged it:
298
396f224b
HM
299```
300emerge --config postgresql
301```
302
ab87af11
DK
3035. (For OpenRC) Enable and then start the services (replace with the correct PostgreSQL slot):
304
396f224b
HM
305```
306rc-update add redis
c1109b45 307rc-update add postgresql-11
396f224b 308rc-service redis start
c1109b45 309rc-service postgresql-11 start
396f224b 310```
2f7ac618 311
afe81767 312## Other distributions
63bfad7e
C
313
314Feel free to update this file in a pull request!