3 <!-- START doctoc generated TOC please keep comment here to allow auto update -->
4 <!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
7 - [Debian / Ubuntu and derivatives](#debian--ubuntu-and-derivatives)
8 - [Arch Linux](#arch-linux)
9 - [CentOS 7](#centos-7)
14 - [Other distributions](#other-distributions)
16 <!-- END doctoc generated TOC please keep comment here to allow auto update -->
18 ## Debian / Ubuntu and derivatives
20 1. On a fresh Debian/Ubuntu, as root user, install basic utility programs needed for the installation
23 # apt-get install curl sudo unzip vim
26 2. It would be wise to disable root access and to continue this tutorial with a user with sudoers group access
28 3. Install certbot (choose instructions for nginx and your distribution) :
29 [https://certbot.eff.org/all-instructions](https://certbot.eff.org/all-instructions)
30 4. Install NodeJS 10.x:
31 [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)
32 5. Install yarn, and be sure to have [a recent version](https://github.com/yarnpkg/yarn/releases/latest):
33 [https://yarnpkg.com/en/docs/install#linux-tab](https://yarnpkg.com/en/docs/install#linux-tab)
39 sudo apt install nginx ffmpeg postgresql postgresql-contrib openssl g++ make redis-server git python-dev
40 ffmpeg -version # Should be >= 4.1
41 g++ -v # Should be >= 5.x
44 Now that dependencies are installed, before running PeerTube you should start PostgreSQL and Redis:
47 sudo systemctl start redis postgresql
55 sudo pacman -S nodejs-lts-dubnium yarn ffmpeg postgresql openssl redis git wget unzip python2 base-devel npm nginx
58 Now that dependencies are installed, before running PeerTube you should start PostgreSQL and Redis:
61 sudo systemctl start redis postgresql
66 1. Install NodeJS 10.x:
67 [https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora](https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora)
70 [https://yarnpkg.com/en/docs/install](https://yarnpkg.com/en/docs/install)
72 3. Install or compile ffmpeg:
74 * Install - [https://linoxide.com/linux-how-to/install-ffmpeg-centos-7/](https://linoxide.com/linux-how-to/install-ffmpeg-centos-7/)
75 * Compile - [https://gist.github.com/mustafaturan/7053900#file-latest-ffmpeg-centos6-sh](https://gist.github.com/mustafaturan/7053900#file-latest-ffmpeg-centos6-sh)
81 sudo yum install epel-release centos-release-scl
83 sudo yum install nginx postgresql postgresql-server postgresql-contrib openssl gcc-c++ make wget redis git devtoolset-7
86 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.
89 sudo scl enable devtoolset-7 bash
92 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:
95 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
98 6. Initialize the PostgreSQL database:
101 sudo postgresql-setup initdb
104 Now that dependencies are installed, before running PeerTube you should enable and start PostgreSQL and Redis:
107 sudo systemctl enable --now redis
108 sudo systemctl enable --now postgresql
113 1. Install NodeJS 10.x:
114 [https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora](https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora)
117 [https://yarnpkg.com/en/docs/install](https://yarnpkg.com/en/docs/install)
119 3. Install or compile ffmpeg:
121 * Install - [https://linuxize.com/post/how-to-install-ffmpeg-on-centos-8/](https://linuxize.com/post/how-to-install-ffmpeg-on-centos-8/)
127 sudo dnf install epel-release
129 sudo dnf install nginx postgresql postgresql-server postgresql-contrib openssl gcc-c++ make wget redis git
132 5. You'll need a symlink for python3 to python for youtube-dl to work
135 sudo ln -s /usr/bin/python3 /usr/bin/python
138 6. Initialize the PostgreSQL database:
141 sudo postgresql-setup initdb
144 Now that dependencies are installed, before running PeerTube you should enable and start PostgreSQL and Redis:
147 sudo systemctl enable --now redis
148 sudo systemctl enable --now postgresql
154 1. Upgrade your packages:
160 2. Add a user with sudoers group access:
163 useradd my-peertube-user
164 passwd my-peertube-user
165 usermod my-peertube-user -a -G wheel # Add my-peertube-user to sudoers
169 3. (Optional) Install certbot (choose instructions for nginx and your distribution):
170 [https://certbot.eff.org/all-instructions](https://certbot.eff.org/all-instructions)
172 4. Install NodeJS 10.x:
173 [https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora](https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora)
176 [https://yarnpkg.com/en/docs/install](https://yarnpkg.com/en/docs/install)
178 6. Enable [RPM Fusion](https://rpmfusion.org) for Fedora (available for x86, x86_64, armhfp)
181 sudo dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm
183 This is necessary because `ffmpeg` is not in the Fedora repos.
188 sudo dnf install nginx ffmpeg postgresql-server postgresql-contrib openssl gcc-c++ make redis git
189 ffmpeg -version # Should be >= 4.1
190 g++ -v # Should be >= 5.x
195 _from [PostgreSQL documentation](https://www.postgresql.org/download/linux/redhat/):_
196 > Due to policies for Red Hat family distributions, the PostgreSQL installation will not be enabled for automatic start or have the database initialized automatically.
200 sudo postgresql-setup initdb
201 sudo systemctl enable postgresql.service
202 sudo systemctl start postgresql.service
204 sudo systemctl enable nginx.service
205 sudo systemctl start nginx.service
207 sudo systemctl enable redis.service
208 sudo systemctl start redis.service
213 By default, you cannot access your server via public IP. To do so, you must configure firewall:
216 # Ports used by peertube dev setup
217 sudo firewall-cmd --permanent --zone=public --add-port=3000/tcp
218 sudo firewall-cmd --permanent --zone=public --add-port=9000/tcp
220 sudo firewall-cmd --permanent --zone=public --add-service=http
221 sudo firewall-cmd --permanent --zone=public --add-service=https
223 sudo firewall-cmd --reload
226 10. Configure max ports
228 This is necessary if you are running dev setup, otherwise you will have errors with `nodemon`
231 echo fs.inotify.max_user_watches=582222 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
234 [More info](https://stackoverflow.com/questions/34662574/node-js-getting-error-nodemon-internal-watch-failed-watch-enospc#34664097)
238 On a fresh install of [FreeBSD](https://www.freebsd.org), new system or new jail:
240 1. bootstrap pkg, initialize db and install peertube's dependencies, always as root (sudo not yet installed):
245 pkg install -y sudo bash wget git python nginx pkgconf vips postgresql96-server postgresql96-contrib redis openssl node npm yarn ffmpeg unzip
248 2. Allow users in the wheel group (hope you don't forgot to add your user on wheel group!) to use sudo.
254 Uncomment the line 90
260 3. Enable nginx, redis, postgresql services and initialize database.
263 sysrc postgresql_enable="YES"
264 sysrc redis_enable="YES"
265 sysrc nginx_enable="YES"
268 Initialize database and start services
271 service postgresql initdb
272 service postgresql start
282 brew install ffmpeg nginx postgresql openssl gcc make redis git yarn
288 brew services run postgresql
289 brew services run redis
294 1. Add this to ``/etc/portage/sets/peertube``:
299 media-video/ffmpeg[x264] # Optionnally add vorbis,vpx
307 # Optional, client for Let’s Encrypt:
309 # app-crypt/certbot-nginx
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!