]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame_incremental - support/doc/dependencies.md
Remove vips dependency from FreeBSD instructions
[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_note_: only **LTS** versions of external dependencies are supported. If no LTS version matching the version constraint is available, only **release** versions are supported.
6
7<!-- START doctoc generated TOC please keep comment here to allow auto update -->
8<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
9
10
11- [Debian / Ubuntu and derivatives](#debian--ubuntu-and-derivatives)
12- [Arch Linux](#arch-linux)
13- [CentOS 7](#centos-7)
14- [CentOS 8](#centos-8)
15- [Fedora](#fedora)
16- [FreeBSD](#freebsd)
17- [macOS](#macos)
18- [Gentoo](#gentoo)
19- [Other distributions](#other-distributions)
20
21<!-- END doctoc generated TOC please keep comment here to allow auto update -->
22
23## Debian / Ubuntu and derivatives
24
251. On a fresh Debian/Ubuntu, as root user, install basic utility programs needed for the installation
26
27```
28# apt-get install curl sudo unzip vim
29```
30
312. It would be wise to disable root access and to continue this tutorial with a user with sudoers group access
32
333. Install NodeJS 12.x:
34[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)
354. Install yarn, and be sure to have [a recent version](https://github.com/yarnpkg/yarn/releases/latest):
36[https://yarnpkg.com/en/docs/install#linux-tab](https://yarnpkg.com/en/docs/install#linux-tab)
37
385. Run:
39
40```
41sudo apt update
42sudo apt install certbot nginx ffmpeg postgresql postgresql-contrib openssl g++ make redis-server git python-dev cron
43ffmpeg -version # Should be >= 4.1
44g++ -v # Should be >= 5.x
45```
46
47Now that dependencies are installed, before running PeerTube you should start PostgreSQL and Redis:
48
49```
50sudo systemctl start redis postgresql
51```
52
53## Arch Linux
54
551. Run:
56
57```
58sudo pacman -S nodejs-lts-dubnium yarn ffmpeg postgresql openssl redis git wget unzip python2 base-devel npm nginx
59```
60
61Now that dependencies are installed, before running PeerTube you should start PostgreSQL and Redis:
62
63```
64sudo systemctl start redis postgresql
65```
66
67## CentOS 7
68
691. Install NodeJS 12.x:
70[https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora](https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora)
71
722. Install yarn:
73[https://yarnpkg.com/en/docs/install](https://yarnpkg.com/en/docs/install)
74
753. Install or compile ffmpeg:
76
77* Install - [https://linoxide.com/linux-how-to/install-ffmpeg-centos-7/](https://linoxide.com/linux-how-to/install-ffmpeg-centos-7/)
78* Compile - [https://gist.github.com/mustafaturan/7053900#file-latest-ffmpeg-centos6-sh](https://gist.github.com/mustafaturan/7053900#file-latest-ffmpeg-centos6-sh)
79
804. Install Packages:
81
82```
83sudo yum update
84sudo yum install epel-release centos-release-scl
85sudo yum update
86sudo yum install nginx postgresql postgresql-server postgresql-contrib openssl gcc-c++ make wget redis git devtoolset-7
87```
88
895. 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.
90
91```
92sudo scl enable devtoolset-7 bash
93```
94
95Later 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:
96
97```
98sudo -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
99```
100
1016. Initialize the PostgreSQL database:
102
103```
104sudo postgresql-setup initdb
105```
106
107Now that dependencies are installed, before running PeerTube you should enable and start PostgreSQL and Redis:
108
109```
110sudo systemctl enable --now redis
111sudo systemctl enable --now postgresql
112```
113
114## Centos 8
115
1161. Install NodeJS 12.x:
117[https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora](https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora)
118
1192. Install yarn:
120[https://yarnpkg.com/en/docs/install](https://yarnpkg.com/en/docs/install)
121
1223. Install or compile ffmpeg:
123
124* Install - [https://linuxize.com/post/how-to-install-ffmpeg-on-centos-8/](https://linuxize.com/post/how-to-install-ffmpeg-on-centos-8/)
125
1264. Install packages:
127
128```
129sudo dnf update
130sudo dnf install epel-release
131sudo dnf update
132sudo dnf install nginx postgresql postgresql-server postgresql-contrib openssl gcc-c++ make wget redis git
133```
134
1355. You'll need a symlink for python3 to python for youtube-dl to work
136
137```
138sudo ln -s /usr/bin/python3 /usr/bin/python
139```
140
1416. Initialize the PostgreSQL database:
142
143```
144sudo postgresql-setup initdb
145```
146
147Now that dependencies are installed, before running PeerTube you should enable and start PostgreSQL and Redis:
148
149```
150sudo systemctl enable --now redis
151sudo systemctl enable --now postgresql
152```
153
154
155## Fedora
156
1571. Upgrade your packages:
158
159```
160dnf upgrade
161```
162
1632. Add a user with sudoers group access:
164
165```
166useradd my-peertube-user
167passwd my-peertube-user
168usermod my-peertube-user -a -G wheel # Add my-peertube-user to sudoers
169su my-peertube-user
170```
171
1723. (Optional) Install certbot (choose instructions for your distribution):
173[https://certbot.eff.org/all-instructions](https://certbot.eff.org/all-instructions)
174
1754. Install NodeJS 12.x:
176[https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora](https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora)
177
1785. Install yarn:
179[https://yarnpkg.com/en/docs/install](https://yarnpkg.com/en/docs/install)
180
1816. Enable [RPM Fusion](https://rpmfusion.org) for Fedora (available for x86, x86_64, armhfp)
182
183```
184sudo dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm
185```
186This is necessary because `ffmpeg` is not in the Fedora repos.
187
1887. Run:
189
190```
191sudo dnf install nginx ffmpeg postgresql-server postgresql-contrib openssl gcc-c++ make redis git
192ffmpeg -version # Should be >= 4.1
193g++ -v # Should be >= 5.x
194```
195
1968. Post-installation
197
198_from [PostgreSQL documentation](https://www.postgresql.org/download/linux/redhat/):_
199> Due to policies for Red Hat family distributions, the PostgreSQL installation will not be enabled for automatic start or have the database initialized automatically.
200
201```
202# PostgreSQL
203sudo postgresql-setup initdb
204sudo systemctl enable postgresql.service
205sudo systemctl start postgresql.service
206# Nginx
207sudo systemctl enable nginx.service
208sudo systemctl start nginx.service
209# Redis
210sudo systemctl enable redis.service
211sudo systemctl start redis.service
212```
213
2149. Firewall
215
216By default, you cannot access your server via public IP. To do so, you must configure firewall:
217
218```
219# Ports used by peertube dev setup
220sudo firewall-cmd --permanent --zone=public --add-port=3000/tcp
221sudo firewall-cmd --permanent --zone=public --add-port=9000/tcp
222# Optional
223sudo firewall-cmd --permanent --zone=public --add-service=http
224sudo firewall-cmd --permanent --zone=public --add-service=https
225# Reload firewall
226sudo firewall-cmd --reload
227```
228
22910. Configure max ports
230
231This is necessary if you are running dev setup, otherwise you will have errors with `nodemon`
232
233```
234echo fs.inotify.max_user_watches=582222 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
235```
236
237[More info](https://stackoverflow.com/questions/34662574/node-js-getting-error-nodemon-internal-watch-failed-watch-enospc#34664097)
238
239## FreeBSD
240
241On a fresh install of [FreeBSD](https://www.freebsd.org), new system or new jail:
242
2431. bootstrap pkg, initialize db and install peertube's dependencies, always as root (sudo not yet installed):
244
245```
246pkg
247pkg update
248pkg install -y sudo bash wget git python nginx pkgconf postgresql96-server postgresql96-contrib redis openssl node npm yarn ffmpeg unzip
249```
250
2512. Allow users in the wheel group (hope you don't forgot to add your user on wheel group!) to use sudo.
252
253```
254# visudo
255```
256
257Uncomment the line 90
258
259```
260%wheel ALL=(ALL) ALL
261```
262
2633. Enable nginx, redis, postgresql services and initialize database.
264
265```
266sysrc postgresql_enable="YES"
267sysrc redis_enable="YES"
268sysrc nginx_enable="YES"
269```
270
271Initialize database and start services
272
273```
274service postgresql initdb
275service postgresql start
276service redis start
277service nginx start
278```
279
280## macOS
281
2821. Add the packages:
283
284```
285brew install ffmpeg nginx postgresql openssl gcc make redis git yarn
286```
287
2882. Run the services:
289
290```
291brew services run postgresql
292brew services run redis
293```
294
295## Gentoo
296
2971. Add this to ``/etc/portage/sets/peertube``:
298
299```
300net-libs/nodejs
301sys-apps/yarn
302media-video/ffmpeg[x264] # Optionnally add vorbis,vpx
303dev-db/postgresql
304dev-db/redis
305dev-vcs/git
306app-arch/unzip
307dev-lang/python:2.7
308www-servers/nginx
309
310# Optional, client for Let’s Encrypt:
311# app-crypt/certbot
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## OpenBSD
346
3471. Install Packages:
348
349```
350pkg_add sudo bash wget git python nginx pkgconf postgresql-server postgresql-contrib redis openssl
351```
352
3532. Install yarn:
354
355```
356npm install --global yarn
357```
358
3593. Allow users in the wheel group to use sudo
360
361```
362visudo
363```
364Uncomment line #43:
365
366```
367%wheel ALL=(ALL) ALL
368```
369
3704. Enable services:
371
372```
373rcctl enable postgresql redis nginx
374```
375
376## Other distributions
377
378Feel free to update this file in a pull request!