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:
146 * Install - [https://linuxize.com/post/how-to-install-ffmpeg-on-centos-8/](https://linuxize.com/post/how-to-install-ffmpeg-on-centos-8/)
152 sudo dnf install epel-release
154 sudo dnf install nginx postgresql postgresql-server postgresql-contrib openssl gcc-c++ make wget redis git
157 5. You'll need a symlink for python3 to python for youtube-dl to work
160 sudo ln -s /usr/bin/python3 /usr/bin/python
163 6. Initialize the PostgreSQL database:
166 sudo PGSETUP_INITDB_OPTIONS='--auth-host=md5' postgresql-setup --initdb --unit postgresql
169 Now that dependencies are installed, before running PeerTube you should enable and start PostgreSQL and Redis:
172 sudo systemctl enable --now redis
173 sudo systemctl enable --now postgresql
178 1. Pull the latest updates:
183 2. Install NodeJS 14.x:
185 sudo dnf module install -y nodejs:14
190 sudo npm install --global yarn
193 4. Install or compile ffmpeg (if you want to compile... enjoy):
195 sudo dnf install -y epel-release
196 sudo dnf --enablerepo=powertools install -y SDL2 SDL2-devel
197 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
198 sudo dnf install -y ffmpeg
202 5. Install PostgreSQL and Python3 and other stuff:
204 sudo dnf install -y nginx postgresql postgresql-server postgresql-contrib openssl gcc-c++ make wget redis git python3
205 sudo ln -s /usr/bin/python3 /usr/bin/python
206 sudo PGSETUP_INITDB_OPTIONS='--auth-host=md5' postgresql-setup --initdb --unit postgresql
207 sudo systemctl enable --now redis
208 sudo systemctl enable --now postgresql
211 6. Configure the peertube user:
213 sudo useradd -m -d /var/www/peertube -s /bin/bash -p peertube peertube
216 7. Unknown missing steps:
217 - Steps missing here... these were adapted from the CentOS 8 steps which abruptly ended.
218 - /var/www/peertube does not exist yet (expected? done in future steps? documentation?).
219 - Nothing about Certbot, NGINX, Firewall settings, and etc.
220 - Hopefully someone can suggest what is missing here with some hints so I can add it?
224 1. Upgrade your packages:
230 2. Add a user with sudoers group access:
233 useradd my-peertube-user
234 passwd my-peertube-user
235 usermod my-peertube-user -a -G wheel # Add my-peertube-user to sudoers
239 3. (Optional) Install certbot (choose instructions for your distribution):
240 [https://certbot.eff.org/all-instructions](https://certbot.eff.org/all-instructions)
242 4. Install NodeJS 14.x:
243 [https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora](https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora)
246 [https://yarnpkg.com/en/docs/install](https://yarnpkg.com/en/docs/install)
248 6. Enable [RPM Fusion](https://rpmfusion.org) for Fedora (available for x86, x86_64, armhfp)
251 sudo dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm
253 This is necessary because `ffmpeg` is not in the Fedora repos.
258 sudo dnf install nginx ffmpeg postgresql-server postgresql-contrib openssl gcc-c++ make redis git vim
259 ffmpeg -version # Should be >= 4.1
260 g++ -v # Should be >= 5.x
266 sudo mkdir /etc/nginx/sites-available
267 sudo mkdir /etc/nginx/sites-enabled
268 sudo ln -s /etc/nginx/sites-enabled/peertube /etc/nginx/conf.d/peertube.conf
273 _from [PostgreSQL documentation](https://www.postgresql.org/download/linux/redhat/):_
274 > Due to policies for Red Hat family distributions, the PostgreSQL installation will not be enabled for automatic start or have the database initialized automatically.
278 sudo PGSETUP_INITDB_OPTIONS='--auth-host=md5' postgresql-setup --initdb --unit postgresql
279 sudo systemctl enable postgresql.service
280 sudo systemctl start postgresql.service
282 sudo systemctl enable nginx.service
283 sudo systemctl start nginx.service
285 sudo systemctl enable redis.service
286 sudo systemctl start redis.service
291 By default, you cannot access your server via public IP. To do so, you must configure firewall:
293 - Ports used by peertube dev setup:
295 sudo firewall-cmd --permanent --zone=public --add-port=3000/tcp
296 sudo firewall-cmd --permanent --zone=public --add-port=9000/tcp
301 sudo firewall-cmd --permanent --zone=public --add-service=http
302 sudo firewall-cmd --permanent --zone=public --add-service=https
308 sudo firewall-cmd --reload
311 11. Configure max ports
313 This is necessary if you are running dev setup, otherwise you will have errors with `nodemon`
316 echo fs.inotify.max_user_watches=582222 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
319 [More info](https://stackoverflow.com/questions/34662574/node-js-getting-error-nodemon-internal-watch-failed-watch-enospc#34664097)
321 ## Red Hat Enterprise Linux 8
323 1. Register system as root user to Red Hat Subscription Management (create a free Red Hat account if you don't have one yet).
326 # subscription-manager register --username <username> --password <password> --auto-attach
334 sudo dnf module install nodejs:14
340 curl --silent --location https://dl.yarnpkg.com/rpm/yarn.repo | sudo tee /etc/yum.repos.d/yarn.repo
341 sudo dnf install yarn
347 sudo subscription-manager repos --enable "codeready-builder-for-rhel-8-$(arch)-rpms"
348 sudo dnf install --nogpgcheck https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
349 sudo dnf install --nogpgcheck https://mirrors.rpmfusion.org/free/el/rpmfusion-free-release-8.noarch.rpm
351 sudo dnf install ffmpeg
357 sudo dnf install nginx postgresql postgresql-server postgresql-contrib openssl gcc-c++ make wget redis git
360 6. You'll need a symlink for python3 to python for youtube-dl to work
363 sudo alternatives --set python3 /usr/bin/python
366 7. Initialize the PostgreSQL database:
369 sudo PGSETUP_INITDB_OPTIONS='--auth-host=md5' postgresql-setup --initdb --unit postgresql
372 Now that dependencies are installed, before running PeerTube you should enable and start PostgreSQL and Redis:
375 sudo systemctl enable --now redis
376 sudo systemctl enable --now postgresql
379 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:
384 sudo mkdir /etc/nginx/sites-available
385 sudo mkdir /etc/nginx/sites-enabled
386 sudo ln -s /etc/nginx/sites-enabled/peertube /etc/nginx/conf.d/peertube.conf
387 sudo systemctl enable --now nginx
392 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.
397 sudo useradd -m -d /var/www/peertube -s /bin/bash -p peertube peertube
400 sudo chmod 755 /var/www/peertube/
405 By default, you cannot access your server via public IP. To do so, you must configure firewall:
407 - Ports used by peertube dev setup:
409 sudo firewall-cmd --permanent --zone=public --add-port=3000/tcp
410 sudo firewall-cmd --permanent --zone=public --add-port=9000/tcp
415 sudo firewall-cmd --permanent --zone=public --add-service=http
416 sudo firewall-cmd --permanent --zone=public --add-service=https
422 sudo firewall-cmd --reload
425 11. Configure max ports
427 This is necessary if you are running dev setup, otherwise you will have errors with `nodemon`
430 echo fs.inotify.max_user_watches=582222 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
433 [More info](https://stackoverflow.com/questions/34662574/node-js-getting-error-nodemon-internal-watch-failed-watch-enospc#34664097)
438 On a fresh install of [FreeBSD](https://www.freebsd.org), new system or new jail:
440 1. bootstrap pkg, initialize db and install peertube's dependencies, always as root (sudo not yet installed):
445 pkg install -y sudo bash wget git python nginx pkgconf postgresql13-server postgresql13-contrib redis openssl node npm yarn ffmpeg unzip
448 2. Allow users in the wheel group (hope you don't forgot to add your user on wheel group!) to use sudo.
454 Uncomment the line 90
460 3. Enable nginx, redis, postgresql services and initialize database.
463 sysrc postgresql_enable="YES"
464 sysrc redis_enable="YES"
465 sysrc nginx_enable="YES"
468 Initialize database and start services
471 service postgresql initdb
472 service postgresql start
482 brew install bash ffmpeg nginx postgresql openssl gcc make redis git yarn
485 You may need to update your default version of bash.
487 **How to change your default shell**
490 which -a bash # Check where bash is installed
491 bash --version # You need a version at least as recent as 4.0
492 sudo vim /etc/shells # Add in this file : /usr/local/bin/bash
493 chsh -s /usr/local/bin/bash # To set the brew-installed bash as default bash
496 In a new shell, type `bash --version` to assert your changes took effect and
497 correctly modified your default bash version.
502 brew services run postgresql
503 brew services run redis
506 On macOS, the `postgresql` user can be `_postgres` instead of `postgres`.
507 If `sudo -u postgres createuser -P peertube` gives you an `unknown user: postgres` error, you can try `sudo -u _postgres createuser -U peertube`.
511 1. Add this to ``/etc/portage/sets/peertube``:
516 media-video/ffmpeg[x264] # Optionally add vorbis,vpx
525 # Optional, client for Let’s Encrypt:
529 2. If you are on a "stable" Gentoo you need to accept the testing keyword ~amd64 yarn:
532 mkdir -p /etc/portage/package.keywords
533 cat << EOF >> /etc/portage/package.keywords/peertube
534 # required by yarn (argument) for PeerTube
539 3. Compile the peertube set:
545 4. Initialize the PostgreSQL database if you just merged it:
548 emerge --config postgresql
551 5. (For OpenRC) Enable and then start the services (replace with the correct PostgreSQL slot):
555 rc-update add postgresql-11
556 rc-service redis start
557 rc-service postgresql-11 start
560 6. Create Python version symlink for youtube-dl:
563 emerge -1 python-exec
571 pkg_add sudo bash wget git python nginx pkgconf postgresql-server postgresql-contrib redis openssl
577 npm install --global yarn
580 3. Allow users in the wheel group to use sudo
594 rcctl enable postgresql redis nginx
597 ## Other distributions
599 Feel free to update this file in a pull request!