]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame_incremental - support/doc/dependencies.md
For Gentoo : update @peertube set (delete vips)
[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 1. On a fresh Debian/Ubuntu, as root user, install basic utility programs needed for the installation
20
21```
22# apt-get install curl sudo unzip vim
23```
24
25 2. It would be wise to disable root access and to continue this tutorial with a user with sudoers group access
26
27 3. Install certbot (choose instructions for nginx and your distribution) :
28 [https://certbot.eff.org/all-instructions](https://certbot.eff.org/all-instructions)
29 4. Install NodeJS 8.x:
30 [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)
31 5. Install yarn, and be sure to have [a recent version](https://github.com/yarnpkg/yarn/releases/latest):
32 [https://yarnpkg.com/en/docs/install#linux-tab](https://yarnpkg.com/en/docs/install#linux-tab)
33 6. Run:
34
35```
36$ sudo apt update
37$ sudo apt install nginx ffmpeg postgresql postgresql-contrib openssl g++ make redis-server git python-dev
38$ ffmpeg -version # Should be >= 3.x
39$ g++ -v # Should be >= 5.x
40```
41
42If you still have a 2.x version of FFmpeg on Ubuntu:
43```
44$ sudo add-apt-repository ppa:jonathonf/ffmpeg-3
45$ sudo apt-get update
46$ sudo apt install ffmpeg
47```
48
49Now that dependencies are installed, before running PeerTube you should start PostgreSQL and Redis:
50```
51$ sudo systemctl start redis postgresql
52```
53
54## Arch Linux
55
56 1. Run:
57
58```
59$ sudo pacman -S nodejs-lts-dubnium yarn ffmpeg postgresql openssl redis git wget unzip python2 base-devel npm nginx
60```
61
62Now that dependencies are installed, before running PeerTube you should start PostgreSQL and Redis:
63```
64$ sudo systemctl start redis postgresql
65```
66
67## CentOS 7
68
69 1. Install NodeJS 8.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 2. Install yarn:
72 [https://yarnpkg.com/en/docs/install](https://yarnpkg.com/en/docs/install)
73 3. Install or compile ffmpeg:
74 * Install - [https://linoxide.com/linux-how-to/install-ffmpeg-centos-7/](https://linoxide.com/linux-how-to/install-ffmpeg-centos-7/)
75 * Compile - [https://gist.github.com/mustafaturan/7053900#file-latest-ffmpeg-centos6-sh](https://gist.github.com/mustafaturan/7053900#file-latest-ffmpeg-centos6-sh)
76 4. Run:
77
78```
79$ sudo yum update
80$ sudo yum install epel-release centos-release-scl
81$ sudo yum update
82$ sudo yum install nginx postgresql postgresql-server postgresql-contrib openssl gcc-c++ make redis git devtoolset-7
83```
84
85 5. 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.
86```
87$ sudo scl enable devtoolset-7 bash
88```
89
90Later 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:
91
92```
93$ sudo -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
94```
95
96Now that dependencies are installed, before running PeerTube you should start PostgreSQL and Redis:
97```
98$ sudo service redis start
99$ sudo service postgresql start
100```
101
102## Fedora
103
1040. Upgrade your packages:
105```
106dnf upgrade
107```
1081. Add a user with sudoers group access:
109```
110useradd my-peertube-user
111passwd my-peertube-user
112usermod my-peertube-user -a -G wheel # Add my-peertube-user to sudoers
113su my-peertube-user
114```
1152. (Optional) Install certbot (choose instructions for nginx and your distribution) :
116[https://certbot.eff.org/all-instructions](https://certbot.eff.org/all-instructions)
1173. Install NodeJS 8.x:
118[https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora](https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora)
1194. Install yarn:
120[https://yarnpkg.com/en/docs/install](https://yarnpkg.com/en/docs/install)
1215. Enable [RPM Fusion](https://rpmfusion.org) for Fedora (available for x86, x86_64, armhfp)
122```
123sudo dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm
124```
125This is necessary because `ffmpeg` is not in the Fedora repos.
126
1276. Run:
128```
129sudo dnf install nginx ffmpeg postgresql-server postgresql-contrib openssl gcc-c++ make redis git
130ffmpeg -version # Should be >= 3.x
131g++ -v # Should be >= 5.x
132```
1337. Post-installation
134
135_from [PostgreSQL documentation](https://www.postgresql.org/download/linux/redhat/):_
136> Due to policies for Red Hat family distributions, the PostgreSQL installation will not be enabled for automatic start or have the database initialized automatically.
137```
138# PostgreSQL
139sudo postgresql-setup initdb
140sudo systemctl enable postgresql.service
141sudo systemctl start postgresql.service
142# Nginx
143sudo systemctl enable nginx.service
144sudo systemctl start nginx.service
145# Redis
146sudo systemctl enable redis.service
147sudo systemctl start redis.service
148```
1498. Firewall
150
151By default, you cannot acces your server via public IP. To do so, you must configure firewall:
152```
153# Ports used by peertube dev setup
154sudo firewall-cmd --permanent --zone=public --add-port=3000/tcp
155sudo firewall-cmd --permanent --zone=public --add-port=9000/tcp
156# Optional
157sudo firewall-cmd --permanent --zone=public --add-service=http
158sudo firewall-cmd --permanent --zone=public --add-service=https
159# Reload firewall
160sudo firewall-cmd --reload
161```
1629. Configure max ports
163
164This is necessary if you are running dev setup, otherwise you will have errors with `nodemon`
165```
166echo fs.inotify.max_user_watches=582222 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
167```
168[More info](https://stackoverflow.com/questions/34662574/node-js-getting-error-nodemon-internal-watch-failed-watch-enospc#34664097)
169
170## FreeBSD
171
172On a fresh install of [FreeBSD](https://www.freebsd.org), new system or new jail:
173
174 1. bootstrap pkg, initialize db and install peertube's dependencies, always as root (sudo not yet installed):
175```
176# pkg
177# pkg update
178# pkg install -y sudo bash wget git python nginx pkgconf vips postgresql96-server postgresql96-contrib redis openssl node npm yarn ffmpeg unzip
179```
180
181 2. Allow users in the wheel group (hope you don't forgot to add your user on wheel group!) to use sudo
182```
183# visudo
184```
185
186 Uncomment the line 90
187```
188%wheel ALL=(ALL) ALL
189```
190
191 3. Enable nginx, redis, postgresql services and initialize database
192
193```
194# sysrc postgresql_enable="YES"
195# sysrc redis_enable="YES"
196# sysrc nginx_enable="YES"
197```
198
199 Initialize database and start services
200```
201# service postgresql initdb
202# service postgresql start
203# service redis start
204# service nginx start
205```
206
207## macOS
208* Add the packages:
209
210 ```
211 brew install ffmpeg nginx postgresql openssl gcc make redis git yarn
212 ```
213* Run the services:
214
215 ```
216 brew services run postgresql
217 brew services run redis
218 ```
219
220## Gentoo
221
222* Add this to ``/etc/portage/sets/peertube``:
223```
224net-libs/nodejs
225sys-apps/yarn
226media-video/ffmpeg[x264] # Optionnally add vorbis,vpx
227dev-db/postgresql
228dev-db/redis
229dev-vcs/git
230app-arch/unzip
231dev-lang/python:2.7
232www-servers/nginx
233
234# Optionnal, client for Let’s Encrypt:
235# app-crypt/certbot
236# app-crypt/certbot-nginx
237```
238
239* Compile the peertube set:
240```
241emerge -a @peertube
242```
243
244* Initialize the PostgreSQL database if you just merged it:
245```
246emerge --config postgresql
247```
248
249* (For OpenRC) Enable and then start the services (replace with the correct PostgreSQL slot):
250```
251rc-update add redis
252rc-update add postgresql-11
253rc-service redis start
254rc-service postgresql-11 start
255```
256
257## Other distributions
258
259Feel free to update this file in a pull request!