]>
Commit | Line | Data |
---|---|---|
afe81767 | 1 | # Dependencies |
63bfad7e | 2 | |
461bcc1a S |
3 | :warning: **Warning**: dependencies guide is maintained by the community. Some parts may be outdated! :warning: |
4 | ||
3dd6d6cd | 5 | 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 | 6 | |
c9b36909 RK |
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 | ||
92340699 RK |
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 | ||
3e2b75ee | 12 | - [Debian / Ubuntu and derivatives](#debian-ubuntu-and-derivatives) |
92340699 RK |
13 | - [Arch Linux](#arch-linux) |
14 | - [CentOS 7](#centos-7) | |
4d557df5 C |
15 | - [Centos 8](#centos-8) |
16 | - [Rocky Linux 8.4](#rocky-linux-84) | |
92340699 | 17 | - [Fedora](#fedora) |
4d557df5 | 18 | - [Red Hat Enterprise Linux 8](#red-hat-enterprise-linux-8) |
92340699 RK |
19 | - [FreeBSD](#freebsd) |
20 | - [macOS](#macos) | |
21 | - [Gentoo](#gentoo) | |
4d557df5 | 22 | - [OpenBSD](#openbsd) |
92340699 RK |
23 | - [Other distributions](#other-distributions) |
24 | ||
25 | <!-- END doctoc generated TOC please keep comment here to allow auto update --> | |
26 | ||
e5203ffa | 27 | ## Debian / Ubuntu and derivatives |
ab87af11 DK |
28 | |
29 | 1. On a fresh Debian/Ubuntu, as root user, install basic utility programs needed for the installation | |
955f14a4 | 30 | |
bc2fc1a7 | 31 | ``` |
99402413 | 32 | # apt-get install curl sudo unzip vim |
bc2fc1a7 | 33 | ``` |
955f14a4 | 34 | |
ab87af11 DK |
35 | 2. It would be wise to disable root access and to continue this tutorial with a user with sudoers group access |
36 | ||
1d840011 | 37 | 3. Install NodeJS 14.x: |
ab87af11 | 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) |
d8658f0f | 39 | 4. Install yarn, and be sure to have [a recent version](https://github.com/yarnpkg/yarn/releases/latest): |
ab87af11 | 40 | [https://yarnpkg.com/en/docs/install#linux-tab](https://yarnpkg.com/en/docs/install#linux-tab) |
63bfad7e | 41 | |
4d557df5 C |
42 | 5. Install Python: |
43 | ||
44 | On Ubuntu <= bionic (18.04 LTS) or Debian <= Buster: | |
45 | ||
46 | ``` | |
47 | sudo apt update | |
48 | sudo apt install python-dev | |
49 | python --version # Should be >= 2.x or >= 3.x | |
50 | ``` | |
51 | ||
52 | On Ubuntu >= focal (20.04 LTS) or Debian >= Bullseye: | |
53 | ||
54 | ``` | |
55 | sudo apt update | |
56 | sudo apt install python3-dev python-is-python3 # python-is-python2 should also work | |
57 | python --version # Should be >= 2.x or >= 3.x | |
58 | ``` | |
59 | ||
60 | 6. Install common dependencies: | |
63bfad7e | 61 | |
afe81767 | 62 | ``` |
ab87af11 | 63 | sudo apt update |
4d557df5 | 64 | sudo apt install certbot nginx ffmpeg postgresql postgresql-contrib openssl g++ make redis-server git cron wget |
f309a156 | 65 | ffmpeg -version # Should be >= 4.1 |
ab87af11 | 66 | g++ -v # Should be >= 5.x |
63bfad7e C |
67 | ``` |
68 | ||
81cdf382 | 69 | Now that dependencies are installed, before running PeerTube you should start PostgreSQL and Redis: |
ab87af11 | 70 | |
81cdf382 | 71 | ``` |
ab87af11 | 72 | sudo systemctl start redis postgresql |
81cdf382 RK |
73 | ``` |
74 | ||
afe81767 | 75 | ## Arch Linux |
63bfad7e | 76 | |
ab87af11 | 77 | 1. Run: |
63bfad7e | 78 | |
afe81767 | 79 | ``` |
4ff75a3b | 80 | sudo pacman -S nodejs-lts-fermium yarn ffmpeg postgresql openssl redis git wget unzip python base-devel npm nginx |
63bfad7e C |
81 | ``` |
82 | ||
81cdf382 | 83 | Now that dependencies are installed, before running PeerTube you should start PostgreSQL and Redis: |
ab87af11 | 84 | |
81cdf382 | 85 | ``` |
ab87af11 | 86 | sudo systemctl start redis postgresql |
81cdf382 RK |
87 | ``` |
88 | ||
053ad3a3 EC |
89 | ## CentOS 7 |
90 | ||
4ff75a3b | 91 | 1. Install NodeJS 14.x: |
ab87af11 DK |
92 | [https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora](https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora) |
93 | ||
f309a156 | 94 | 2. Install yarn: |
ab87af11 DK |
95 | [https://yarnpkg.com/en/docs/install](https://yarnpkg.com/en/docs/install) |
96 | ||
97 | 3. 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 | ||
f309a156 | 102 | 4. Install Packages: |
053ad3a3 EC |
103 | |
104 | ``` | |
ab87af11 DK |
105 | sudo yum update |
106 | sudo yum install epel-release centos-release-scl | |
107 | sudo yum update | |
108 | sudo yum install nginx postgresql postgresql-server postgresql-contrib openssl gcc-c++ make wget redis git devtoolset-7 | |
0414ed10 O |
109 | ``` |
110 | ||
ab87af11 DK |
111 | 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. |
112 | ||
4c86a254 | 113 | ``` |
ab87af11 | 114 | sudo scl enable devtoolset-7 bash |
053ad3a3 EC |
115 | ``` |
116 | ||
d4557fd3 RK |
117 | 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: |
118 | ||
119 | ``` | |
ab87af11 | 120 | 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 |
121 | ``` |
122 | ||
f309a156 | 123 | 6. Initialize the PostgreSQL database: |
ab87af11 | 124 | |
f60e85ce | 125 | ``` |
39072b2f | 126 | sudo PGSETUP_INITDB_OPTIONS='--auth-host=md5' postgresql-setup --initdb --unit postgresql |
f60e85ce W |
127 | ``` |
128 | ||
f309a156 | 129 | Now that dependencies are installed, before running PeerTube you should enable and start PostgreSQL and Redis: |
ab87af11 | 130 | |
81cdf382 | 131 | ``` |
a075cd00 CGI |
132 | sudo systemctl enable --now redis |
133 | sudo systemctl enable --now postgresql | |
81cdf382 RK |
134 | ``` |
135 | ||
a075cd00 CGI |
136 | ## Centos 8 |
137 | ||
4ff75a3b | 138 | 1. Install NodeJS 14.x: |
a075cd00 CGI |
139 | [https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora](https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora) |
140 | ||
f309a156 | 141 | 2. Install yarn: |
a075cd00 CGI |
142 | [https://yarnpkg.com/en/docs/install](https://yarnpkg.com/en/docs/install) |
143 | ||
144 | 3. Install or compile ffmpeg: | |
145 | ||
146 | * Install - [https://linuxize.com/post/how-to-install-ffmpeg-on-centos-8/](https://linuxize.com/post/how-to-install-ffmpeg-on-centos-8/) | |
147 | ||
f309a156 | 148 | 4. Install packages: |
a075cd00 CGI |
149 | |
150 | ``` | |
151 | sudo dnf update | |
f309a156 | 152 | sudo dnf install epel-release |
a075cd00 CGI |
153 | sudo dnf update |
154 | sudo dnf install nginx postgresql postgresql-server postgresql-contrib openssl gcc-c++ make wget redis git | |
155 | ``` | |
156 | ||
157 | 5. You'll need a symlink for python3 to python for youtube-dl to work | |
158 | ||
159 | ``` | |
160 | sudo ln -s /usr/bin/python3 /usr/bin/python | |
161 | ``` | |
162 | ||
f309a156 | 163 | 6. Initialize the PostgreSQL database: |
a075cd00 CGI |
164 | |
165 | ``` | |
39072b2f | 166 | sudo PGSETUP_INITDB_OPTIONS='--auth-host=md5' postgresql-setup --initdb --unit postgresql |
a075cd00 CGI |
167 | ``` |
168 | ||
f309a156 | 169 | Now that dependencies are installed, before running PeerTube you should enable and start PostgreSQL and Redis: |
a075cd00 CGI |
170 | |
171 | ``` | |
172 | sudo systemctl enable --now redis | |
173 | sudo systemctl enable --now postgresql | |
174 | ``` | |
175 | ||
d35f3a86 | 176 | ## Rocky Linux 8.4 |
f68d1cb6 | 177 | |
d35f3a86 | 178 | 1. Pull the latest updates: |
f68d1cb6 W |
179 | ``` |
180 | sudo dnf update -y | |
181 | ``` | |
182 | ||
4ff75a3b | 183 | 2. Install NodeJS 14.x: |
f68d1cb6 | 184 | ``` |
4ff75a3b | 185 | sudo dnf module install -y nodejs:14 |
f68d1cb6 W |
186 | ``` |
187 | ||
d35f3a86 | 188 | 3. Install yarn: |
f68d1cb6 W |
189 | ``` |
190 | sudo npm install --global yarn | |
191 | ``` | |
192 | ||
d35f3a86 | 193 | 4. Install or compile ffmpeg (if you want to compile... enjoy): |
f68d1cb6 | 194 | ``` |
d35f3a86 | 195 | sudo dnf install -y epel-release |
f68d1cb6 W |
196 | sudo dnf --enablerepo=powertools install -y SDL2 SDL2-devel |
197 | 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 | |
198 | sudo dnf install -y ffmpeg | |
199 | sudo dnf update -y | |
200 | ``` | |
201 | ||
202 | 5. Install PostgreSQL and Python3 and other stuff: | |
203 | ``` | |
204 | sudo dnf install -y nginx postgresql postgresql-server postgresql-contrib openssl gcc-c++ make wget redis git python3 | |
205 | sudo ln -s /usr/bin/python3 /usr/bin/python | |
206 | sudo PGSETUP_INITDB_OPTIONS='--auth-host=md5' postgresql-setup --initdb --unit postgresql | |
207 | sudo systemctl enable --now redis | |
208 | sudo systemctl enable --now postgresql | |
209 | ``` | |
210 | ||
211 | 6. Configure the peertube user: | |
212 | ``` | |
213 | sudo useradd -m -d /var/www/peertube -s /bin/bash -p peertube peertube | |
214 | ``` | |
215 | ||
216 | 7. Unknown missing steps: | |
d35f3a86 C |
217 | - Steps missing here... these were adapted from the CentOS 8 steps which abruptly ended. |
218 | - /var/www/peertube does not exist yet (expected? done in future steps? documentation?). | |
219 | - Nothing about Certbot, NGINX, Firewall settings, and etc. | |
220 | - Hopefully someone can suggest what is missing here with some hints so I can add it? | |
a075cd00 | 221 | |
0a314a99 | 222 | ## Fedora |
223 | ||
ab87af11 DK |
224 | 1. Upgrade your packages: |
225 | ||
0a314a99 | 226 | ``` |
227 | dnf upgrade | |
228 | ``` | |
ab87af11 DK |
229 | |
230 | 2. Add a user with sudoers group access: | |
231 | ||
0a314a99 | 232 | ``` |
233 | useradd my-peertube-user | |
234 | passwd my-peertube-user | |
235 | usermod my-peertube-user -a -G wheel # Add my-peertube-user to sudoers | |
236 | su my-peertube-user | |
237 | ``` | |
ab87af11 | 238 | |
d8658f0f | 239 | 3. (Optional) Install certbot (choose instructions for your distribution): |
0a314a99 | 240 | [https://certbot.eff.org/all-instructions](https://certbot.eff.org/all-instructions) |
ab87af11 | 241 | |
4ff75a3b | 242 | 4. Install NodeJS 14.x: |
0a314a99 | 243 | [https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora](https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora) |
ab87af11 | 244 | |
f309a156 | 245 | 5. Install yarn: |
0a314a99 | 246 | [https://yarnpkg.com/en/docs/install](https://yarnpkg.com/en/docs/install) |
ab87af11 DK |
247 | |
248 | 6. Enable [RPM Fusion](https://rpmfusion.org) for Fedora (available for x86, x86_64, armhfp) | |
249 | ||
0a314a99 | 250 | ``` |
251 | sudo dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm | |
252 | ``` | |
253 | This is necessary because `ffmpeg` is not in the Fedora repos. | |
254 | ||
ab87af11 DK |
255 | 7. Run: |
256 | ||
0a314a99 | 257 | ``` |
39072b2f | 258 | sudo dnf install nginx ffmpeg postgresql-server postgresql-contrib openssl gcc-c++ make redis git vim |
f309a156 | 259 | ffmpeg -version # Should be >= 4.1 |
0a314a99 | 260 | g++ -v # Should be >= 5.x |
261 | ``` | |
ab87af11 | 262 | |
8182a370 FS |
263 | 8. Configure nginx |
264 | ||
265 | ``` | |
266 | sudo mkdir /etc/nginx/sites-available | |
267 | sudo mkdir /etc/nginx/sites-enabled | |
268 | sudo ln -s /etc/nginx/sites-enabled/peertube /etc/nginx/conf.d/peertube.conf | |
269 | ``` | |
270 | ||
271 | 9. Post-installation | |
0a314a99 | 272 | |
273 | _from [PostgreSQL documentation](https://www.postgresql.org/download/linux/redhat/):_ | |
274 | > 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 | 275 | |
0a314a99 | 276 | ``` |
277 | # PostgreSQL | |
39072b2f | 278 | sudo PGSETUP_INITDB_OPTIONS='--auth-host=md5' postgresql-setup --initdb --unit postgresql |
0a314a99 | 279 | sudo systemctl enable postgresql.service |
280 | sudo systemctl start postgresql.service | |
281 | # Nginx | |
282 | sudo systemctl enable nginx.service | |
283 | sudo systemctl start nginx.service | |
284 | # Redis | |
285 | sudo systemctl enable redis.service | |
286 | sudo systemctl start redis.service | |
287 | ``` | |
ab87af11 | 288 | |
8182a370 | 289 | 10. Firewall |
0a314a99 | 290 | |
51c35447 | 291 | By default, you cannot access your server via public IP. To do so, you must configure firewall: |
ab87af11 | 292 | |
644800ef | 293 | - Ports used by peertube dev setup: |
0a314a99 | 294 | ``` |
0a314a99 | 295 | sudo firewall-cmd --permanent --zone=public --add-port=3000/tcp |
296 | sudo firewall-cmd --permanent --zone=public --add-port=9000/tcp | |
644800ef FS |
297 | ``` |
298 | - Optional | |
299 | ||
300 | ``` | |
301 | sudo firewall-cmd --permanent --zone=public --add-service=http | |
302 | sudo firewall-cmd --permanent --zone=public --add-service=https | |
303 | ``` | |
304 | ||
305 | - Reload firewall | |
306 | ||
307 | ``` | |
308 | sudo firewall-cmd --reload | |
309 | ``` | |
310 | ||
311 | 11. Configure max ports | |
312 | ||
313 | This is necessary if you are running dev setup, otherwise you will have errors with `nodemon` | |
314 | ||
315 | ``` | |
316 | echo fs.inotify.max_user_watches=582222 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p | |
317 | ``` | |
318 | ||
319 | [More info](https://stackoverflow.com/questions/34662574/node-js-getting-error-nodemon-internal-watch-failed-watch-enospc#34664097) | |
320 | ||
321 | ## Red Hat Enterprise Linux 8 | |
322 | ||
323 | 1. Register system as root user to Red Hat Subscription Management (create a free Red Hat account if you don't have one yet). | |
324 | ||
325 | ``` | |
326 | # subscription-manager register --username <username> --password <password> --auto-attach | |
327 | # dnf upgrade | |
328 | # reboot | |
329 | ``` | |
330 | ||
331 | 2. Install Node.JS | |
332 | ||
333 | ``` | |
4ff75a3b | 334 | sudo dnf module install nodejs:14 |
644800ef FS |
335 | ``` |
336 | ||
337 | 3. Install Yarn | |
338 | ||
339 | ``` | |
340 | curl --silent --location https://dl.yarnpkg.com/rpm/yarn.repo | sudo tee /etc/yum.repos.d/yarn.repo | |
341 | sudo dnf install yarn | |
342 | ``` | |
343 | ||
344 | 4. Install FFmpeg | |
345 | ||
346 | ``` | |
347 | sudo subscription-manager repos --enable "codeready-builder-for-rhel-8-$(arch)-rpms" | |
348 | sudo dnf install --nogpgcheck https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm | |
349 | sudo dnf install --nogpgcheck https://mirrors.rpmfusion.org/free/el/rpmfusion-free-release-8.noarch.rpm | |
350 | sudo dnf upgrade | |
351 | sudo dnf install ffmpeg | |
352 | ``` | |
353 | ||
354 | 5. Run: | |
355 | ||
356 | ``` | |
357 | sudo dnf install nginx postgresql postgresql-server postgresql-contrib openssl gcc-c++ make wget redis git | |
358 | ``` | |
359 | ||
360 | 6. You'll need a symlink for python3 to python for youtube-dl to work | |
361 | ||
362 | ``` | |
3a63b110 | 363 | sudo alternatives --set python3 /usr/bin/python |
644800ef FS |
364 | ``` |
365 | ||
366 | 7. Initialize the PostgreSQL database: | |
367 | ||
368 | ``` | |
369 | sudo PGSETUP_INITDB_OPTIONS='--auth-host=md5' postgresql-setup --initdb --unit postgresql | |
370 | ``` | |
371 | ||
372 | Now that dependencies are installed, before running PeerTube you should enable and start PostgreSQL and Redis: | |
373 | ||
374 | ``` | |
375 | sudo systemctl enable --now redis | |
376 | sudo systemctl enable --now postgresql | |
377 | ``` | |
378 | ||
379 | If 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: | |
380 | ||
381 | 8. Configure nginx | |
382 | ||
383 | ``` | |
384 | sudo mkdir /etc/nginx/sites-available | |
385 | sudo mkdir /etc/nginx/sites-enabled | |
386 | sudo ln -s /etc/nginx/sites-enabled/peertube /etc/nginx/conf.d/peertube.conf | |
387 | sudo systemctl enable --now nginx | |
388 | ``` | |
389 | ||
390 | 9. Prepare directory | |
391 | ||
392 | To 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. | |
393 | ||
394 | ``` | |
395 | sudo mkdir /var/www | |
396 | ||
397 | sudo useradd -m -d /var/www/peertube -s /bin/bash -p peertube peertube | |
398 | sudo passwd peertube | |
399 | ||
400 | sudo chmod 755 /var/www/peertube/ | |
401 | ``` | |
402 | ||
403 | 10. Firewall | |
404 | ||
405 | By default, you cannot access your server via public IP. To do so, you must configure firewall: | |
406 | ||
407 | - Ports used by peertube dev setup: | |
408 | ``` | |
409 | sudo firewall-cmd --permanent --zone=public --add-port=3000/tcp | |
410 | sudo firewall-cmd --permanent --zone=public --add-port=9000/tcp | |
411 | ``` | |
412 | - Optional | |
413 | ||
414 | ``` | |
0a314a99 | 415 | sudo firewall-cmd --permanent --zone=public --add-service=http |
416 | sudo firewall-cmd --permanent --zone=public --add-service=https | |
644800ef FS |
417 | ``` |
418 | ||
419 | - Reload firewall | |
420 | ||
421 | ``` | |
0a314a99 | 422 | sudo firewall-cmd --reload |
423 | ``` | |
0a314a99 | 424 | |
8182a370 | 425 | 11. Configure max ports |
ab87af11 | 426 | |
f309a156 | 427 | This is necessary if you are running dev setup, otherwise you will have errors with `nodemon` |
ab87af11 | 428 | |
0a314a99 | 429 | ``` |
430 | echo fs.inotify.max_user_watches=582222 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p | |
431 | ``` | |
ab87af11 | 432 | |
0a314a99 | 433 | [More info](https://stackoverflow.com/questions/34662574/node-js-getting-error-nodemon-internal-watch-failed-watch-enospc#34664097) |
434 | ||
644800ef | 435 | |
4c86a254 GN |
436 | ## FreeBSD |
437 | ||
438 | On a fresh install of [FreeBSD](https://www.freebsd.org), new system or new jail: | |
439 | ||
f309a156 | 440 | 1. bootstrap pkg, initialize db and install peertube's dependencies, always as root (sudo not yet installed): |
ab87af11 | 441 | |
4c86a254 | 442 | ``` |
ab87af11 DK |
443 | pkg |
444 | pkg update | |
f6160062 | 445 | pkg install -y sudo bash wget git python nginx pkgconf postgresql13-server postgresql13-contrib redis openssl node npm yarn ffmpeg unzip |
4c86a254 GN |
446 | ``` |
447 | ||
f309a156 | 448 | 2. Allow users in the wheel group (hope you don't forgot to add your user on wheel group!) to use sudo. |
ab87af11 | 449 | |
4c86a254 GN |
450 | ``` |
451 | # visudo | |
452 | ``` | |
453 | ||
ab87af11 | 454 | Uncomment the line 90 |
f309a156 | 455 | |
4c86a254 GN |
456 | ``` |
457 | %wheel ALL=(ALL) ALL | |
458 | ``` | |
459 | ||
f309a156 | 460 | 3. Enable nginx, redis, postgresql services and initialize database. |
4c86a254 | 461 | |
4c86a254 | 462 | ``` |
ab87af11 DK |
463 | sysrc postgresql_enable="YES" |
464 | sysrc redis_enable="YES" | |
465 | sysrc nginx_enable="YES" | |
4c86a254 GN |
466 | ``` |
467 | ||
ab87af11 DK |
468 | Initialize database and start services |
469 | ||
4c86a254 | 470 | ``` |
ab87af11 DK |
471 | service postgresql initdb |
472 | service postgresql start | |
473 | service redis start | |
474 | service nginx start | |
4c86a254 GN |
475 | ``` |
476 | ||
2f7ac618 | 477 | ## macOS |
2f7ac618 | 478 | |
ab87af11 DK |
479 | 1. Add the packages: |
480 | ||
02d6226a AV |
481 | ```sh |
482 | brew install bash ffmpeg nginx postgresql openssl gcc make redis git yarn | |
ab87af11 | 483 | ``` |
02d6226a AV |
484 | |
485 | You may need to update your default version of bash. | |
486 | ||
487 | **How to change your default shell** | |
488 | ||
489 | ```sh | |
490 | which -a bash # Check where bash is installed | |
491 | bash --version # You need a version at least as recent as 4.0 | |
492 | sudo vim /etc/shells # Add in this file : /usr/local/bin/bash | |
493 | chsh -s /usr/local/bin/bash # To set the brew-installed bash as default bash | |
ab87af11 DK |
494 | ``` |
495 | ||
d35f3a86 | 496 | In a new shell, type `bash --version` to assert your changes took effect and |
02d6226a AV |
497 | correctly modified your default bash version. |
498 | ||
ab87af11 | 499 | 2. Run the services: |
2f7ac618 | 500 | |
02d6226a | 501 | ```sh |
ab87af11 DK |
502 | brew services run postgresql |
503 | brew services run redis | |
504 | ``` | |
396f224b | 505 | |
02d6226a | 506 | On macOS, the `postgresql` user can be `_postgres` instead of `postgres`. |
ddc7d3ec | 507 | If `sudo -u postgres createuser -P peertube` gives you an `unknown user: postgres` error, you can try `sudo -u _postgres createuser -U peertube`. |
02d6226a | 508 | |
396f224b HM |
509 | ## Gentoo |
510 | ||
ab87af11 DK |
511 | 1. Add this to ``/etc/portage/sets/peertube``: |
512 | ||
396f224b HM |
513 | ``` |
514 | net-libs/nodejs | |
515 | sys-apps/yarn | |
7a4fd56c | 516 | media-video/ffmpeg[x264] # Optionally add vorbis,vpx |
396f224b HM |
517 | dev-db/postgresql |
518 | dev-db/redis | |
519 | dev-vcs/git | |
520 | app-arch/unzip | |
8182a370 | 521 | dev-lang/python |
a232d3e5 | 522 | dev-lang/python-exec |
396f224b | 523 | www-servers/nginx |
396f224b | 524 | |
ab87af11 | 525 | # Optional, client for Let’s Encrypt: |
396f224b | 526 | # app-crypt/certbot |
396f224b HM |
527 | ``` |
528 | ||
ab87af11 DK |
529 | 2. If you are on a "stable" Gentoo you need to accept the testing keyword ~amd64 yarn: |
530 | ||
bfc6bb94 W |
531 | ``` |
532 | mkdir -p /etc/portage/package.keywords | |
533 | cat << EOF >> /etc/portage/package.keywords/peertube | |
534 | # required by yarn (argument) for PeerTube | |
535 | sys-apps/yarn ~amd64 | |
536 | EOF | |
537 | ``` | |
538 | ||
ab87af11 DK |
539 | 3. Compile the peertube set: |
540 | ||
396f224b HM |
541 | ``` |
542 | emerge -a @peertube | |
543 | ``` | |
544 | ||
ab87af11 DK |
545 | 4. Initialize the PostgreSQL database if you just merged it: |
546 | ||
396f224b HM |
547 | ``` |
548 | emerge --config postgresql | |
549 | ``` | |
550 | ||
ab87af11 DK |
551 | 5. (For OpenRC) Enable and then start the services (replace with the correct PostgreSQL slot): |
552 | ||
396f224b HM |
553 | ``` |
554 | rc-update add redis | |
c1109b45 | 555 | rc-update add postgresql-11 |
396f224b | 556 | rc-service redis start |
c1109b45 | 557 | rc-service postgresql-11 start |
396f224b | 558 | ``` |
f309a156 | 559 | |
32e06ca4 | 560 | 6. Create Python version symlink for youtube-dl: |
561 | ||
562 | ``` | |
a232d3e5 | 563 | emerge -1 python-exec |
32e06ca4 | 564 | ``` |
565 | ||
80428d16 G |
566 | ## OpenBSD |
567 | ||
568 | 1. Install Packages: | |
569 | ||
570 | ``` | |
571 | pkg_add sudo bash wget git python nginx pkgconf postgresql-server postgresql-contrib redis openssl | |
572 | ``` | |
573 | ||
574 | 2. Install yarn: | |
575 | ||
576 | ``` | |
577 | npm install --global yarn | |
578 | ``` | |
579 | ||
580 | 3. Allow users in the wheel group to use sudo | |
581 | ||
582 | ``` | |
583 | visudo | |
584 | ``` | |
585 | Uncomment line #43: | |
586 | ||
587 | ``` | |
588 | %wheel ALL=(ALL) ALL | |
589 | ``` | |
590 | ||
591 | 4. Enable services: | |
592 | ||
593 | ``` | |
594 | rcctl enable postgresql redis nginx | |
595 | ``` | |
596 | ||
afe81767 | 597 | ## Other distributions |
63bfad7e C |
598 | |
599 | Feel free to update this file in a pull request! |