]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame_incremental - support/doc/dependencies.md
Translated using Weblate (Croatian)
[github/Chocobozzz/PeerTube.git] / support / doc / dependencies.md
... / ...
CommitLineData
1# Dependencies
2
3:warning: **Warning**: dependencies guide is maintained by the community. Some parts may be outdated! :warning:
4
5Follow the below guides, and check their versions match [required external dependencies versions](https://github.com/Chocobozzz/PeerTube/blob/master/engines.yaml). You can check them automatically via `sudo npx engineslist`.
6
7_note_: only **LTS** versions of external dependencies are supported. If no LTS version matching the version constraint is available, only **release** versions are supported.
8
9<!-- START doctoc generated TOC please keep comment here to allow auto update -->
10<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
11
12- [Debian / Ubuntu and derivatives](#debian-ubuntu-and-derivatives)
13- [Arch Linux](#arch-linux)
14- [CentOS 7](#centos-7)
15- [Centos 8](#centos-8)
16- [Rocky Linux 8.4](#rocky-linux-84)
17- [Fedora](#fedora)
18- [Red Hat Enterprise Linux 8](#red-hat-enterprise-linux-8)
19- [FreeBSD](#freebsd)
20- [macOS](#macos)
21- [Gentoo](#gentoo)
22- [OpenBSD](#openbsd)
23- [Other distributions](#other-distributions)
24
25<!-- END doctoc generated TOC please keep comment here to allow auto update -->
26
27## Debian / Ubuntu and derivatives
28
291. On a fresh Debian/Ubuntu, as root user, install basic utility programs needed for the installation
30
31```
32# apt-get install curl sudo unzip vim
33```
34
352. It would be wise to disable root access and to continue this tutorial with a user with sudoers group access
36
373. Install NodeJS 14.x:
38[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)
394. Install yarn, and be sure to have [a recent version](https://github.com/yarnpkg/yarn/releases/latest):
40[https://yarnpkg.com/en/docs/install#linux-tab](https://yarnpkg.com/en/docs/install#linux-tab)
41
425. Install Python:
43
44On Ubuntu <= bionic (18.04 LTS) or Debian <= Buster:
45
46```
47sudo apt update
48sudo apt install python-dev
49python --version # Should be >= 2.x or >= 3.x
50```
51
52On Ubuntu >= focal (20.04 LTS) or Debian >= Bullseye:
53
54```
55sudo apt update
56sudo apt install python3-dev python-is-python3 # python-is-python2 should also work
57python --version # Should be >= 2.x or >= 3.x
58```
59
606. Install common dependencies:
61
62```
63sudo apt update
64sudo apt install certbot nginx ffmpeg postgresql postgresql-contrib openssl g++ make redis-server git cron wget
65ffmpeg -version # Should be >= 4.1
66g++ -v # Should be >= 5.x
67```
68
69Now that dependencies are installed, before running PeerTube you should start PostgreSQL and Redis:
70
71```
72sudo systemctl start redis postgresql
73```
74
75## Arch Linux
76
771. Run:
78
79```
80sudo pacman -S nodejs-lts-fermium yarn ffmpeg postgresql openssl redis git wget unzip python base-devel npm nginx
81```
82
83Now that dependencies are installed, before running PeerTube you should start PostgreSQL and Redis:
84
85```
86sudo systemctl start redis postgresql
87```
88
89## CentOS 7
90
911. Install NodeJS 14.x:
92[https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora](https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora)
93
942. Install yarn:
95[https://yarnpkg.com/en/docs/install](https://yarnpkg.com/en/docs/install)
96
973. Install or compile ffmpeg:
98
99* Install - [https://linoxide.com/linux-how-to/install-ffmpeg-centos-7/](https://linoxide.com/linux-how-to/install-ffmpeg-centos-7/)
100* Compile - [https://gist.github.com/mustafaturan/7053900#file-latest-ffmpeg-centos6-sh](https://gist.github.com/mustafaturan/7053900#file-latest-ffmpeg-centos6-sh)
101
1024. Install Packages:
103
104```
105sudo yum update
106sudo yum install epel-release centos-release-scl
107sudo yum update
108sudo yum install nginx postgresql postgresql-server postgresql-contrib openssl gcc-c++ make wget redis git devtoolset-7
109```
110
1115. 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.
112
113```
114sudo scl enable devtoolset-7 bash
115```
116
117Later 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:
118
119```
120sudo -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
121```
122
1236. Initialize the PostgreSQL database:
124
125```
126sudo PGSETUP_INITDB_OPTIONS='--auth-host=md5' postgresql-setup --initdb --unit postgresql
127```
128
129Now that dependencies are installed, before running PeerTube you should enable and start PostgreSQL and Redis:
130
131```
132sudo systemctl enable --now redis
133sudo systemctl enable --now postgresql
134```
135
136## Centos 8
137
1381. Install NodeJS 14.x:
139[https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora](https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora)
140
1412. Install yarn:
142[https://yarnpkg.com/en/docs/install](https://yarnpkg.com/en/docs/install)
143
1443. Install or compile ffmpeg:
145
146```
147sudo dnf install epel-release dnf-utils
148sudo yum-config-manager --set-enabled powertools
149sudo yum-config-manager --add-repo=https://negativo17.org/repos/epel-multimedia.repo
150sudo dnf install ffmpeg
151```
152
1534. Install packages:
154
155```
156sudo dnf update
157sudo dnf install epel-release
158sudo dnf update
159sudo dnf install nginx postgresql postgresql-server postgresql-contrib openssl gcc-c++ make wget redis git unzip
160```
161
1625. You'll need a symlink for python3 to python for youtube-dl to work
163
164```
165sudo ln -s /usr/bin/python3 /usr/bin/python
166```
167
1686. Initialize the PostgreSQL database:
169
170```
171sudo PGSETUP_INITDB_OPTIONS='--auth-host=md5' postgresql-setup --initdb --unit postgresql
172```
173
174Now that dependencies are installed, before running PeerTube you should enable and start PostgreSQL and Redis:
175
176```
177sudo systemctl enable --now redis
178sudo systemctl enable --now postgresql
179```
180
181## Rocky Linux 8.4
182
1831. Pull the latest updates:
184```
185sudo dnf update -y
186```
187
1882. Install NodeJS 14.x:
189```
190sudo dnf module install -y nodejs:14
191```
192
1933. Install yarn:
194```
195sudo npm install --global yarn
196```
197
1984. Install or compile ffmpeg (if you want to compile... enjoy):
199```
200sudo dnf install -y epel-release
201sudo dnf --enablerepo=powertools install -y SDL2 SDL2-devel
202sudo dnf install -y --nogpgcheck https://download1.rpmfusion.org/free/el/rpmfusion-free-release-8.noarch.rpm https://download1.rpmfusion.org/nonfree/el/rpmfusion-nonfree-release-8.noarch.rpm
203sudo dnf install -y ffmpeg
204sudo dnf update -y
205```
206
2075. Install PostgreSQL and Python3 and other stuff:
208```
209sudo dnf install -y nginx postgresql postgresql-server postgresql-contrib openssl gcc-c++ make wget redis git python3
210sudo ln -s /usr/bin/python3 /usr/bin/python
211sudo PGSETUP_INITDB_OPTIONS='--auth-host=md5' postgresql-setup --initdb --unit postgresql
212sudo systemctl enable --now redis
213sudo systemctl enable --now postgresql
214```
215
2166. Configure the peertube user:
217```
218sudo useradd -m -d /var/www/peertube -s /bin/bash -p peertube peertube
219```
220
2217. Unknown missing steps:
222- Steps missing here... these were adapted from the CentOS 8 steps which abruptly ended.
223- /var/www/peertube does not exist yet (expected? done in future steps? documentation?).
224- Nothing about Certbot, NGINX, Firewall settings, and etc.
225- Hopefully someone can suggest what is missing here with some hints so I can add it?
226
227## Fedora
228
2291. Upgrade your packages:
230
231```
232dnf upgrade
233```
234
2352. Add a user with sudoers group access:
236
237```
238useradd my-peertube-user
239passwd my-peertube-user
240usermod my-peertube-user -a -G wheel # Add my-peertube-user to sudoers
241su my-peertube-user
242```
243
2443. (Optional) Install certbot (choose instructions for your distribution):
245[https://certbot.eff.org/all-instructions](https://certbot.eff.org/all-instructions)
246
2474. Install NodeJS 14.x:
248[https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora](https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora)
249
2505. Install yarn:
251[https://yarnpkg.com/en/docs/install](https://yarnpkg.com/en/docs/install)
252
2536. Enable [RPM Fusion](https://rpmfusion.org) for Fedora (available for x86, x86_64, armhfp)
254
255```
256sudo dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm
257```
258This is necessary because `ffmpeg` is not in the Fedora repos.
259
2607. Run:
261
262```
263sudo dnf install nginx ffmpeg postgresql-server postgresql-contrib openssl gcc-c++ make redis git vim
264ffmpeg -version # Should be >= 4.1
265g++ -v # Should be >= 5.x
266```
267
2688. Configure nginx
269
270```
271sudo mkdir /etc/nginx/sites-available
272sudo mkdir /etc/nginx/sites-enabled
273sudo ln -s /etc/nginx/sites-enabled/peertube /etc/nginx/conf.d/peertube.conf
274```
275
2769. Post-installation
277
278_from [PostgreSQL documentation](https://www.postgresql.org/download/linux/redhat/):_
279> Due to policies for Red Hat family distributions, the PostgreSQL installation will not be enabled for automatic start or have the database initialized automatically.
280
281```
282# PostgreSQL
283sudo PGSETUP_INITDB_OPTIONS='--auth-host=md5' postgresql-setup --initdb --unit postgresql
284sudo systemctl enable postgresql.service
285sudo systemctl start postgresql.service
286# Nginx
287sudo systemctl enable nginx.service
288sudo systemctl start nginx.service
289# Redis
290sudo systemctl enable redis.service
291sudo systemctl start redis.service
292```
293
29410. Firewall
295
296By default, you cannot access your server via public IP. To do so, you must configure firewall:
297
298- Ports used by peertube dev setup:
299```
300sudo firewall-cmd --permanent --zone=public --add-port=3000/tcp
301sudo firewall-cmd --permanent --zone=public --add-port=9000/tcp
302```
303- Optional
304
305```
306sudo firewall-cmd --permanent --zone=public --add-service=http
307sudo firewall-cmd --permanent --zone=public --add-service=https
308```
309
310- Reload firewall
311
312```
313sudo firewall-cmd --reload
314```
315
31611. Configure max ports
317
318This is necessary if you are running dev setup, otherwise you will have errors with `nodemon`
319
320```
321echo fs.inotify.max_user_watches=582222 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
322```
323
324[More info](https://stackoverflow.com/questions/34662574/node-js-getting-error-nodemon-internal-watch-failed-watch-enospc#34664097)
325
326## Red Hat Enterprise Linux 8
327
3281. Register system as root user to Red Hat Subscription Management (create a free Red Hat account if you don't have one yet).
329
330```
331# subscription-manager register --username <username> --password <password> --auto-attach
332# dnf upgrade
333# reboot
334```
335
3362. Install Node.JS
337
338```
339sudo dnf module install nodejs:14
340```
341
3423. Install Yarn
343
344```
345curl --silent --location https://dl.yarnpkg.com/rpm/yarn.repo | sudo tee /etc/yum.repos.d/yarn.repo
346sudo dnf install yarn
347```
348
3494. Install FFmpeg
350
351```
352sudo subscription-manager repos --enable "codeready-builder-for-rhel-8-$(arch)-rpms"
353sudo dnf install --nogpgcheck https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
354sudo dnf install --nogpgcheck https://mirrors.rpmfusion.org/free/el/rpmfusion-free-release-8.noarch.rpm
355sudo dnf upgrade
356sudo dnf install ffmpeg
357```
358
3595. Run:
360
361```
362sudo dnf install nginx postgresql postgresql-server postgresql-contrib openssl gcc-c++ make wget redis git
363```
364
3656. You'll need a symlink for python3 to python for youtube-dl to work
366
367```
368sudo alternatives --set python3 /usr/bin/python
369```
370
3717. Initialize the PostgreSQL database:
372
373```
374sudo PGSETUP_INITDB_OPTIONS='--auth-host=md5' postgresql-setup --initdb --unit postgresql
375```
376
377Now that dependencies are installed, before running PeerTube you should enable and start PostgreSQL and Redis:
378
379```
380sudo systemctl enable --now redis
381sudo systemctl enable --now postgresql
382```
383
384If you are running the production guide, you also need to slightly pre-configure nginx, because nginx is packaged differently in the Red Hat family distributions:
385
3868. Configure nginx
387
388```
389sudo mkdir /etc/nginx/sites-available
390sudo mkdir /etc/nginx/sites-enabled
391sudo ln -s /etc/nginx/sites-enabled/peertube /etc/nginx/conf.d/peertube.conf
392sudo systemctl enable --now nginx
393```
394
3959. Prepare directory
396
397To add the 'peertube' user, you first have to create the 'www' folder and once the 'peertube' user is added, you have to set the access permissions.
398
399```
400sudo mkdir /var/www
401
402sudo useradd -m -d /var/www/peertube -s /bin/bash -p peertube peertube
403sudo passwd peertube
404
405sudo chmod 755 /var/www/peertube/
406```
407
40810. Firewall
409
410By default, you cannot access your server via public IP. To do so, you must configure firewall:
411
412- Ports used by peertube dev setup:
413```
414sudo firewall-cmd --permanent --zone=public --add-port=3000/tcp
415sudo firewall-cmd --permanent --zone=public --add-port=9000/tcp
416```
417- Optional
418
419```
420sudo firewall-cmd --permanent --zone=public --add-service=http
421sudo firewall-cmd --permanent --zone=public --add-service=https
422```
423
424- Reload firewall
425
426```
427sudo firewall-cmd --reload
428```
429
43011. Configure max ports
431
432This is necessary if you are running dev setup, otherwise you will have errors with `nodemon`
433
434```
435echo fs.inotify.max_user_watches=582222 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
436```
437
438[More info](https://stackoverflow.com/questions/34662574/node-js-getting-error-nodemon-internal-watch-failed-watch-enospc#34664097)
439
440
441## FreeBSD
442
443On a fresh install of [FreeBSD](https://www.freebsd.org), new system or new jail:
444
4451. bootstrap pkg, initialize db and install peertube's dependencies, always as root (sudo not yet installed):
446
447```
448pkg
449pkg update
450pkg install -y sudo bash wget git python nginx pkgconf postgresql13-server postgresql13-contrib redis openssl node npm yarn ffmpeg unzip
451```
452
4532. Allow users in the wheel group (hope you don't forgot to add your user on wheel group!) to use sudo.
454
455```
456# visudo
457```
458
459Uncomment the line 90
460
461```
462%wheel ALL=(ALL) ALL
463```
464
4653. Enable nginx, redis, postgresql services and initialize database.
466
467```
468sysrc postgresql_enable="YES"
469sysrc redis_enable="YES"
470sysrc nginx_enable="YES"
471```
472
473Initialize database and start services
474
475```
476service postgresql initdb
477service postgresql start
478service redis start
479service nginx start
480```
481
482## macOS
483
4841. Add the packages:
485
486```sh
487brew install bash ffmpeg nginx postgresql openssl gcc make redis git yarn
488```
489
490You may need to update your default version of bash.
491
492**How to change your default shell**
493
494```sh
495which -a bash # Check where bash is installed
496bash --version # You need a version at least as recent as 4.0
497sudo vim /etc/shells # Add in this file : /usr/local/bin/bash
498chsh -s /usr/local/bin/bash # To set the brew-installed bash as default bash
499```
500
501In a new shell, type `bash --version` to assert your changes took effect and
502correctly modified your default bash version.
503
5042. Run the services:
505
506```sh
507brew services run postgresql
508brew services run redis
509```
510
511On macOS, the `postgresql` user can be `_postgres` instead of `postgres`.
512If `sudo -u postgres createuser -P peertube` gives you an `unknown user: postgres` error, you can try `sudo -u _postgres createuser -U peertube`.
513
514## Gentoo
515
5161. Add this to ``/etc/portage/sets/peertube``:
517
518```
519net-libs/nodejs
520sys-apps/yarn
521media-video/ffmpeg[x264] # Optionally add vorbis,vpx
522dev-db/postgresql
523dev-db/redis
524dev-vcs/git
525app-arch/unzip
526dev-lang/python
527dev-lang/python-exec
528www-servers/nginx
529
530# Optional, client for Let’s Encrypt:
531# app-crypt/certbot
532```
533
5342. If you are on a "stable" Gentoo you need to accept the testing keyword ~amd64 yarn:
535
536```
537mkdir -p /etc/portage/package.keywords
538cat << EOF >> /etc/portage/package.keywords/peertube
539# required by yarn (argument) for PeerTube
540sys-apps/yarn ~amd64
541EOF
542```
543
5443. Compile the peertube set:
545
546```
547emerge -a @peertube
548```
549
5504. Initialize the PostgreSQL database if you just merged it:
551
552```
553emerge --config postgresql
554```
555
5565. (For OpenRC) Enable and then start the services (replace with the correct PostgreSQL slot):
557
558```
559rc-update add redis
560rc-update add postgresql-11
561rc-service redis start
562rc-service postgresql-11 start
563```
564
5656. Create Python version symlink for youtube-dl:
566
567```
568emerge -1 python-exec
569```
570
571## OpenBSD
572
5731. Install Packages:
574
575```
576pkg_add sudo bash wget git python nginx pkgconf postgresql-server postgresql-contrib redis openssl
577```
578
5792. Install yarn:
580
581```
582npm install --global yarn
583```
584
5853. Allow users in the wheel group to use sudo
586
587```
588visudo
589```
590Uncomment line #43:
591
592```
593%wheel ALL=(ALL) ALL
594```
595
5964. Enable services:
597
598```
599rcctl enable postgresql redis nginx
600```
601
602## Other distributions
603
604Feel free to update this file in a pull request!