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