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