3 :warning: **Warning**: dependencies guide is maintained by the community. Some parts may be outdated! :warning:
5 Main dependencies version supported by PeerTube:
10 * `redis-server` >=5.x
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.
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 -->
19 - [Debian / Ubuntu and derivatives](#debian-ubuntu-and-derivatives)
20 - [Arch Linux](#arch-linux)
21 - [CentOS 7](#centos-7)
22 - [Centos 8](#centos-8)
23 - [Rocky Linux 8.4](#rocky-linux-84)
25 - [Red Hat Enterprise Linux 8](#red-hat-enterprise-linux-8)
30 - [Other distributions](#other-distributions)
32 <!-- END doctoc generated TOC please keep comment here to allow auto update -->
34 ## Debian / Ubuntu and derivatives
36 1. On a fresh Debian/Ubuntu, as root user, install basic utility programs needed for the installation
39 # apt-get install curl sudo unzip vim
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).
44 3. Install NodeJS 16.x:
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)
46 4. Install yarn, and be sure to have [a recent version](https://github.com/yarnpkg/yarn/releases/latest):
47 [https://yarnpkg.com/en/docs/install#linux-tab](https://yarnpkg.com/en/docs/install#linux-tab)
51 On Ubuntu <= bionic (18.04 LTS) or Debian <= Buster:
55 sudo apt install python-dev
56 python --version # Should be >= 2.x or >= 3.x
59 On Ubuntu >= focal (20.04 LTS) or Debian >= Bullseye:
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
67 6. Install common dependencies:
71 sudo apt install certbot nginx ffmpeg postgresql postgresql-contrib openssl g++ make redis-server git cron wget
72 ffmpeg -version # Should be >= 4.1
73 g++ -v # Should be >= 5.x
74 redis-server --version # Should be >= 5.x
77 Now that dependencies are installed, before running PeerTube you should start PostgreSQL and Redis:
80 sudo systemctl start redis postgresql
88 sudo pacman -S nodejs-lts-fermium yarn ffmpeg postgresql openssl redis git wget unzip python base-devel npm nginx
91 Now that dependencies are installed, before running PeerTube you should start PostgreSQL and Redis:
94 sudo systemctl start redis postgresql
99 1. Install NodeJS 16.x:
100 [https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora](https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora)
103 [https://yarnpkg.com/en/docs/install](https://yarnpkg.com/en/docs/install)
105 3. Install or compile ffmpeg:
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)
114 sudo yum install epel-release centos-release-scl
116 sudo yum install nginx postgresql postgresql-server postgresql-contrib openssl gcc-c++ make wget redis git devtoolset-7
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.
122 sudo scl enable devtoolset-7 bash
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:
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
131 6. Initialize the PostgreSQL database:
134 sudo PGSETUP_INITDB_OPTIONS='--auth-host=md5' postgresql-setup --initdb --unit postgresql
137 Now that dependencies are installed, before running PeerTube you should enable and start PostgreSQL and Redis:
140 sudo systemctl enable --now redis
141 sudo systemctl enable --now postgresql
146 1. Install NodeJS 16.x:
147 [https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora](https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora)
150 [https://yarnpkg.com/en/docs/install](https://yarnpkg.com/en/docs/install)
152 3. Install or compile ffmpeg:
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
165 sudo dnf install epel-release
167 sudo dnf install nginx postgresql postgresql-server postgresql-contrib openssl gcc-c++ make wget redis git unzip
170 5. You'll need a symlink for python3 to python for youtube-dl to work
173 sudo ln -s /usr/bin/python3 /usr/bin/python
176 6. Initialize the PostgreSQL database:
179 sudo PGSETUP_INITDB_OPTIONS='--auth-host=md5' postgresql-setup --initdb --unit postgresql
182 Now that dependencies are installed, before running PeerTube you should enable and start PostgreSQL and Redis:
185 sudo systemctl enable --now redis
186 sudo systemctl enable --now postgresql
191 1. Pull the latest updates:
196 2. Install NodeJS 16.x:
198 sudo dnf module install -y nodejs:16
203 sudo npm install --global yarn
206 4. Install or compile ffmpeg (if you want to compile... enjoy):
208 sudo dnf install -y epel-release
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
215 5. Install PostgreSQL and Python3 and other stuff:
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
224 6. Configure the peertube user:
226 sudo useradd -m -d /var/www/peertube -s /bin/bash -p peertube peertube
229 7. Unknown missing steps:
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?
237 1. Upgrade your packages:
243 2. Add a user with sudoers group access:
246 useradd my-peertube-user
247 passwd my-peertube-user
248 usermod my-peertube-user -a -G wheel # Add my-peertube-user to sudoers
252 3. (Optional) Install certbot (choose instructions for your distribution):
253 [https://certbot.eff.org/all-instructions](https://certbot.eff.org/all-instructions)
255 4. Install NodeJS 16.x:
256 [https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora](https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora)
259 [https://yarnpkg.com/en/docs/install](https://yarnpkg.com/en/docs/install)
261 6. Enable [RPM Fusion](https://rpmfusion.org) for Fedora (available for x86, x86_64, armhfp)
264 sudo dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm
266 This is necessary because `ffmpeg` is not in the Fedora repos.
271 sudo dnf install nginx ffmpeg postgresql-server postgresql-contrib openssl gcc-c++ make redis git vim
272 ffmpeg -version # Should be >= 4.1
273 g++ -v # Should be >= 5.x
274 redis-server --version # Should be >= 5.x
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
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.
292 sudo PGSETUP_INITDB_OPTIONS='--auth-host=md5' postgresql-setup --initdb --unit postgresql
293 sudo systemctl enable postgresql.service
294 sudo systemctl start postgresql.service
296 sudo systemctl enable nginx.service
297 sudo systemctl start nginx.service
299 sudo systemctl enable redis.service
300 sudo systemctl start redis.service
305 By default, you cannot access your server via public IP. To do so, you must configure firewall:
307 - Ports used by peertube dev setup:
309 sudo firewall-cmd --permanent --zone=public --add-port=3000/tcp
310 sudo firewall-cmd --permanent --zone=public --add-port=9000/tcp
315 sudo firewall-cmd --permanent --zone=public --add-service=http
316 sudo firewall-cmd --permanent --zone=public --add-service=https
322 sudo firewall-cmd --reload
325 11. Configure max ports
327 This is necessary if you are running dev setup, otherwise you will have errors with `nodemon`
330 echo fs.inotify.max_user_watches=582222 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
333 [More info](https://stackoverflow.com/questions/34662574/node-js-getting-error-nodemon-internal-watch-failed-watch-enospc#34664097)
335 ## Red Hat Enterprise Linux 8
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).
340 # subscription-manager register --username <username> --password <password> --auto-attach
348 sudo dnf module install nodejs:16
354 curl --silent --location https://dl.yarnpkg.com/rpm/yarn.repo | sudo tee /etc/yum.repos.d/yarn.repo
355 sudo dnf install yarn
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
365 sudo dnf install ffmpeg
371 sudo dnf install nginx postgresql postgresql-server postgresql-contrib openssl gcc-c++ make wget redis git
374 6. You'll need a symlink for python3 to python for youtube-dl to work
377 sudo alternatives --set python3 /usr/bin/python
380 7. Initialize the PostgreSQL database:
383 sudo PGSETUP_INITDB_OPTIONS='--auth-host=md5' postgresql-setup --initdb --unit postgresql
386 Now that dependencies are installed, before running PeerTube you should enable and start PostgreSQL and Redis:
389 sudo systemctl enable --now redis
390 sudo systemctl enable --now postgresql
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:
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
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.
411 sudo useradd -m -d /var/www/peertube -s /bin/bash -p peertube peertube
414 sudo chmod 755 /var/www/peertube/
419 By default, you cannot access your server via public IP. To do so, you must configure firewall:
421 - Ports used by peertube dev setup:
423 sudo firewall-cmd --permanent --zone=public --add-port=3000/tcp
424 sudo firewall-cmd --permanent --zone=public --add-port=9000/tcp
429 sudo firewall-cmd --permanent --zone=public --add-service=http
430 sudo firewall-cmd --permanent --zone=public --add-service=https
436 sudo firewall-cmd --reload
439 11. Configure max ports
441 This is necessary if you are running dev setup, otherwise you will have errors with `nodemon`
444 echo fs.inotify.max_user_watches=582222 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
447 [More info](https://stackoverflow.com/questions/34662574/node-js-getting-error-nodemon-internal-watch-failed-watch-enospc#34664097)
452 On a fresh install of [FreeBSD](https://www.freebsd.org), new system or new jail:
454 1. bootstrap pkg, initialize db and install peertube's dependencies, always as root (sudo not yet installed):
459 pkg install -y sudo bash wget git python nginx pkgconf postgresql13-server postgresql13-contrib redis openssl node npm yarn ffmpeg unzip
462 2. Allow users in the wheel group (hope you don't forgot to add your user on wheel group!) to use sudo.
468 Uncomment the line 90
474 3. Enable nginx, redis, postgresql services and initialize database.
477 sysrc postgresql_enable="YES"
478 sysrc redis_enable="YES"
479 sysrc nginx_enable="YES"
482 Initialize database and start services
485 service postgresql initdb
486 service postgresql start
496 brew install bash ffmpeg nginx postgresql openssl gcc make redis git yarn
499 You may need to update your default version of bash.
501 **How to change your default shell**
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
510 In a new shell, type `bash --version` to assert your changes took effect and
511 correctly modified your default bash version.
516 brew services run postgresql
517 brew services run redis
520 On macOS, the `postgresql` user can be `_postgres` instead of `postgres`.
521 If `sudo -u postgres createuser -P peertube` gives you an `unknown user: postgres` error, you can try `sudo -u _postgres createuser -U peertube`.
525 1. Add this to ``/etc/portage/sets/peertube``:
530 media-video/ffmpeg[x264] # Optionally add vorbis,vpx
539 # Optional, client for Let’s Encrypt:
543 2. If you are on a "stable" Gentoo you need to accept the testing keyword ~amd64 yarn:
546 mkdir -p /etc/portage/package.keywords
547 cat << EOF >> /etc/portage/package.keywords/peertube
548 # required by yarn (argument) for PeerTube
553 3. Compile the peertube set:
559 4. Initialize the PostgreSQL database if you just merged it:
562 emerge --config postgresql
565 5. (For OpenRC) Enable and then start the services (replace with the correct PostgreSQL slot):
569 rc-update add postgresql-11
570 rc-service redis start
571 rc-service postgresql-11 start
574 6. Create Python version symlink for youtube-dl:
577 emerge -1 python-exec
585 pkg_add sudo bash wget git python nginx pkgconf postgresql-server postgresql-contrib redis openssl
591 npm install --global yarn
594 3. Allow users in the wheel group to use sudo
608 rcctl enable postgresql redis nginx
611 ## Other distributions
613 Feel free to update this file in a pull request!