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).
7 Main dependencies version supported by PeerTube:
12 * `redis-server` >=5.x
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.
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 -->
21 - [Debian / Ubuntu and derivatives](#debian-ubuntu-and-derivatives)
22 - [Arch Linux](#arch-linux)
23 - [CentOS 7](#centos-7)
24 - [Centos 8](#centos-8)
25 - [Rocky Linux 8.4](#rocky-linux-84)
27 - [Red Hat Enterprise Linux 8](#red-hat-enterprise-linux-8)
32 - [Other distributions](#other-distributions)
34 <!-- END doctoc generated TOC please keep comment here to allow auto update -->
36 ## Debian / Ubuntu and derivatives
38 1. On a fresh Debian/Ubuntu, as root user, install basic utility programs needed for the installation
41 # apt-get install curl sudo unzip vim
44 2. It would be wise to disable root access and to continue this tutorial with a user with sudoers group access
46 3. Install NodeJS 16.x:
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)
48 4. Install yarn, and be sure to have [a recent version](https://github.com/yarnpkg/yarn/releases/latest):
49 [https://yarnpkg.com/en/docs/install#linux-tab](https://yarnpkg.com/en/docs/install#linux-tab)
53 On Ubuntu <= bionic (18.04 LTS) or Debian <= Buster:
57 sudo apt install python-dev
58 python --version # Should be >= 2.x or >= 3.x
61 On Ubuntu >= focal (20.04 LTS) or Debian >= Bullseye:
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
69 6. Install common dependencies:
73 sudo apt install certbot nginx ffmpeg postgresql postgresql-contrib openssl g++ make redis-server git cron wget
74 ffmpeg -version # Should be >= 4.1
75 g++ -v # Should be >= 5.x
76 redis-server --version # Should be >= 5.x
79 Now that dependencies are installed, before running PeerTube you should start PostgreSQL and Redis:
82 sudo systemctl start redis postgresql
90 sudo pacman -S nodejs-lts-fermium yarn ffmpeg postgresql openssl redis git wget unzip python base-devel npm nginx
93 Now that dependencies are installed, before running PeerTube you should start PostgreSQL and Redis:
96 sudo systemctl start redis postgresql
101 1. Install NodeJS 16.x:
102 [https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora](https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora)
105 [https://yarnpkg.com/en/docs/install](https://yarnpkg.com/en/docs/install)
107 3. Install or compile ffmpeg:
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)
116 sudo yum install epel-release centos-release-scl
118 sudo yum install nginx postgresql postgresql-server postgresql-contrib openssl gcc-c++ make wget redis git devtoolset-7
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.
124 sudo scl enable devtoolset-7 bash
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:
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
133 6. Initialize the PostgreSQL database:
136 sudo PGSETUP_INITDB_OPTIONS='--auth-host=md5' postgresql-setup --initdb --unit postgresql
139 Now that dependencies are installed, before running PeerTube you should enable and start PostgreSQL and Redis:
142 sudo systemctl enable --now redis
143 sudo systemctl enable --now postgresql
148 1. Install NodeJS 16.x:
149 [https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora](https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora)
152 [https://yarnpkg.com/en/docs/install](https://yarnpkg.com/en/docs/install)
154 3. Install or compile ffmpeg:
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
167 sudo dnf install epel-release
169 sudo dnf install nginx postgresql postgresql-server postgresql-contrib openssl gcc-c++ make wget redis git unzip
172 5. You'll need a symlink for python3 to python for youtube-dl to work
175 sudo ln -s /usr/bin/python3 /usr/bin/python
178 6. Initialize the PostgreSQL database:
181 sudo PGSETUP_INITDB_OPTIONS='--auth-host=md5' postgresql-setup --initdb --unit postgresql
184 Now that dependencies are installed, before running PeerTube you should enable and start PostgreSQL and Redis:
187 sudo systemctl enable --now redis
188 sudo systemctl enable --now postgresql
193 1. Pull the latest updates:
198 2. Install NodeJS 16.x:
200 sudo dnf module install -y nodejs:16
205 sudo npm install --global yarn
208 4. Install or compile ffmpeg (if you want to compile... enjoy):
210 sudo dnf install -y epel-release
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
217 5. Install PostgreSQL and Python3 and other stuff:
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
226 6. Configure the peertube user:
228 sudo useradd -m -d /var/www/peertube -s /bin/bash -p peertube peertube
231 7. Unknown missing steps:
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?
239 1. Upgrade your packages:
245 2. Add a user with sudoers group access:
248 useradd my-peertube-user
249 passwd my-peertube-user
250 usermod my-peertube-user -a -G wheel # Add my-peertube-user to sudoers
254 3. (Optional) Install certbot (choose instructions for your distribution):
255 [https://certbot.eff.org/all-instructions](https://certbot.eff.org/all-instructions)
257 4. Install NodeJS 16.x:
258 [https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora](https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora)
261 [https://yarnpkg.com/en/docs/install](https://yarnpkg.com/en/docs/install)
263 6. Enable [RPM Fusion](https://rpmfusion.org) for Fedora (available for x86, x86_64, armhfp)
266 sudo dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm
268 This is necessary because `ffmpeg` is not in the Fedora repos.
273 sudo dnf install nginx ffmpeg postgresql-server postgresql-contrib openssl gcc-c++ make redis git vim
274 ffmpeg -version # Should be >= 4.1
275 g++ -v # Should be >= 5.x
276 redis-server --version # Should be >= 5.x
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
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.
294 sudo PGSETUP_INITDB_OPTIONS='--auth-host=md5' postgresql-setup --initdb --unit postgresql
295 sudo systemctl enable postgresql.service
296 sudo systemctl start postgresql.service
298 sudo systemctl enable nginx.service
299 sudo systemctl start nginx.service
301 sudo systemctl enable redis.service
302 sudo systemctl start redis.service
307 By default, you cannot access your server via public IP. To do so, you must configure firewall:
309 - Ports used by peertube dev setup:
311 sudo firewall-cmd --permanent --zone=public --add-port=3000/tcp
312 sudo firewall-cmd --permanent --zone=public --add-port=9000/tcp
317 sudo firewall-cmd --permanent --zone=public --add-service=http
318 sudo firewall-cmd --permanent --zone=public --add-service=https
324 sudo firewall-cmd --reload
327 11. Configure max ports
329 This is necessary if you are running dev setup, otherwise you will have errors with `nodemon`
332 echo fs.inotify.max_user_watches=582222 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
335 [More info](https://stackoverflow.com/questions/34662574/node-js-getting-error-nodemon-internal-watch-failed-watch-enospc#34664097)
337 ## Red Hat Enterprise Linux 8
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).
342 # subscription-manager register --username <username> --password <password> --auto-attach
350 sudo dnf module install nodejs:16
356 curl --silent --location https://dl.yarnpkg.com/rpm/yarn.repo | sudo tee /etc/yum.repos.d/yarn.repo
357 sudo dnf install yarn
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
367 sudo dnf install ffmpeg
373 sudo dnf install nginx postgresql postgresql-server postgresql-contrib openssl gcc-c++ make wget redis git
376 6. You'll need a symlink for python3 to python for youtube-dl to work
379 sudo alternatives --set python3 /usr/bin/python
382 7. Initialize the PostgreSQL database:
385 sudo PGSETUP_INITDB_OPTIONS='--auth-host=md5' postgresql-setup --initdb --unit postgresql
388 Now that dependencies are installed, before running PeerTube you should enable and start PostgreSQL and Redis:
391 sudo systemctl enable --now redis
392 sudo systemctl enable --now postgresql
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:
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
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.
413 sudo useradd -m -d /var/www/peertube -s /bin/bash -p peertube peertube
416 sudo chmod 755 /var/www/peertube/
421 By default, you cannot access your server via public IP. To do so, you must configure firewall:
423 - Ports used by peertube dev setup:
425 sudo firewall-cmd --permanent --zone=public --add-port=3000/tcp
426 sudo firewall-cmd --permanent --zone=public --add-port=9000/tcp
431 sudo firewall-cmd --permanent --zone=public --add-service=http
432 sudo firewall-cmd --permanent --zone=public --add-service=https
438 sudo firewall-cmd --reload
441 11. Configure max ports
443 This is necessary if you are running dev setup, otherwise you will have errors with `nodemon`
446 echo fs.inotify.max_user_watches=582222 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
449 [More info](https://stackoverflow.com/questions/34662574/node-js-getting-error-nodemon-internal-watch-failed-watch-enospc#34664097)
454 On a fresh install of [FreeBSD](https://www.freebsd.org), new system or new jail:
456 1. bootstrap pkg, initialize db and install peertube's dependencies, always as root (sudo not yet installed):
461 pkg install -y sudo bash wget git python nginx pkgconf postgresql13-server postgresql13-contrib redis openssl node npm yarn ffmpeg unzip
464 2. Allow users in the wheel group (hope you don't forgot to add your user on wheel group!) to use sudo.
470 Uncomment the line 90
476 3. Enable nginx, redis, postgresql services and initialize database.
479 sysrc postgresql_enable="YES"
480 sysrc redis_enable="YES"
481 sysrc nginx_enable="YES"
484 Initialize database and start services
487 service postgresql initdb
488 service postgresql start
498 brew install bash ffmpeg nginx postgresql openssl gcc make redis git yarn
501 You may need to update your default version of bash.
503 **How to change your default shell**
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
512 In a new shell, type `bash --version` to assert your changes took effect and
513 correctly modified your default bash version.
518 brew services run postgresql
519 brew services run redis
522 On macOS, the `postgresql` user can be `_postgres` instead of `postgres`.
523 If `sudo -u postgres createuser -P peertube` gives you an `unknown user: postgres` error, you can try `sudo -u _postgres createuser -U peertube`.
527 1. Add this to ``/etc/portage/sets/peertube``:
532 media-video/ffmpeg[x264] # Optionally add vorbis,vpx
541 # Optional, client for Let’s Encrypt:
545 2. If you are on a "stable" Gentoo you need to accept the testing keyword ~amd64 yarn:
548 mkdir -p /etc/portage/package.keywords
549 cat << EOF >> /etc/portage/package.keywords/peertube
550 # required by yarn (argument) for PeerTube
555 3. Compile the peertube set:
561 4. Initialize the PostgreSQL database if you just merged it:
564 emerge --config postgresql
567 5. (For OpenRC) Enable and then start the services (replace with the correct PostgreSQL slot):
571 rc-update add postgresql-11
572 rc-service redis start
573 rc-service postgresql-11 start
576 6. Create Python version symlink for youtube-dl:
579 emerge -1 python-exec
587 pkg_add sudo bash wget git python nginx pkgconf postgresql-server postgresql-contrib redis openssl
593 npm install --global yarn
596 3. Allow users in the wheel group to use sudo
610 rcctl enable postgresql redis nginx
613 ## Other distributions
615 Feel free to update this file in a pull request!