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 _note_: only **LTS** versions of external dependencies are supported. If no LTS version matching the version constraint is available, only **release** versions are supported.
7 <!-- START doctoc generated TOC please keep comment here to allow auto update -->
8 <!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
11 - [Debian / Ubuntu and derivatives](#debian--ubuntu-and-derivatives)
12 - [Arch Linux](#arch-linux)
13 - [CentOS 7](#centos-7)
14 - [CentOS 8](#centos-8)
19 - [Other distributions](#other-distributions)
21 <!-- END doctoc generated TOC please keep comment here to allow auto update -->
23 ## Debian / Ubuntu and derivatives
25 1. On a fresh Debian/Ubuntu, as root user, install basic utility programs needed for the installation
28 # apt-get install curl sudo unzip vim
31 2. It would be wise to disable root access and to continue this tutorial with a user with sudoers group access
33 3. Install NodeJS 12.x:
34 [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)
35 4. Install yarn, and be sure to have [a recent version](https://github.com/yarnpkg/yarn/releases/latest):
36 [https://yarnpkg.com/en/docs/install#linux-tab](https://yarnpkg.com/en/docs/install#linux-tab)
42 sudo apt install certbot nginx ffmpeg postgresql postgresql-contrib openssl g++ make redis-server git python-dev cron wget
43 ffmpeg -version # Should be >= 4.1
44 g++ -v # Should be >= 5.x
47 Now that dependencies are installed, before running PeerTube you should start PostgreSQL and Redis:
50 sudo systemctl start redis postgresql
58 sudo pacman -S nodejs-lts-dubnium yarn ffmpeg postgresql openssl redis git wget unzip python2 base-devel npm nginx
61 Now that dependencies are installed, before running PeerTube you should start PostgreSQL and Redis:
64 sudo systemctl start redis postgresql
69 1. Install NodeJS 12.x:
70 [https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora](https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora)
73 [https://yarnpkg.com/en/docs/install](https://yarnpkg.com/en/docs/install)
75 3. Install or compile ffmpeg:
77 * Install - [https://linoxide.com/linux-how-to/install-ffmpeg-centos-7/](https://linoxide.com/linux-how-to/install-ffmpeg-centos-7/)
78 * Compile - [https://gist.github.com/mustafaturan/7053900#file-latest-ffmpeg-centos6-sh](https://gist.github.com/mustafaturan/7053900#file-latest-ffmpeg-centos6-sh)
84 sudo yum install epel-release centos-release-scl
86 sudo yum install nginx postgresql postgresql-server postgresql-contrib openssl gcc-c++ make wget redis git devtoolset-7
89 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.
92 sudo scl enable devtoolset-7 bash
95 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:
98 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
101 6. Initialize the PostgreSQL database:
104 sudo postgresql-setup initdb
107 Now that dependencies are installed, before running PeerTube you should enable and start PostgreSQL and Redis:
110 sudo systemctl enable --now redis
111 sudo systemctl enable --now postgresql
116 1. Install NodeJS 12.x:
117 [https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora](https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora)
120 [https://yarnpkg.com/en/docs/install](https://yarnpkg.com/en/docs/install)
122 3. Install or compile ffmpeg:
124 * Install - [https://linuxize.com/post/how-to-install-ffmpeg-on-centos-8/](https://linuxize.com/post/how-to-install-ffmpeg-on-centos-8/)
130 sudo dnf install epel-release
132 sudo dnf install nginx postgresql postgresql-server postgresql-contrib openssl gcc-c++ make wget redis git
135 5. You'll need a symlink for python3 to python for youtube-dl to work
138 sudo ln -s /usr/bin/python3 /usr/bin/python
141 6. Initialize the PostgreSQL database:
144 sudo postgresql-setup initdb
147 Now that dependencies are installed, before running PeerTube you should enable and start PostgreSQL and Redis:
150 sudo systemctl enable --now redis
151 sudo systemctl enable --now postgresql
157 1. Upgrade your packages:
163 2. Add a user with sudoers group access:
166 useradd my-peertube-user
167 passwd my-peertube-user
168 usermod my-peertube-user -a -G wheel # Add my-peertube-user to sudoers
172 3. (Optional) Install certbot (choose instructions for your distribution):
173 [https://certbot.eff.org/all-instructions](https://certbot.eff.org/all-instructions)
175 4. Install NodeJS 12.x:
176 [https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora](https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora)
179 [https://yarnpkg.com/en/docs/install](https://yarnpkg.com/en/docs/install)
181 6. Enable [RPM Fusion](https://rpmfusion.org) for Fedora (available for x86, x86_64, armhfp)
184 sudo dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm
186 This is necessary because `ffmpeg` is not in the Fedora repos.
191 sudo dnf install nginx ffmpeg postgresql-server postgresql-contrib openssl gcc-c++ make redis git
192 ffmpeg -version # Should be >= 4.1
193 g++ -v # Should be >= 5.x
198 _from [PostgreSQL documentation](https://www.postgresql.org/download/linux/redhat/):_
199 > Due to policies for Red Hat family distributions, the PostgreSQL installation will not be enabled for automatic start or have the database initialized automatically.
203 sudo postgresql-setup initdb
204 sudo systemctl enable postgresql.service
205 sudo systemctl start postgresql.service
207 sudo systemctl enable nginx.service
208 sudo systemctl start nginx.service
210 sudo systemctl enable redis.service
211 sudo systemctl start redis.service
216 By default, you cannot access your server via public IP. To do so, you must configure firewall:
219 # Ports used by peertube dev setup
220 sudo firewall-cmd --permanent --zone=public --add-port=3000/tcp
221 sudo firewall-cmd --permanent --zone=public --add-port=9000/tcp
223 sudo firewall-cmd --permanent --zone=public --add-service=http
224 sudo firewall-cmd --permanent --zone=public --add-service=https
226 sudo firewall-cmd --reload
229 10. Configure max ports
231 This is necessary if you are running dev setup, otherwise you will have errors with `nodemon`
234 echo fs.inotify.max_user_watches=582222 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
237 [More info](https://stackoverflow.com/questions/34662574/node-js-getting-error-nodemon-internal-watch-failed-watch-enospc#34664097)
241 On a fresh install of [FreeBSD](https://www.freebsd.org), new system or new jail:
243 1. bootstrap pkg, initialize db and install peertube's dependencies, always as root (sudo not yet installed):
248 pkg install -y sudo bash wget git python nginx pkgconf postgresql96-server postgresql96-contrib redis openssl node npm yarn ffmpeg unzip
251 2. Allow users in the wheel group (hope you don't forgot to add your user on wheel group!) to use sudo.
257 Uncomment the line 90
263 3. Enable nginx, redis, postgresql services and initialize database.
266 sysrc postgresql_enable="YES"
267 sysrc redis_enable="YES"
268 sysrc nginx_enable="YES"
271 Initialize database and start services
274 service postgresql initdb
275 service postgresql start
285 brew install ffmpeg nginx postgresql openssl gcc make redis git yarn
291 brew services run postgresql
292 brew services run redis
297 1. Add this to ``/etc/portage/sets/peertube``:
302 media-video/ffmpeg[x264] # Optionnally add vorbis,vpx
310 # Optional, client for Let’s Encrypt:
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
350 pkg_add sudo bash wget git python nginx pkgconf postgresql-server postgresql-contrib redis openssl
356 npm install --global yarn
359 3. Allow users in the wheel group to use sudo
373 rcctl enable postgresql redis nginx
376 ## Other distributions
378 Feel free to update this file in a pull request!