3 :warning: **Warning**: dependencies guide is maintained by the community. Some parts may be outdated! :warning:
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`.
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.
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 -->
12 - [Debian / Ubuntu and derivatives](#debian-ubuntu-and-derivatives)
13 - [Arch Linux](#arch-linux)
14 - [CentOS 7](#centos-7)
15 - [Centos 8](#centos-8)
16 - [Rocky Linux 8.4](#rocky-linux-84)
18 - [Red Hat Enterprise Linux 8](#red-hat-enterprise-linux-8)
23 - [Other distributions](#other-distributions)
25 <!-- END doctoc generated TOC please keep comment here to allow auto update -->
27 ## Debian / Ubuntu and derivatives
29 1. On a fresh Debian/Ubuntu, as root user, install basic utility programs needed for the installation
32 # apt-get install curl sudo unzip vim
35 2. It would be wise to disable root access and to continue this tutorial with a user with sudoers group access
37 3. Install NodeJS 14.x:
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)
39 4. Install yarn, and be sure to have [a recent version](https://github.com/yarnpkg/yarn/releases/latest):
40 [https://yarnpkg.com/en/docs/install#linux-tab](https://yarnpkg.com/en/docs/install#linux-tab)
44 On Ubuntu <= bionic (18.04 LTS) or Debian <= Buster:
48 sudo apt install python-dev
49 python --version # Should be >= 2.x or >= 3.x
52 On Ubuntu >= focal (20.04 LTS) or Debian >= Bullseye:
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
60 6. Install common dependencies:
64 sudo apt install certbot nginx ffmpeg postgresql postgresql-contrib openssl g++ make redis-server git cron wget
65 ffmpeg -version # Should be >= 4.1
66 g++ -v # Should be >= 5.x
69 Now that dependencies are installed, before running PeerTube you should start PostgreSQL and Redis:
72 sudo systemctl start redis postgresql
80 sudo pacman -S nodejs-lts-fermium yarn ffmpeg postgresql openssl redis git wget unzip python base-devel npm nginx
83 Now that dependencies are installed, before running PeerTube you should start PostgreSQL and Redis:
86 sudo systemctl start redis postgresql
91 1. Install NodeJS 14.x:
92 [https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora](https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora)
95 [https://yarnpkg.com/en/docs/install](https://yarnpkg.com/en/docs/install)
97 3. Install or compile ffmpeg:
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)
106 sudo yum install epel-release centos-release-scl
108 sudo yum install nginx postgresql postgresql-server postgresql-contrib openssl gcc-c++ make wget redis git devtoolset-7
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.
114 sudo scl enable devtoolset-7 bash
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:
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
123 6. Initialize the PostgreSQL database:
126 sudo PGSETUP_INITDB_OPTIONS='--auth-host=md5' postgresql-setup --initdb --unit postgresql
129 Now that dependencies are installed, before running PeerTube you should enable and start PostgreSQL and Redis:
132 sudo systemctl enable --now redis
133 sudo systemctl enable --now postgresql
138 1. Install NodeJS 14.x:
139 [https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora](https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora)
142 [https://yarnpkg.com/en/docs/install](https://yarnpkg.com/en/docs/install)
144 3. Install or compile ffmpeg:
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
157 sudo dnf install epel-release
159 sudo dnf install nginx postgresql postgresql-server postgresql-contrib openssl gcc-c++ make wget redis git unzip
162 5. You'll need a symlink for python3 to python for youtube-dl to work
165 sudo ln -s /usr/bin/python3 /usr/bin/python
168 6. Initialize the PostgreSQL database:
171 sudo PGSETUP_INITDB_OPTIONS='--auth-host=md5' postgresql-setup --initdb --unit postgresql
174 Now that dependencies are installed, before running PeerTube you should enable and start PostgreSQL and Redis:
177 sudo systemctl enable --now redis
178 sudo systemctl enable --now postgresql
183 1. Pull the latest updates:
188 2. Install NodeJS 14.x:
190 sudo dnf module install -y nodejs:14
195 sudo npm install --global yarn
198 4. Install or compile ffmpeg (if you want to compile... enjoy):
200 sudo dnf install -y epel-release
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
207 5. Install PostgreSQL and Python3 and other stuff:
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
216 6. Configure the peertube user:
218 sudo useradd -m -d /var/www/peertube -s /bin/bash -p peertube peertube
221 7. Unknown missing steps:
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?
229 1. Upgrade your packages:
235 2. Add a user with sudoers group access:
238 useradd my-peertube-user
239 passwd my-peertube-user
240 usermod my-peertube-user -a -G wheel # Add my-peertube-user to sudoers
244 3. (Optional) Install certbot (choose instructions for your distribution):
245 [https://certbot.eff.org/all-instructions](https://certbot.eff.org/all-instructions)
247 4. Install NodeJS 14.x:
248 [https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora](https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora)
251 [https://yarnpkg.com/en/docs/install](https://yarnpkg.com/en/docs/install)
253 6. Enable [RPM Fusion](https://rpmfusion.org) for Fedora (available for x86, x86_64, armhfp)
256 sudo dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm
258 This is necessary because `ffmpeg` is not in the Fedora repos.
263 sudo dnf install nginx ffmpeg postgresql-server postgresql-contrib openssl gcc-c++ make redis git vim
264 ffmpeg -version # Should be >= 4.1
265 g++ -v # Should be >= 5.x
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
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.
283 sudo PGSETUP_INITDB_OPTIONS='--auth-host=md5' postgresql-setup --initdb --unit postgresql
284 sudo systemctl enable postgresql.service
285 sudo systemctl start postgresql.service
287 sudo systemctl enable nginx.service
288 sudo systemctl start nginx.service
290 sudo systemctl enable redis.service
291 sudo systemctl start redis.service
296 By default, you cannot access your server via public IP. To do so, you must configure firewall:
298 - Ports used by peertube dev setup:
300 sudo firewall-cmd --permanent --zone=public --add-port=3000/tcp
301 sudo firewall-cmd --permanent --zone=public --add-port=9000/tcp
306 sudo firewall-cmd --permanent --zone=public --add-service=http
307 sudo firewall-cmd --permanent --zone=public --add-service=https
313 sudo firewall-cmd --reload
316 11. Configure max ports
318 This is necessary if you are running dev setup, otherwise you will have errors with `nodemon`
321 echo fs.inotify.max_user_watches=582222 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
324 [More info](https://stackoverflow.com/questions/34662574/node-js-getting-error-nodemon-internal-watch-failed-watch-enospc#34664097)
326 ## Red Hat Enterprise Linux 8
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).
331 # subscription-manager register --username <username> --password <password> --auto-attach
339 sudo dnf module install nodejs:14
345 curl --silent --location https://dl.yarnpkg.com/rpm/yarn.repo | sudo tee /etc/yum.repos.d/yarn.repo
346 sudo dnf install yarn
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
356 sudo dnf install ffmpeg
362 sudo dnf install nginx postgresql postgresql-server postgresql-contrib openssl gcc-c++ make wget redis git
365 6. You'll need a symlink for python3 to python for youtube-dl to work
368 sudo alternatives --set python3 /usr/bin/python
371 7. Initialize the PostgreSQL database:
374 sudo PGSETUP_INITDB_OPTIONS='--auth-host=md5' postgresql-setup --initdb --unit postgresql
377 Now that dependencies are installed, before running PeerTube you should enable and start PostgreSQL and Redis:
380 sudo systemctl enable --now redis
381 sudo systemctl enable --now postgresql
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:
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
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.
402 sudo useradd -m -d /var/www/peertube -s /bin/bash -p peertube peertube
405 sudo chmod 755 /var/www/peertube/
410 By default, you cannot access your server via public IP. To do so, you must configure firewall:
412 - Ports used by peertube dev setup:
414 sudo firewall-cmd --permanent --zone=public --add-port=3000/tcp
415 sudo firewall-cmd --permanent --zone=public --add-port=9000/tcp
420 sudo firewall-cmd --permanent --zone=public --add-service=http
421 sudo firewall-cmd --permanent --zone=public --add-service=https
427 sudo firewall-cmd --reload
430 11. Configure max ports
432 This is necessary if you are running dev setup, otherwise you will have errors with `nodemon`
435 echo fs.inotify.max_user_watches=582222 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
438 [More info](https://stackoverflow.com/questions/34662574/node-js-getting-error-nodemon-internal-watch-failed-watch-enospc#34664097)
443 On a fresh install of [FreeBSD](https://www.freebsd.org), new system or new jail:
445 1. bootstrap pkg, initialize db and install peertube's dependencies, always as root (sudo not yet installed):
450 pkg install -y sudo bash wget git python nginx pkgconf postgresql13-server postgresql13-contrib redis openssl node npm yarn ffmpeg unzip
453 2. Allow users in the wheel group (hope you don't forgot to add your user on wheel group!) to use sudo.
459 Uncomment the line 90
465 3. Enable nginx, redis, postgresql services and initialize database.
468 sysrc postgresql_enable="YES"
469 sysrc redis_enable="YES"
470 sysrc nginx_enable="YES"
473 Initialize database and start services
476 service postgresql initdb
477 service postgresql start
487 brew install bash ffmpeg nginx postgresql openssl gcc make redis git yarn
490 You may need to update your default version of bash.
492 **How to change your default shell**
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
501 In a new shell, type `bash --version` to assert your changes took effect and
502 correctly modified your default bash version.
507 brew services run postgresql
508 brew services run redis
511 On macOS, the `postgresql` user can be `_postgres` instead of `postgres`.
512 If `sudo -u postgres createuser -P peertube` gives you an `unknown user: postgres` error, you can try `sudo -u _postgres createuser -U peertube`.
516 1. Add this to ``/etc/portage/sets/peertube``:
521 media-video/ffmpeg[x264] # Optionally add vorbis,vpx
530 # Optional, client for Let’s Encrypt:
534 2. If you are on a "stable" Gentoo you need to accept the testing keyword ~amd64 yarn:
537 mkdir -p /etc/portage/package.keywords
538 cat << EOF >> /etc/portage/package.keywords/peertube
539 # required by yarn (argument) for PeerTube
544 3. Compile the peertube set:
550 4. Initialize the PostgreSQL database if you just merged it:
553 emerge --config postgresql
556 5. (For OpenRC) Enable and then start the services (replace with the correct PostgreSQL slot):
560 rc-update add postgresql-11
561 rc-service redis start
562 rc-service postgresql-11 start
565 6. Create Python version symlink for youtube-dl:
568 emerge -1 python-exec
576 pkg_add sudo bash wget git python nginx pkgconf postgresql-server postgresql-contrib redis openssl
582 npm install --global yarn
585 3. Allow users in the wheel group to use sudo
599 rcctl enable postgresql redis nginx
602 ## Other distributions
604 Feel free to update this file in a pull request!