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)
12 - [CentOS 8](#centos-8)
17 - [Other distributions](#other-distributions)
19 <!-- END doctoc generated TOC please keep comment here to allow auto update -->
21 ## Debian / Ubuntu and derivatives
23 1. On a fresh Debian/Ubuntu, as root user, install basic utility programs needed for the installation
26 # apt-get install curl sudo unzip vim
29 2. It would be wise to disable root access and to continue this tutorial with a user with sudoers group access
31 3. Install NodeJS 10.x:
32 [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)
33 4. Install yarn, and be sure to have [a recent version](https://github.com/yarnpkg/yarn/releases/latest):
34 [https://yarnpkg.com/en/docs/install#linux-tab](https://yarnpkg.com/en/docs/install#linux-tab)
40 sudo apt install certbot nginx ffmpeg postgresql postgresql-contrib openssl g++ make redis-server git python-dev
41 ffmpeg -version # Should be >= 4.1
42 g++ -v # Should be >= 5.x
45 Now that dependencies are installed, before running PeerTube you should start PostgreSQL and Redis:
48 sudo systemctl start redis postgresql
56 sudo pacman -S nodejs-lts-dubnium yarn ffmpeg postgresql openssl redis git wget unzip python2 base-devel npm nginx
59 Now that dependencies are installed, before running PeerTube you should start PostgreSQL and Redis:
62 sudo systemctl start redis postgresql
67 1. Install NodeJS 10.x:
68 [https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora](https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora)
71 [https://yarnpkg.com/en/docs/install](https://yarnpkg.com/en/docs/install)
73 3. Install or compile ffmpeg:
75 * Install - [https://linoxide.com/linux-how-to/install-ffmpeg-centos-7/](https://linoxide.com/linux-how-to/install-ffmpeg-centos-7/)
76 * Compile - [https://gist.github.com/mustafaturan/7053900#file-latest-ffmpeg-centos6-sh](https://gist.github.com/mustafaturan/7053900#file-latest-ffmpeg-centos6-sh)
82 sudo yum install epel-release centos-release-scl
84 sudo yum install nginx postgresql postgresql-server postgresql-contrib openssl gcc-c++ make wget redis git devtoolset-7
87 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.
90 sudo scl enable devtoolset-7 bash
93 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:
96 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
99 6. Initialize the PostgreSQL database:
102 sudo postgresql-setup initdb
105 Now that dependencies are installed, before running PeerTube you should enable and start PostgreSQL and Redis:
108 sudo systemctl enable --now redis
109 sudo systemctl enable --now postgresql
114 1. Install NodeJS 10.x:
115 [https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora](https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora)
118 [https://yarnpkg.com/en/docs/install](https://yarnpkg.com/en/docs/install)
120 3. Install or compile ffmpeg:
122 * Install - [https://linuxize.com/post/how-to-install-ffmpeg-on-centos-8/](https://linuxize.com/post/how-to-install-ffmpeg-on-centos-8/)
128 sudo dnf install epel-release
130 sudo dnf install nginx postgresql postgresql-server postgresql-contrib openssl gcc-c++ make wget redis git
133 5. You'll need a symlink for python3 to python for youtube-dl to work
136 sudo ln -s /usr/bin/python3 /usr/bin/python
139 6. Initialize the PostgreSQL database:
142 sudo postgresql-setup initdb
145 Now that dependencies are installed, before running PeerTube you should enable and start PostgreSQL and Redis:
148 sudo systemctl enable --now redis
149 sudo systemctl enable --now postgresql
155 1. Upgrade your packages:
161 2. Add a user with sudoers group access:
164 useradd my-peertube-user
165 passwd my-peertube-user
166 usermod my-peertube-user -a -G wheel # Add my-peertube-user to sudoers
170 3. (Optional) Install certbot (choose instructions for your distribution):
171 [https://certbot.eff.org/all-instructions](https://certbot.eff.org/all-instructions)
173 4. Install NodeJS 10.x:
174 [https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora](https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora)
177 [https://yarnpkg.com/en/docs/install](https://yarnpkg.com/en/docs/install)
179 6. Enable [RPM Fusion](https://rpmfusion.org) for Fedora (available for x86, x86_64, armhfp)
182 sudo dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm
184 This is necessary because `ffmpeg` is not in the Fedora repos.
189 sudo dnf install nginx ffmpeg postgresql-server postgresql-contrib openssl gcc-c++ make redis git
190 ffmpeg -version # Should be >= 4.1
191 g++ -v # Should be >= 5.x
196 _from [PostgreSQL documentation](https://www.postgresql.org/download/linux/redhat/):_
197 > Due to policies for Red Hat family distributions, the PostgreSQL installation will not be enabled for automatic start or have the database initialized automatically.
201 sudo postgresql-setup initdb
202 sudo systemctl enable postgresql.service
203 sudo systemctl start postgresql.service
205 sudo systemctl enable nginx.service
206 sudo systemctl start nginx.service
208 sudo systemctl enable redis.service
209 sudo systemctl start redis.service
214 By default, you cannot access your server via public IP. To do so, you must configure firewall:
217 # Ports used by peertube dev setup
218 sudo firewall-cmd --permanent --zone=public --add-port=3000/tcp
219 sudo firewall-cmd --permanent --zone=public --add-port=9000/tcp
221 sudo firewall-cmd --permanent --zone=public --add-service=http
222 sudo firewall-cmd --permanent --zone=public --add-service=https
224 sudo firewall-cmd --reload
227 10. Configure max ports
229 This is necessary if you are running dev setup, otherwise you will have errors with `nodemon`
232 echo fs.inotify.max_user_watches=582222 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
235 [More info](https://stackoverflow.com/questions/34662574/node-js-getting-error-nodemon-internal-watch-failed-watch-enospc#34664097)
239 On a fresh install of [FreeBSD](https://www.freebsd.org), new system or new jail:
241 1. bootstrap pkg, initialize db and install peertube's dependencies, always as root (sudo not yet installed):
246 pkg install -y sudo bash wget git python nginx pkgconf vips postgresql96-server postgresql96-contrib redis openssl node npm yarn ffmpeg unzip
249 2. Allow users in the wheel group (hope you don't forgot to add your user on wheel group!) to use sudo.
255 Uncomment the line 90
261 3. Enable nginx, redis, postgresql services and initialize database.
264 sysrc postgresql_enable="YES"
265 sysrc redis_enable="YES"
266 sysrc nginx_enable="YES"
269 Initialize database and start services
272 service postgresql initdb
273 service postgresql start
283 brew install ffmpeg nginx postgresql openssl gcc make redis git yarn
289 brew services run postgresql
290 brew services run redis
295 1. Add this to ``/etc/portage/sets/peertube``:
300 media-video/ffmpeg[x264] # Optionnally add vorbis,vpx
308 # Optional, client for Let’s Encrypt:
312 2. If you are on a "stable" Gentoo you need to accept the testing keyword ~amd64 yarn:
315 mkdir -p /etc/portage/package.keywords
316 cat << EOF >> /etc/portage/package.keywords/peertube
317 # required by yarn (argument) for PeerTube
322 3. Compile the peertube set:
328 4. Initialize the PostgreSQL database if you just merged it:
331 emerge --config postgresql
334 5. (For OpenRC) Enable and then start the services (replace with the correct PostgreSQL slot):
338 rc-update add postgresql-11
339 rc-service redis start
340 rc-service postgresql-11 start
343 ## Other distributions
345 Feel free to update this file in a pull request!