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