]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame_incremental - support/doc/dependencies.md
Trigger a Gitpod dev image rebuild (in order to get upstream's Node.js 12 upgrade...
[github/Chocobozzz/PeerTube.git] / support / doc / dependencies.md
... / ...
CommitLineData
1# Dependencies
2
3Follow the below guides, and check their versions match [required external dependencies versions](https://github.com/Chocobozzz/PeerTube/blob/master/package.json#7). You can check them automatically via `sudo npx engineslist`.
4
5<!-- START doctoc generated TOC please keep comment here to allow auto update -->
6<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
7
8
9- [Debian / Ubuntu and derivatives](#debian--ubuntu-and-derivatives)
10- [Arch Linux](#arch-linux)
11- [CentOS 7](#centos-7)
12- [Fedora](#fedora)
13- [FreeBSD](#freebsd)
14- [macOS](#macos)
15- [Gentoo](#gentoo)
16- [Other distributions](#other-distributions)
17
18<!-- END doctoc generated TOC please keep comment here to allow auto update -->
19
20## Debian / Ubuntu and derivatives
21
221. On a fresh Debian/Ubuntu, as root user, install basic utility programs needed for the installation
23
24```
25# apt-get install curl sudo unzip vim
26```
27
282. It would be wise to disable root access and to continue this tutorial with a user with sudoers group access
29
303. Install certbot (choose instructions for nginx and your distribution) :
31[https://certbot.eff.org/all-instructions](https://certbot.eff.org/all-instructions)
324. Install NodeJS 10.x:
33[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)
345. Install yarn, and be sure to have [a recent version](https://github.com/yarnpkg/yarn/releases/latest):
35[https://yarnpkg.com/en/docs/install#linux-tab](https://yarnpkg.com/en/docs/install#linux-tab)
36
376. Run:
38
39```
40sudo apt update
41sudo apt install nginx ffmpeg postgresql postgresql-contrib openssl g++ make redis-server git python-dev
42ffmpeg -version # Should be >= 4.1
43g++ -v # Should be >= 5.x
44```
45
46Now that dependencies are installed, before running PeerTube you should start PostgreSQL and Redis:
47
48```
49sudo systemctl start redis postgresql
50```
51
52## Arch Linux
53
541. Run:
55
56```
57sudo pacman -S nodejs-lts-dubnium yarn ffmpeg postgresql openssl redis git wget unzip python2 base-devel npm nginx
58```
59
60Now that dependencies are installed, before running PeerTube you should start PostgreSQL and Redis:
61
62```
63sudo systemctl start redis postgresql
64```
65
66## CentOS 7
67
681. Install NodeJS 10.x:
69[https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora](https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora)
70
712. Install yarn:
72[https://yarnpkg.com/en/docs/install](https://yarnpkg.com/en/docs/install)
73
743. Install or compile ffmpeg:
75
76* Install - [https://linoxide.com/linux-how-to/install-ffmpeg-centos-7/](https://linoxide.com/linux-how-to/install-ffmpeg-centos-7/)
77* Compile - [https://gist.github.com/mustafaturan/7053900#file-latest-ffmpeg-centos6-sh](https://gist.github.com/mustafaturan/7053900#file-latest-ffmpeg-centos6-sh)
78
794. Install Packages:
80
81```
82sudo yum update
83sudo yum install epel-release centos-release-scl
84sudo yum update
85sudo yum install nginx postgresql postgresql-server postgresql-contrib openssl gcc-c++ make wget redis git devtoolset-7
86```
87
885. 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.
89
90```
91sudo scl enable devtoolset-7 bash
92```
93
94Later 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:
95
96```
97sudo -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
98```
99
1006. Initialize the PostgreSQL database:
101
102```
103sudo postgresql-setup initdb
104```
105
106Now that dependencies are installed, before running PeerTube you should enable and start PostgreSQL and Redis:
107
108```
109sudo systemctl enable --now redis
110sudo systemctl enable --now postgresql
111```
112
113## Centos 8
114
1151. Install NodeJS 10.x:
116[https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora](https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora)
117
1182. Install yarn:
119[https://yarnpkg.com/en/docs/install](https://yarnpkg.com/en/docs/install)
120
1213. Install or compile ffmpeg:
122
123* Install - [https://linuxize.com/post/how-to-install-ffmpeg-on-centos-8/](https://linuxize.com/post/how-to-install-ffmpeg-on-centos-8/)
124
1254. Install packages:
126
127```
128sudo dnf update
129sudo dnf install epel-release
130sudo dnf update
131sudo dnf install nginx postgresql postgresql-server postgresql-contrib openssl gcc-c++ make wget redis git
132```
133
1345. You'll need a symlink for python3 to python for youtube-dl to work
135
136```
137sudo ln -s /usr/bin/python3 /usr/bin/python
138```
139
1406. Initialize the PostgreSQL database:
141
142```
143sudo postgresql-setup initdb
144```
145
146Now that dependencies are installed, before running PeerTube you should enable and start PostgreSQL and Redis:
147
148```
149sudo systemctl enable --now redis
150sudo systemctl enable --now postgresql
151```
152
153
154## Fedora
155
1561. Upgrade your packages:
157
158```
159dnf upgrade
160```
161
1622. Add a user with sudoers group access:
163
164```
165useradd my-peertube-user
166passwd my-peertube-user
167usermod my-peertube-user -a -G wheel # Add my-peertube-user to sudoers
168su my-peertube-user
169```
170
1713. (Optional) Install certbot (choose instructions for nginx and your distribution):
172[https://certbot.eff.org/all-instructions](https://certbot.eff.org/all-instructions)
173
1744. Install NodeJS 10.x:
175[https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora](https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora)
176
1775. Install yarn:
178[https://yarnpkg.com/en/docs/install](https://yarnpkg.com/en/docs/install)
179
1806. Enable [RPM Fusion](https://rpmfusion.org) for Fedora (available for x86, x86_64, armhfp)
181
182```
183sudo dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm
184```
185This is necessary because `ffmpeg` is not in the Fedora repos.
186
1877. Run:
188
189```
190sudo dnf install nginx ffmpeg postgresql-server postgresql-contrib openssl gcc-c++ make redis git
191ffmpeg -version # Should be >= 4.1
192g++ -v # Should be >= 5.x
193```
194
1958. Post-installation
196
197_from [PostgreSQL documentation](https://www.postgresql.org/download/linux/redhat/):_
198> Due to policies for Red Hat family distributions, the PostgreSQL installation will not be enabled for automatic start or have the database initialized automatically.
199
200```
201# PostgreSQL
202sudo postgresql-setup initdb
203sudo systemctl enable postgresql.service
204sudo systemctl start postgresql.service
205# Nginx
206sudo systemctl enable nginx.service
207sudo systemctl start nginx.service
208# Redis
209sudo systemctl enable redis.service
210sudo systemctl start redis.service
211```
212
2139. Firewall
214
215By default, you cannot access your server via public IP. To do so, you must configure firewall:
216
217```
218# Ports used by peertube dev setup
219sudo firewall-cmd --permanent --zone=public --add-port=3000/tcp
220sudo firewall-cmd --permanent --zone=public --add-port=9000/tcp
221# Optional
222sudo firewall-cmd --permanent --zone=public --add-service=http
223sudo firewall-cmd --permanent --zone=public --add-service=https
224# Reload firewall
225sudo firewall-cmd --reload
226```
227
22810. Configure max ports
229
230This is necessary if you are running dev setup, otherwise you will have errors with `nodemon`
231
232```
233echo fs.inotify.max_user_watches=582222 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
234```
235
236[More info](https://stackoverflow.com/questions/34662574/node-js-getting-error-nodemon-internal-watch-failed-watch-enospc#34664097)
237
238## FreeBSD
239
240On a fresh install of [FreeBSD](https://www.freebsd.org), new system or new jail:
241
2421. bootstrap pkg, initialize db and install peertube's dependencies, always as root (sudo not yet installed):
243
244```
245pkg
246pkg update
247pkg install -y sudo bash wget git python nginx pkgconf vips postgresql96-server postgresql96-contrib redis openssl node npm yarn ffmpeg unzip
248```
249
2502. Allow users in the wheel group (hope you don't forgot to add your user on wheel group!) to use sudo.
251
252```
253# visudo
254```
255
256Uncomment the line 90
257
258```
259%wheel ALL=(ALL) ALL
260```
261
2623. Enable nginx, redis, postgresql services and initialize database.
263
264```
265sysrc postgresql_enable="YES"
266sysrc redis_enable="YES"
267sysrc nginx_enable="YES"
268```
269
270Initialize database and start services
271
272```
273service postgresql initdb
274service postgresql start
275service redis start
276service nginx start
277```
278
279## macOS
280
2811. Add the packages:
282
283```
284brew install ffmpeg nginx postgresql openssl gcc make redis git yarn
285```
286
2872. Run the services:
288
289```
290brew services run postgresql
291brew services run redis
292```
293
294## Gentoo
295
2961. Add this to ``/etc/portage/sets/peertube``:
297
298```
299net-libs/nodejs
300sys-apps/yarn
301media-video/ffmpeg[x264] # Optionnally add vorbis,vpx
302dev-db/postgresql
303dev-db/redis
304dev-vcs/git
305app-arch/unzip
306dev-lang/python:2.7
307www-servers/nginx
308
309# Optional, client for Let’s Encrypt:
310# app-crypt/certbot
311# app-crypt/certbot-nginx
312```
313
3142. If you are on a "stable" Gentoo you need to accept the testing keyword ~amd64 yarn:
315
316```
317mkdir -p /etc/portage/package.keywords
318cat << EOF >> /etc/portage/package.keywords/peertube
319# required by yarn (argument) for PeerTube
320sys-apps/yarn ~amd64
321EOF
322```
323
3243. Compile the peertube set:
325
326```
327emerge -a @peertube
328```
329
3304. Initialize the PostgreSQL database if you just merged it:
331
332```
333emerge --config postgresql
334```
335
3365. (For OpenRC) Enable and then start the services (replace with the correct PostgreSQL slot):
337
338```
339rc-update add redis
340rc-update add postgresql-11
341rc-service redis start
342rc-service postgresql-11 start
343```
344
345## Other distributions
346
347Feel free to update this file in a pull request!