3 Follow the below guides, and check their versions match [required external dependencies versions](https://github.com/Chocobozzz/PeerTube/blob/master/package.json#7). You can check them automatically via `sudo npx engineslist`.
5 <!-- START doctoc generated TOC please keep comment here to allow auto update -->
6 <!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
9 - [Debian / Ubuntu and derivatives](#debian--ubuntu-and-derivatives)
10 - [Arch Linux](#arch-linux)
11 - [CentOS 7](#centos-7)
16 - [Other distributions](#other-distributions)
18 <!-- END doctoc generated TOC please keep comment here to allow auto update -->
20 ## Debian / Ubuntu and derivatives
22 1. On a fresh Debian/Ubuntu, as root user, install basic utility programs needed for the installation
25 # apt-get install curl sudo unzip vim
28 2. It would be wise to disable root access and to continue this tutorial with a user with sudoers group access
30 3. Install certbot (choose instructions for nginx and your distribution) :
31 [https://certbot.eff.org/all-instructions](https://certbot.eff.org/all-instructions)
32 4. Install NodeJS 10.x:
33 [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)
34 5. Install yarn, and be sure to have [a recent version](https://github.com/yarnpkg/yarn/releases/latest):
35 [https://yarnpkg.com/en/docs/install#linux-tab](https://yarnpkg.com/en/docs/install#linux-tab)
41 sudo apt install nginx ffmpeg postgresql postgresql-contrib openssl g++ make redis-server git python-dev
42 ffmpeg -version # Should be >= 4.1
43 g++ -v # Should be >= 5.x
46 Now that dependencies are installed, before running PeerTube you should start PostgreSQL and Redis:
49 sudo systemctl start redis postgresql
57 sudo pacman -S nodejs-lts-dubnium yarn ffmpeg postgresql openssl redis git wget unzip python2 base-devel npm nginx
60 Now that dependencies are installed, before running PeerTube you should start PostgreSQL and Redis:
63 sudo systemctl start redis postgresql
68 1. Install NodeJS 10.x:
69 [https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora](https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora)
72 [https://yarnpkg.com/en/docs/install](https://yarnpkg.com/en/docs/install)
74 3. Install or compile ffmpeg:
76 * Install - [https://linoxide.com/linux-how-to/install-ffmpeg-centos-7/](https://linoxide.com/linux-how-to/install-ffmpeg-centos-7/)
77 * Compile - [https://gist.github.com/mustafaturan/7053900#file-latest-ffmpeg-centos6-sh](https://gist.github.com/mustafaturan/7053900#file-latest-ffmpeg-centos6-sh)
83 sudo yum install epel-release centos-release-scl
85 sudo yum install nginx postgresql postgresql-server postgresql-contrib openssl gcc-c++ make wget redis git devtoolset-7
88 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.
91 sudo scl enable devtoolset-7 bash
94 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:
97 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
100 6. Initialize the PostgreSQL database:
103 sudo postgresql-setup initdb
106 Now that dependencies are installed, before running PeerTube you should enable and start PostgreSQL and Redis:
109 sudo systemctl enable --now redis
110 sudo systemctl enable --now postgresql
115 1. Install NodeJS 10.x:
116 [https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora](https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora)
119 [https://yarnpkg.com/en/docs/install](https://yarnpkg.com/en/docs/install)
121 3. Install or compile ffmpeg:
123 * Install - [https://linuxize.com/post/how-to-install-ffmpeg-on-centos-8/](https://linuxize.com/post/how-to-install-ffmpeg-on-centos-8/)
129 sudo dnf install epel-release
131 sudo dnf install nginx postgresql postgresql-server postgresql-contrib openssl gcc-c++ make wget redis git
134 5. You'll need a symlink for python3 to python for youtube-dl to work
137 sudo ln -s /usr/bin/python3 /usr/bin/python
140 6. Initialize the PostgreSQL database:
143 sudo postgresql-setup initdb
146 Now that dependencies are installed, before running PeerTube you should enable and start PostgreSQL and Redis:
149 sudo systemctl enable --now redis
150 sudo systemctl enable --now postgresql
156 1. Upgrade your packages:
162 2. Add a user with sudoers group access:
165 useradd my-peertube-user
166 passwd my-peertube-user
167 usermod my-peertube-user -a -G wheel # Add my-peertube-user to sudoers
171 3. (Optional) Install certbot (choose instructions for nginx and your distribution):
172 [https://certbot.eff.org/all-instructions](https://certbot.eff.org/all-instructions)
174 4. Install NodeJS 10.x:
175 [https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora](https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora)
178 [https://yarnpkg.com/en/docs/install](https://yarnpkg.com/en/docs/install)
180 6. Enable [RPM Fusion](https://rpmfusion.org) for Fedora (available for x86, x86_64, armhfp)
183 sudo dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm
185 This is necessary because `ffmpeg` is not in the Fedora repos.
190 sudo dnf install nginx ffmpeg postgresql-server postgresql-contrib openssl gcc-c++ make redis git
191 ffmpeg -version # Should be >= 4.1
192 g++ -v # Should be >= 5.x
197 _from [PostgreSQL documentation](https://www.postgresql.org/download/linux/redhat/):_
198 > Due to policies for Red Hat family distributions, the PostgreSQL installation will not be enabled for automatic start or have the database initialized automatically.
202 sudo postgresql-setup initdb
203 sudo systemctl enable postgresql.service
204 sudo systemctl start postgresql.service
206 sudo systemctl enable nginx.service
207 sudo systemctl start nginx.service
209 sudo systemctl enable redis.service
210 sudo systemctl start redis.service
215 By default, you cannot access your server via public IP. To do so, you must configure firewall:
218 # Ports used by peertube dev setup
219 sudo firewall-cmd --permanent --zone=public --add-port=3000/tcp
220 sudo firewall-cmd --permanent --zone=public --add-port=9000/tcp
222 sudo firewall-cmd --permanent --zone=public --add-service=http
223 sudo firewall-cmd --permanent --zone=public --add-service=https
225 sudo firewall-cmd --reload
228 10. Configure max ports
230 This is necessary if you are running dev setup, otherwise you will have errors with `nodemon`
233 echo fs.inotify.max_user_watches=582222 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
236 [More info](https://stackoverflow.com/questions/34662574/node-js-getting-error-nodemon-internal-watch-failed-watch-enospc#34664097)
240 On a fresh install of [FreeBSD](https://www.freebsd.org), new system or new jail:
242 1. bootstrap pkg, initialize db and install peertube's dependencies, always as root (sudo not yet installed):
247 pkg install -y sudo bash wget git python nginx pkgconf vips postgresql96-server postgresql96-contrib redis openssl node npm yarn ffmpeg unzip
250 2. Allow users in the wheel group (hope you don't forgot to add your user on wheel group!) to use sudo.
256 Uncomment the line 90
262 3. Enable nginx, redis, postgresql services and initialize database.
265 sysrc postgresql_enable="YES"
266 sysrc redis_enable="YES"
267 sysrc nginx_enable="YES"
270 Initialize database and start services
273 service postgresql initdb
274 service postgresql start
284 brew install ffmpeg nginx postgresql openssl gcc make redis git yarn
290 brew services run postgresql
291 brew services run redis
296 1. Add this to ``/etc/portage/sets/peertube``:
301 media-video/ffmpeg[x264] # Optionnally add vorbis,vpx
309 # Optional, client for Let’s Encrypt:
311 # app-crypt/certbot-nginx
314 2. If you are on a "stable" Gentoo you need to accept the testing keyword ~amd64 yarn:
317 mkdir -p /etc/portage/package.keywords
318 cat << EOF >> /etc/portage/package.keywords/peertube
319 # required by yarn (argument) for PeerTube
324 3. Compile the peertube set:
330 4. Initialize the PostgreSQL database if you just merged it:
333 emerge --config postgresql
336 5. (For OpenRC) Enable and then start the services (replace with the correct PostgreSQL slot):
340 rc-update add postgresql-11
341 rc-service redis start
342 rc-service postgresql-11 start
345 ## Other distributions
347 Feel free to update this file in a pull request!