]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame_incremental - support/doc/dependencies.md
Use ng select for multiselect
[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 >= 3.x
41g++ -v # Should be >= 5.x
42```
43
44If you still have a 2.x version of FFmpeg on Ubuntu:
45
46```
47sudo add-apt-repository ppa:jonathonf/ffmpeg-3
48sudo apt-get update
49sudo apt install ffmpeg
50```
51
52Now that dependencies are installed, before running PeerTube you should start PostgreSQL and Redis:
53
54```
55sudo systemctl start redis postgresql
56```
57
58## Arch Linux
59
601. Run:
61
62```
63sudo pacman -S nodejs-lts-dubnium yarn ffmpeg postgresql openssl redis git wget unzip python2 base-devel npm nginx
64```
65
66Now that dependencies are installed, before running PeerTube you should start PostgreSQL and Redis:
67
68```
69sudo systemctl start redis postgresql
70```
71
72## CentOS 7
73
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. Install Packages:
86
87```
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
92```
93
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
96```
97sudo scl enable devtoolset-7 bash
98```
99
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```
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
104```
105
1066. Initialize the PostgreSQL database:
107
108```
109sudo postgresql-setup initdb
110```
111
112Now that dependencies are installed, before running PeerTube you should enable and start PostgreSQL and Redis:
113
114```
115sudo systemctl enable --now redis
116sudo systemctl enable --now postgresql
117```
118
119## Centos 8
120
1211. Install NodeJS 10.x:
122[https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora](https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora)
123
1242. Install yarn:
125[https://yarnpkg.com/en/docs/install](https://yarnpkg.com/en/docs/install)
126
1273. Install or compile ffmpeg:
128
129* Install - [https://linuxize.com/post/how-to-install-ffmpeg-on-centos-8/](https://linuxize.com/post/how-to-install-ffmpeg-on-centos-8/)
130
1314. Install packages:
132
133```
134sudo dnf update
135sudo dnf install epel-release
136sudo dnf update
137sudo dnf install nginx postgresql postgresql-server postgresql-contrib openssl gcc-c++ make wget redis git
138```
139
1405. You'll need a symlink for python3 to python for youtube-dl to work
141
142```
143sudo ln -s /usr/bin/python3 /usr/bin/python
144```
145
1466. Initialize the PostgreSQL database:
147
148```
149sudo postgresql-setup initdb
150```
151
152Now that dependencies are installed, before running PeerTube you should enable and start PostgreSQL and Redis:
153
154```
155sudo systemctl enable --now redis
156sudo systemctl enable --now postgresql
157```
158
159
160## Fedora
161
1621. Upgrade your packages:
163
164```
165dnf upgrade
166```
167
1682. Add a user with sudoers group access:
169
170```
171useradd my-peertube-user
172passwd my-peertube-user
173usermod my-peertube-user -a -G wheel # Add my-peertube-user to sudoers
174su my-peertube-user
175```
176
1773. (Optional) Install certbot (choose instructions for nginx and your distribution):
178[https://certbot.eff.org/all-instructions](https://certbot.eff.org/all-instructions)
179
1804. Install NodeJS 10.x:
181[https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora](https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora)
182
1835. Install yarn:
184[https://yarnpkg.com/en/docs/install](https://yarnpkg.com/en/docs/install)
185
1866. Enable [RPM Fusion](https://rpmfusion.org) for Fedora (available for x86, x86_64, armhfp)
187
188```
189sudo dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm
190```
191This is necessary because `ffmpeg` is not in the Fedora repos.
192
1937. Run:
194
195```
196sudo dnf install nginx ffmpeg postgresql-server postgresql-contrib openssl gcc-c++ make redis git
197ffmpeg -version # Should be >= 3.x
198g++ -v # Should be >= 5.x
199```
200
2018. Post-installation
202
203_from [PostgreSQL documentation](https://www.postgresql.org/download/linux/redhat/):_
204> Due to policies for Red Hat family distributions, the PostgreSQL installation will not be enabled for automatic start or have the database initialized automatically.
205
206```
207# PostgreSQL
208sudo postgresql-setup initdb
209sudo systemctl enable postgresql.service
210sudo systemctl start postgresql.service
211# Nginx
212sudo systemctl enable nginx.service
213sudo systemctl start nginx.service
214# Redis
215sudo systemctl enable redis.service
216sudo systemctl start redis.service
217```
218
2199. Firewall
220
221By default, you cannot access your server via public IP. To do so, you must configure firewall:
222
223```
224# Ports used by peertube dev setup
225sudo firewall-cmd --permanent --zone=public --add-port=3000/tcp
226sudo firewall-cmd --permanent --zone=public --add-port=9000/tcp
227# Optional
228sudo firewall-cmd --permanent --zone=public --add-service=http
229sudo firewall-cmd --permanent --zone=public --add-service=https
230# Reload firewall
231sudo firewall-cmd --reload
232```
233
23410. Configure max ports
235
236This is necessary if you are running dev setup, otherwise you will have errors with `nodemon`
237
238```
239echo fs.inotify.max_user_watches=582222 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
240```
241
242[More info](https://stackoverflow.com/questions/34662574/node-js-getting-error-nodemon-internal-watch-failed-watch-enospc#34664097)
243
244## FreeBSD
245
246On a fresh install of [FreeBSD](https://www.freebsd.org), new system or new jail:
247
2481. bootstrap pkg, initialize db and install peertube's dependencies, always as root (sudo not yet installed):
249
250```
251pkg
252pkg update
253pkg install -y sudo bash wget git python nginx pkgconf vips postgresql96-server postgresql96-contrib redis openssl node npm yarn ffmpeg unzip
254```
255
2562. Allow users in the wheel group (hope you don't forgot to add your user on wheel group!) to use sudo.
257
258```
259# visudo
260```
261
262Uncomment the line 90
263
264```
265%wheel ALL=(ALL) ALL
266```
267
2683. Enable nginx, redis, postgresql services and initialize database.
269
270```
271sysrc postgresql_enable="YES"
272sysrc redis_enable="YES"
273sysrc nginx_enable="YES"
274```
275
276Initialize database and start services
277
278```
279service postgresql initdb
280service postgresql start
281service redis start
282service nginx start
283```
284
285## macOS
286
2871. Add the packages:
288
289```
290brew install ffmpeg nginx postgresql openssl gcc make redis git yarn
291```
292
2932. Run the services:
294
295```
296brew services run postgresql
297brew services run redis
298```
299
300## Gentoo
301
3021. Add this to ``/etc/portage/sets/peertube``:
303
304```
305net-libs/nodejs
306sys-apps/yarn
307media-video/ffmpeg[x264] # Optionnally add vorbis,vpx
308dev-db/postgresql
309dev-db/redis
310dev-vcs/git
311app-arch/unzip
312dev-lang/python:2.7
313www-servers/nginx
314
315# Optional, client for Let’s Encrypt:
316# app-crypt/certbot
317# app-crypt/certbot-nginx
318```
319
3202. If you are on a "stable" Gentoo you need to accept the testing keyword ~amd64 yarn:
321
322```
323mkdir -p /etc/portage/package.keywords
324cat << EOF >> /etc/portage/package.keywords/peertube
325# required by yarn (argument) for PeerTube
326sys-apps/yarn ~amd64
327EOF
328```
329
3303. Compile the peertube set:
331
332```
333emerge -a @peertube
334```
335
3364. Initialize the PostgreSQL database if you just merged it:
337
338```
339emerge --config postgresql
340```
341
3425. (For OpenRC) Enable and then start the services (replace with the correct PostgreSQL slot):
343
344```
345rc-update add redis
346rc-update add postgresql-11
347rc-service redis start
348rc-service postgresql-11 start
349```
350
351## Other distributions
352
353Feel free to update this file in a pull request!