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