]>
Commit | Line | Data |
---|---|---|
afe81767 | 1 | # Dependencies |
63bfad7e | 2 | |
3dd6d6cd | 3 | Follow 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`. |
867ed651 | 4 | |
c9b36909 RK |
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 | ||
92340699 RK |
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) | |
59bc5f7d | 14 | - [CentOS 8](#centos-8) |
92340699 RK |
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 | ||
e5203ffa | 23 | ## Debian / Ubuntu and derivatives |
ab87af11 DK |
24 | |
25 | 1. On a fresh Debian/Ubuntu, as root user, install basic utility programs needed for the installation | |
955f14a4 | 26 | |
bc2fc1a7 | 27 | ``` |
99402413 | 28 | # apt-get install curl sudo unzip vim |
bc2fc1a7 | 29 | ``` |
955f14a4 | 30 | |
ab87af11 DK |
31 | 2. It would be wise to disable root access and to continue this tutorial with a user with sudoers group access |
32 | ||
1d840011 | 33 | 3. Install NodeJS 14.x: |
ab87af11 | 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) |
d8658f0f | 35 | 4. Install yarn, and be sure to have [a recent version](https://github.com/yarnpkg/yarn/releases/latest): |
ab87af11 | 36 | [https://yarnpkg.com/en/docs/install#linux-tab](https://yarnpkg.com/en/docs/install#linux-tab) |
63bfad7e | 37 | |
d8658f0f | 38 | 5. Run: |
63bfad7e | 39 | |
afe81767 | 40 | ``` |
ab87af11 | 41 | sudo apt update |
3f8ae0e4 | 42 | sudo apt install certbot nginx ffmpeg postgresql postgresql-contrib openssl g++ make redis-server git python-dev cron wget |
f309a156 | 43 | ffmpeg -version # Should be >= 4.1 |
ab87af11 | 44 | g++ -v # Should be >= 5.x |
63bfad7e C |
45 | ``` |
46 | ||
81cdf382 | 47 | Now that dependencies are installed, before running PeerTube you should start PostgreSQL and Redis: |
ab87af11 | 48 | |
81cdf382 | 49 | ``` |
ab87af11 | 50 | sudo systemctl start redis postgresql |
81cdf382 RK |
51 | ``` |
52 | ||
afe81767 | 53 | ## Arch Linux |
63bfad7e | 54 | |
ab87af11 | 55 | 1. Run: |
63bfad7e | 56 | |
afe81767 | 57 | ``` |
ab87af11 | 58 | sudo pacman -S nodejs-lts-dubnium yarn ffmpeg postgresql openssl redis git wget unzip python2 base-devel npm nginx |
63bfad7e C |
59 | ``` |
60 | ||
81cdf382 | 61 | Now that dependencies are installed, before running PeerTube you should start PostgreSQL and Redis: |
ab87af11 | 62 | |
81cdf382 | 63 | ``` |
ab87af11 | 64 | sudo systemctl start redis postgresql |
81cdf382 RK |
65 | ``` |
66 | ||
053ad3a3 EC |
67 | ## CentOS 7 |
68 | ||
9162476f | 69 | 1. Install NodeJS 12.x: |
ab87af11 DK |
70 | [https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora](https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora) |
71 | ||
f309a156 | 72 | 2. Install yarn: |
ab87af11 DK |
73 | [https://yarnpkg.com/en/docs/install](https://yarnpkg.com/en/docs/install) |
74 | ||
75 | 3. 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 | ||
f309a156 | 80 | 4. Install Packages: |
053ad3a3 EC |
81 | |
82 | ``` | |
ab87af11 DK |
83 | sudo yum update |
84 | sudo yum install epel-release centos-release-scl | |
85 | sudo yum update | |
86 | sudo yum install nginx postgresql postgresql-server postgresql-contrib openssl gcc-c++ make wget redis git devtoolset-7 | |
0414ed10 O |
87 | ``` |
88 | ||
ab87af11 DK |
89 | 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. |
90 | ||
4c86a254 | 91 | ``` |
ab87af11 | 92 | sudo scl enable devtoolset-7 bash |
053ad3a3 EC |
93 | ``` |
94 | ||
d4557fd3 RK |
95 | Later 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 | ``` | |
ab87af11 | 98 | 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 |
d4557fd3 RK |
99 | ``` |
100 | ||
f309a156 | 101 | 6. Initialize the PostgreSQL database: |
ab87af11 | 102 | |
f60e85ce | 103 | ``` |
39072b2f | 104 | sudo PGSETUP_INITDB_OPTIONS='--auth-host=md5' postgresql-setup --initdb --unit postgresql |
f60e85ce W |
105 | ``` |
106 | ||
f309a156 | 107 | Now that dependencies are installed, before running PeerTube you should enable and start PostgreSQL and Redis: |
ab87af11 | 108 | |
81cdf382 | 109 | ``` |
a075cd00 CGI |
110 | sudo systemctl enable --now redis |
111 | sudo systemctl enable --now postgresql | |
81cdf382 RK |
112 | ``` |
113 | ||
a075cd00 CGI |
114 | ## Centos 8 |
115 | ||
9162476f | 116 | 1. Install NodeJS 12.x: |
a075cd00 CGI |
117 | [https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora](https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora) |
118 | ||
f309a156 | 119 | 2. Install yarn: |
a075cd00 CGI |
120 | [https://yarnpkg.com/en/docs/install](https://yarnpkg.com/en/docs/install) |
121 | ||
122 | 3. 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 | ||
f309a156 | 126 | 4. Install packages: |
a075cd00 CGI |
127 | |
128 | ``` | |
129 | sudo dnf update | |
f309a156 | 130 | sudo dnf install epel-release |
a075cd00 CGI |
131 | sudo dnf update |
132 | sudo dnf install nginx postgresql postgresql-server postgresql-contrib openssl gcc-c++ make wget redis git | |
133 | ``` | |
134 | ||
135 | 5. You'll need a symlink for python3 to python for youtube-dl to work | |
136 | ||
137 | ``` | |
138 | sudo ln -s /usr/bin/python3 /usr/bin/python | |
139 | ``` | |
140 | ||
f309a156 | 141 | 6. Initialize the PostgreSQL database: |
a075cd00 CGI |
142 | |
143 | ``` | |
39072b2f | 144 | sudo PGSETUP_INITDB_OPTIONS='--auth-host=md5' postgresql-setup --initdb --unit postgresql |
a075cd00 CGI |
145 | ``` |
146 | ||
f309a156 | 147 | Now that dependencies are installed, before running PeerTube you should enable and start PostgreSQL and Redis: |
a075cd00 CGI |
148 | |
149 | ``` | |
150 | sudo systemctl enable --now redis | |
151 | sudo systemctl enable --now postgresql | |
152 | ``` | |
153 | ||
f68d1cb6 W |
154 | ## Rocky Linux 8.4 |
155 | ||
156 | 1. Pull the latest updates: | |
157 | ``` | |
158 | sudo dnf update -y | |
159 | ``` | |
160 | ||
161 | 2. Install NodeJS 12.x (why 12 and not 14? Not sure...): | |
162 | ``` | |
163 | sudo dnf module install -y nodejs:12 | |
164 | ``` | |
165 | ||
166 | 3. Install yarn: | |
167 | ``` | |
168 | sudo npm install --global yarn | |
169 | ``` | |
170 | ||
171 | 4. Install or compile ffmpeg (if you want to compile... enjoy): | |
172 | ``` | |
173 | sudo dnf install -y epel-release | |
174 | sudo dnf --enablerepo=powertools install -y SDL2 SDL2-devel | |
175 | sudo 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 | |
176 | sudo dnf install -y ffmpeg | |
177 | sudo dnf update -y | |
178 | ``` | |
179 | ||
180 | 5. Install PostgreSQL and Python3 and other stuff: | |
181 | ``` | |
182 | sudo dnf install -y nginx postgresql postgresql-server postgresql-contrib openssl gcc-c++ make wget redis git python3 | |
183 | sudo ln -s /usr/bin/python3 /usr/bin/python | |
184 | sudo PGSETUP_INITDB_OPTIONS='--auth-host=md5' postgresql-setup --initdb --unit postgresql | |
185 | sudo systemctl enable --now redis | |
186 | sudo systemctl enable --now postgresql | |
187 | ``` | |
188 | ||
189 | 6. Configure the peertube user: | |
190 | ``` | |
191 | sudo useradd -m -d /var/www/peertube -s /bin/bash -p peertube peertube | |
192 | ``` | |
193 | ||
194 | 7. Unknown missing steps: | |
195 | - Steps missing here... these were adapted from the CentOS 8 steps which abruptly ended. | |
196 | - /var/www/peertube does not exist yet (expected? done in future steps? documentation?). | |
197 | - Nothing about Certbot, NGINX, Firewall settings, and etc. | |
198 | - Hopefully someone can suggest what is missing here with some hints so I can add it? | |
a075cd00 | 199 | |
0a314a99 | 200 | ## Fedora |
201 | ||
ab87af11 DK |
202 | 1. Upgrade your packages: |
203 | ||
0a314a99 | 204 | ``` |
205 | dnf upgrade | |
206 | ``` | |
ab87af11 DK |
207 | |
208 | 2. Add a user with sudoers group access: | |
209 | ||
0a314a99 | 210 | ``` |
211 | useradd my-peertube-user | |
212 | passwd my-peertube-user | |
213 | usermod my-peertube-user -a -G wheel # Add my-peertube-user to sudoers | |
214 | su my-peertube-user | |
215 | ``` | |
ab87af11 | 216 | |
d8658f0f | 217 | 3. (Optional) Install certbot (choose instructions for your distribution): |
0a314a99 | 218 | [https://certbot.eff.org/all-instructions](https://certbot.eff.org/all-instructions) |
ab87af11 | 219 | |
9162476f | 220 | 4. Install NodeJS 12.x: |
0a314a99 | 221 | [https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora](https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora) |
ab87af11 | 222 | |
f309a156 | 223 | 5. Install yarn: |
0a314a99 | 224 | [https://yarnpkg.com/en/docs/install](https://yarnpkg.com/en/docs/install) |
ab87af11 DK |
225 | |
226 | 6. Enable [RPM Fusion](https://rpmfusion.org) for Fedora (available for x86, x86_64, armhfp) | |
227 | ||
0a314a99 | 228 | ``` |
229 | sudo dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm | |
230 | ``` | |
231 | This is necessary because `ffmpeg` is not in the Fedora repos. | |
232 | ||
ab87af11 DK |
233 | 7. Run: |
234 | ||
0a314a99 | 235 | ``` |
39072b2f | 236 | sudo dnf install nginx ffmpeg postgresql-server postgresql-contrib openssl gcc-c++ make redis git vim |
f309a156 | 237 | ffmpeg -version # Should be >= 4.1 |
0a314a99 | 238 | g++ -v # Should be >= 5.x |
239 | ``` | |
ab87af11 | 240 | |
8182a370 FS |
241 | 8. Configure nginx |
242 | ||
243 | ``` | |
244 | sudo mkdir /etc/nginx/sites-available | |
245 | sudo mkdir /etc/nginx/sites-enabled | |
246 | sudo ln -s /etc/nginx/sites-enabled/peertube /etc/nginx/conf.d/peertube.conf | |
247 | ``` | |
248 | ||
249 | 9. Post-installation | |
0a314a99 | 250 | |
251 | _from [PostgreSQL documentation](https://www.postgresql.org/download/linux/redhat/):_ | |
252 | > Due to policies for Red Hat family distributions, the PostgreSQL installation will not be enabled for automatic start or have the database initialized automatically. | |
ab87af11 | 253 | |
0a314a99 | 254 | ``` |
255 | # PostgreSQL | |
39072b2f | 256 | sudo PGSETUP_INITDB_OPTIONS='--auth-host=md5' postgresql-setup --initdb --unit postgresql |
0a314a99 | 257 | sudo systemctl enable postgresql.service |
258 | sudo systemctl start postgresql.service | |
259 | # Nginx | |
260 | sudo systemctl enable nginx.service | |
261 | sudo systemctl start nginx.service | |
262 | # Redis | |
263 | sudo systemctl enable redis.service | |
264 | sudo systemctl start redis.service | |
265 | ``` | |
ab87af11 | 266 | |
8182a370 | 267 | 10. Firewall |
0a314a99 | 268 | |
51c35447 | 269 | By default, you cannot access your server via public IP. To do so, you must configure firewall: |
ab87af11 | 270 | |
0a314a99 | 271 | ``` |
272 | # Ports used by peertube dev setup | |
273 | sudo firewall-cmd --permanent --zone=public --add-port=3000/tcp | |
274 | sudo firewall-cmd --permanent --zone=public --add-port=9000/tcp | |
275 | # Optional | |
276 | sudo firewall-cmd --permanent --zone=public --add-service=http | |
277 | sudo firewall-cmd --permanent --zone=public --add-service=https | |
278 | # Reload firewall | |
279 | sudo firewall-cmd --reload | |
280 | ``` | |
0a314a99 | 281 | |
8182a370 | 282 | 11. Configure max ports |
ab87af11 | 283 | |
f309a156 | 284 | This is necessary if you are running dev setup, otherwise you will have errors with `nodemon` |
ab87af11 | 285 | |
0a314a99 | 286 | ``` |
287 | echo fs.inotify.max_user_watches=582222 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p | |
288 | ``` | |
ab87af11 | 289 | |
0a314a99 | 290 | [More info](https://stackoverflow.com/questions/34662574/node-js-getting-error-nodemon-internal-watch-failed-watch-enospc#34664097) |
291 | ||
4c86a254 GN |
292 | ## FreeBSD |
293 | ||
294 | On a fresh install of [FreeBSD](https://www.freebsd.org), new system or new jail: | |
295 | ||
f309a156 | 296 | 1. bootstrap pkg, initialize db and install peertube's dependencies, always as root (sudo not yet installed): |
ab87af11 | 297 | |
4c86a254 | 298 | ``` |
ab87af11 DK |
299 | pkg |
300 | pkg update | |
f6160062 | 301 | pkg install -y sudo bash wget git python nginx pkgconf postgresql13-server postgresql13-contrib redis openssl node npm yarn ffmpeg unzip |
4c86a254 GN |
302 | ``` |
303 | ||
f309a156 | 304 | 2. Allow users in the wheel group (hope you don't forgot to add your user on wheel group!) to use sudo. |
ab87af11 | 305 | |
4c86a254 GN |
306 | ``` |
307 | # visudo | |
308 | ``` | |
309 | ||
ab87af11 | 310 | Uncomment the line 90 |
f309a156 | 311 | |
4c86a254 GN |
312 | ``` |
313 | %wheel ALL=(ALL) ALL | |
314 | ``` | |
315 | ||
f309a156 | 316 | 3. Enable nginx, redis, postgresql services and initialize database. |
4c86a254 | 317 | |
4c86a254 | 318 | ``` |
ab87af11 DK |
319 | sysrc postgresql_enable="YES" |
320 | sysrc redis_enable="YES" | |
321 | sysrc nginx_enable="YES" | |
4c86a254 GN |
322 | ``` |
323 | ||
ab87af11 DK |
324 | Initialize database and start services |
325 | ||
4c86a254 | 326 | ``` |
ab87af11 DK |
327 | service postgresql initdb |
328 | service postgresql start | |
329 | service redis start | |
330 | service nginx start | |
4c86a254 GN |
331 | ``` |
332 | ||
2f7ac618 | 333 | ## macOS |
2f7ac618 | 334 | |
ab87af11 DK |
335 | 1. Add the packages: |
336 | ||
02d6226a AV |
337 | ```sh |
338 | brew install bash ffmpeg nginx postgresql openssl gcc make redis git yarn | |
ab87af11 | 339 | ``` |
02d6226a AV |
340 | |
341 | You may need to update your default version of bash. | |
342 | ||
343 | **How to change your default shell** | |
344 | ||
345 | ```sh | |
346 | which -a bash # Check where bash is installed | |
347 | bash --version # You need a version at least as recent as 4.0 | |
348 | sudo vim /etc/shells # Add in this file : /usr/local/bin/bash | |
349 | chsh -s /usr/local/bin/bash # To set the brew-installed bash as default bash | |
ab87af11 DK |
350 | ``` |
351 | ||
02d6226a AV |
352 | In a new shell, type `bash --version` to assert your changes took effect and |
353 | correctly modified your default bash version. | |
354 | ||
ab87af11 | 355 | 2. Run the services: |
2f7ac618 | 356 | |
02d6226a | 357 | ```sh |
ab87af11 DK |
358 | brew services run postgresql |
359 | brew services run redis | |
360 | ``` | |
396f224b | 361 | |
02d6226a | 362 | On macOS, the `postgresql` user can be `_postgres` instead of `postgres`. |
ddc7d3ec | 363 | If `sudo -u postgres createuser -P peertube` gives you an `unknown user: postgres` error, you can try `sudo -u _postgres createuser -U peertube`. |
02d6226a | 364 | |
396f224b HM |
365 | ## Gentoo |
366 | ||
ab87af11 DK |
367 | 1. Add this to ``/etc/portage/sets/peertube``: |
368 | ||
396f224b HM |
369 | ``` |
370 | net-libs/nodejs | |
371 | sys-apps/yarn | |
372 | media-video/ffmpeg[x264] # Optionnally add vorbis,vpx | |
373 | dev-db/postgresql | |
374 | dev-db/redis | |
375 | dev-vcs/git | |
376 | app-arch/unzip | |
8182a370 | 377 | dev-lang/python |
396f224b | 378 | www-servers/nginx |
396f224b | 379 | |
ab87af11 | 380 | # Optional, client for Let’s Encrypt: |
396f224b | 381 | # app-crypt/certbot |
396f224b HM |
382 | ``` |
383 | ||
ab87af11 DK |
384 | 2. If you are on a "stable" Gentoo you need to accept the testing keyword ~amd64 yarn: |
385 | ||
bfc6bb94 W |
386 | ``` |
387 | mkdir -p /etc/portage/package.keywords | |
388 | cat << EOF >> /etc/portage/package.keywords/peertube | |
389 | # required by yarn (argument) for PeerTube | |
390 | sys-apps/yarn ~amd64 | |
391 | EOF | |
392 | ``` | |
393 | ||
ab87af11 DK |
394 | 3. Compile the peertube set: |
395 | ||
396f224b HM |
396 | ``` |
397 | emerge -a @peertube | |
398 | ``` | |
399 | ||
ab87af11 DK |
400 | 4. Initialize the PostgreSQL database if you just merged it: |
401 | ||
396f224b HM |
402 | ``` |
403 | emerge --config postgresql | |
404 | ``` | |
405 | ||
ab87af11 DK |
406 | 5. (For OpenRC) Enable and then start the services (replace with the correct PostgreSQL slot): |
407 | ||
396f224b HM |
408 | ``` |
409 | rc-update add redis | |
c1109b45 | 410 | rc-update add postgresql-11 |
396f224b | 411 | rc-service redis start |
c1109b45 | 412 | rc-service postgresql-11 start |
396f224b | 413 | ``` |
f309a156 | 414 | |
80428d16 G |
415 | ## OpenBSD |
416 | ||
417 | 1. Install Packages: | |
418 | ||
419 | ``` | |
420 | pkg_add sudo bash wget git python nginx pkgconf postgresql-server postgresql-contrib redis openssl | |
421 | ``` | |
422 | ||
423 | 2. Install yarn: | |
424 | ||
425 | ``` | |
426 | npm install --global yarn | |
427 | ``` | |
428 | ||
429 | 3. Allow users in the wheel group to use sudo | |
430 | ||
431 | ``` | |
432 | visudo | |
433 | ``` | |
434 | Uncomment line #43: | |
435 | ||
436 | ``` | |
437 | %wheel ALL=(ALL) ALL | |
438 | ``` | |
439 | ||
440 | 4. Enable services: | |
441 | ||
442 | ``` | |
443 | rcctl enable postgresql redis nginx | |
444 | ``` | |
445 | ||
afe81767 | 446 | ## Other distributions |
63bfad7e C |
447 | |
448 | Feel free to update this file in a pull request! |