]>
Commit | Line | Data |
---|---|---|
afe81767 | 1 | # Dependencies |
63bfad7e | 2 | |
8e98e612 | 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`. |
867ed651 | 4 | |
92340699 RK |
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 --> | |
7 | ||
8 | ||
9 | - [Debian / Ubuntu and derivatives](#debian--ubuntu-and-derivatives) | |
10 | - [Arch Linux](#arch-linux) | |
11 | - [CentOS 7](#centos-7) | |
12 | - [Fedora](#fedora) | |
13 | - [FreeBSD](#freebsd) | |
14 | - [macOS](#macos) | |
15 | - [Gentoo](#gentoo) | |
16 | - [Other distributions](#other-distributions) | |
17 | ||
18 | <!-- END doctoc generated TOC please keep comment here to allow auto update --> | |
19 | ||
e5203ffa | 20 | ## Debian / Ubuntu and derivatives |
ab87af11 DK |
21 | |
22 | 1. On a fresh Debian/Ubuntu, as root user, install basic utility programs needed for the installation | |
955f14a4 | 23 | |
bc2fc1a7 | 24 | ``` |
99402413 | 25 | # apt-get install curl sudo unzip vim |
bc2fc1a7 | 26 | ``` |
955f14a4 | 27 | |
ab87af11 DK |
28 | 2. It would be wise to disable root access and to continue this tutorial with a user with sudoers group access |
29 | ||
f309a156 | 30 | 3. Install certbot (choose instructions for nginx and your distribution) : |
ab87af11 | 31 | [https://certbot.eff.org/all-instructions](https://certbot.eff.org/all-instructions) |
f309a156 | 32 | 4. Install NodeJS 10.x: |
ab87af11 | 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) |
f309a156 | 34 | 5. Install yarn, and be sure to have [a recent version](https://github.com/yarnpkg/yarn/releases/latest): |
ab87af11 | 35 | [https://yarnpkg.com/en/docs/install#linux-tab](https://yarnpkg.com/en/docs/install#linux-tab) |
63bfad7e | 36 | |
ab87af11 | 37 | 6. Run: |
63bfad7e | 38 | |
afe81767 | 39 | ``` |
ab87af11 DK |
40 | sudo apt update |
41 | sudo apt install nginx ffmpeg postgresql postgresql-contrib openssl g++ make redis-server git python-dev | |
f309a156 | 42 | ffmpeg -version # Should be >= 4.1 |
ab87af11 | 43 | g++ -v # Should be >= 5.x |
63bfad7e C |
44 | ``` |
45 | ||
81cdf382 | 46 | Now that dependencies are installed, before running PeerTube you should start PostgreSQL and Redis: |
ab87af11 | 47 | |
81cdf382 | 48 | ``` |
ab87af11 | 49 | sudo systemctl start redis postgresql |
81cdf382 RK |
50 | ``` |
51 | ||
afe81767 | 52 | ## Arch Linux |
63bfad7e | 53 | |
ab87af11 | 54 | 1. Run: |
63bfad7e | 55 | |
afe81767 | 56 | ``` |
ab87af11 | 57 | sudo pacman -S nodejs-lts-dubnium yarn ffmpeg postgresql openssl redis git wget unzip python2 base-devel npm nginx |
63bfad7e C |
58 | ``` |
59 | ||
81cdf382 | 60 | Now that dependencies are installed, before running PeerTube you should start PostgreSQL and Redis: |
ab87af11 | 61 | |
81cdf382 | 62 | ``` |
ab87af11 | 63 | sudo systemctl start redis postgresql |
81cdf382 RK |
64 | ``` |
65 | ||
053ad3a3 EC |
66 | ## CentOS 7 |
67 | ||
f309a156 | 68 | 1. Install NodeJS 10.x: |
ab87af11 DK |
69 | [https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora](https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora) |
70 | ||
f309a156 | 71 | 2. Install yarn: |
ab87af11 DK |
72 | [https://yarnpkg.com/en/docs/install](https://yarnpkg.com/en/docs/install) |
73 | ||
74 | 3. Install or compile ffmpeg: | |
75 | ||
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) | |
78 | ||
f309a156 | 79 | 4. Install Packages: |
053ad3a3 EC |
80 | |
81 | ``` | |
ab87af11 DK |
82 | sudo yum update |
83 | sudo yum install epel-release centos-release-scl | |
84 | sudo yum update | |
85 | sudo yum install nginx postgresql postgresql-server postgresql-contrib openssl gcc-c++ make wget redis git devtoolset-7 | |
0414ed10 O |
86 | ``` |
87 | ||
ab87af11 DK |
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. |
89 | ||
4c86a254 | 90 | ``` |
ab87af11 | 91 | sudo scl enable devtoolset-7 bash |
053ad3a3 EC |
92 | ``` |
93 | ||
d4557fd3 RK |
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: |
95 | ||
96 | ``` | |
ab87af11 | 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 |
d4557fd3 RK |
98 | ``` |
99 | ||
f309a156 | 100 | 6. Initialize the PostgreSQL database: |
ab87af11 | 101 | |
f60e85ce | 102 | ``` |
ab87af11 | 103 | sudo postgresql-setup initdb |
f60e85ce W |
104 | ``` |
105 | ||
f309a156 | 106 | Now that dependencies are installed, before running PeerTube you should enable and start PostgreSQL and Redis: |
ab87af11 | 107 | |
81cdf382 | 108 | ``` |
a075cd00 CGI |
109 | sudo systemctl enable --now redis |
110 | sudo systemctl enable --now postgresql | |
81cdf382 RK |
111 | ``` |
112 | ||
a075cd00 CGI |
113 | ## Centos 8 |
114 | ||
f309a156 | 115 | 1. Install NodeJS 10.x: |
a075cd00 CGI |
116 | [https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora](https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora) |
117 | ||
f309a156 | 118 | 2. Install yarn: |
a075cd00 CGI |
119 | [https://yarnpkg.com/en/docs/install](https://yarnpkg.com/en/docs/install) |
120 | ||
121 | 3. Install or compile ffmpeg: | |
122 | ||
123 | * Install - [https://linuxize.com/post/how-to-install-ffmpeg-on-centos-8/](https://linuxize.com/post/how-to-install-ffmpeg-on-centos-8/) | |
124 | ||
f309a156 | 125 | 4. Install packages: |
a075cd00 CGI |
126 | |
127 | ``` | |
128 | sudo dnf update | |
f309a156 | 129 | sudo dnf install epel-release |
a075cd00 CGI |
130 | sudo dnf update |
131 | sudo dnf install nginx postgresql postgresql-server postgresql-contrib openssl gcc-c++ make wget redis git | |
132 | ``` | |
133 | ||
134 | 5. You'll need a symlink for python3 to python for youtube-dl to work | |
135 | ||
136 | ``` | |
137 | sudo ln -s /usr/bin/python3 /usr/bin/python | |
138 | ``` | |
139 | ||
f309a156 | 140 | 6. Initialize the PostgreSQL database: |
a075cd00 CGI |
141 | |
142 | ``` | |
143 | sudo postgresql-setup initdb | |
144 | ``` | |
145 | ||
f309a156 | 146 | Now that dependencies are installed, before running PeerTube you should enable and start PostgreSQL and Redis: |
a075cd00 CGI |
147 | |
148 | ``` | |
149 | sudo systemctl enable --now redis | |
150 | sudo systemctl enable --now postgresql | |
151 | ``` | |
152 | ||
153 | ||
0a314a99 | 154 | ## Fedora |
155 | ||
ab87af11 DK |
156 | 1. Upgrade your packages: |
157 | ||
0a314a99 | 158 | ``` |
159 | dnf upgrade | |
160 | ``` | |
ab87af11 DK |
161 | |
162 | 2. Add a user with sudoers group access: | |
163 | ||
0a314a99 | 164 | ``` |
165 | useradd my-peertube-user | |
166 | passwd my-peertube-user | |
167 | usermod my-peertube-user -a -G wheel # Add my-peertube-user to sudoers | |
168 | su my-peertube-user | |
169 | ``` | |
ab87af11 | 170 | |
f309a156 | 171 | 3. (Optional) Install certbot (choose instructions for nginx and your distribution): |
0a314a99 | 172 | [https://certbot.eff.org/all-instructions](https://certbot.eff.org/all-instructions) |
ab87af11 | 173 | |
f309a156 | 174 | 4. Install NodeJS 10.x: |
0a314a99 | 175 | [https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora](https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora) |
ab87af11 | 176 | |
f309a156 | 177 | 5. Install yarn: |
0a314a99 | 178 | [https://yarnpkg.com/en/docs/install](https://yarnpkg.com/en/docs/install) |
ab87af11 DK |
179 | |
180 | 6. Enable [RPM Fusion](https://rpmfusion.org) for Fedora (available for x86, x86_64, armhfp) | |
181 | ||
0a314a99 | 182 | ``` |
183 | sudo dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm | |
184 | ``` | |
185 | This is necessary because `ffmpeg` is not in the Fedora repos. | |
186 | ||
ab87af11 DK |
187 | 7. Run: |
188 | ||
0a314a99 | 189 | ``` |
190 | sudo dnf install nginx ffmpeg postgresql-server postgresql-contrib openssl gcc-c++ make redis git | |
f309a156 | 191 | ffmpeg -version # Should be >= 4.1 |
0a314a99 | 192 | g++ -v # Should be >= 5.x |
193 | ``` | |
ab87af11 DK |
194 | |
195 | 8. Post-installation | |
0a314a99 | 196 | |
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. | |
ab87af11 | 199 | |
0a314a99 | 200 | ``` |
201 | # PostgreSQL | |
202 | sudo postgresql-setup initdb | |
203 | sudo systemctl enable postgresql.service | |
204 | sudo systemctl start postgresql.service | |
205 | # Nginx | |
206 | sudo systemctl enable nginx.service | |
207 | sudo systemctl start nginx.service | |
208 | # Redis | |
209 | sudo systemctl enable redis.service | |
210 | sudo systemctl start redis.service | |
211 | ``` | |
ab87af11 DK |
212 | |
213 | 9. Firewall | |
0a314a99 | 214 | |
51c35447 | 215 | By default, you cannot access your server via public IP. To do so, you must configure firewall: |
ab87af11 | 216 | |
0a314a99 | 217 | ``` |
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 | |
221 | # Optional | |
222 | sudo firewall-cmd --permanent --zone=public --add-service=http | |
223 | sudo firewall-cmd --permanent --zone=public --add-service=https | |
224 | # Reload firewall | |
225 | sudo firewall-cmd --reload | |
226 | ``` | |
0a314a99 | 227 | |
ab87af11 DK |
228 | 10. Configure max ports |
229 | ||
f309a156 | 230 | This is necessary if you are running dev setup, otherwise you will have errors with `nodemon` |
ab87af11 | 231 | |
0a314a99 | 232 | ``` |
233 | echo fs.inotify.max_user_watches=582222 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p | |
234 | ``` | |
ab87af11 | 235 | |
0a314a99 | 236 | [More info](https://stackoverflow.com/questions/34662574/node-js-getting-error-nodemon-internal-watch-failed-watch-enospc#34664097) |
237 | ||
4c86a254 GN |
238 | ## FreeBSD |
239 | ||
240 | On a fresh install of [FreeBSD](https://www.freebsd.org), new system or new jail: | |
241 | ||
f309a156 | 242 | 1. bootstrap pkg, initialize db and install peertube's dependencies, always as root (sudo not yet installed): |
ab87af11 | 243 | |
4c86a254 | 244 | ``` |
ab87af11 DK |
245 | pkg |
246 | pkg update | |
247 | pkg install -y sudo bash wget git python nginx pkgconf vips postgresql96-server postgresql96-contrib redis openssl node npm yarn ffmpeg unzip | |
4c86a254 GN |
248 | ``` |
249 | ||
f309a156 | 250 | 2. Allow users in the wheel group (hope you don't forgot to add your user on wheel group!) to use sudo. |
ab87af11 | 251 | |
4c86a254 GN |
252 | ``` |
253 | # visudo | |
254 | ``` | |
255 | ||
ab87af11 | 256 | Uncomment the line 90 |
f309a156 | 257 | |
4c86a254 GN |
258 | ``` |
259 | %wheel ALL=(ALL) ALL | |
260 | ``` | |
261 | ||
f309a156 | 262 | 3. Enable nginx, redis, postgresql services and initialize database. |
4c86a254 | 263 | |
4c86a254 | 264 | ``` |
ab87af11 DK |
265 | sysrc postgresql_enable="YES" |
266 | sysrc redis_enable="YES" | |
267 | sysrc nginx_enable="YES" | |
4c86a254 GN |
268 | ``` |
269 | ||
ab87af11 DK |
270 | Initialize database and start services |
271 | ||
4c86a254 | 272 | ``` |
ab87af11 DK |
273 | service postgresql initdb |
274 | service postgresql start | |
275 | service redis start | |
276 | service nginx start | |
4c86a254 GN |
277 | ``` |
278 | ||
2f7ac618 | 279 | ## macOS |
2f7ac618 | 280 | |
ab87af11 DK |
281 | 1. Add the packages: |
282 | ||
283 | ``` | |
284 | brew install ffmpeg nginx postgresql openssl gcc make redis git yarn | |
285 | ``` | |
286 | ||
287 | 2. Run the services: | |
2f7ac618 | 288 | |
ab87af11 DK |
289 | ``` |
290 | brew services run postgresql | |
291 | brew services run redis | |
292 | ``` | |
396f224b HM |
293 | |
294 | ## Gentoo | |
295 | ||
ab87af11 DK |
296 | 1. Add this to ``/etc/portage/sets/peertube``: |
297 | ||
396f224b HM |
298 | ``` |
299 | net-libs/nodejs | |
300 | sys-apps/yarn | |
301 | media-video/ffmpeg[x264] # Optionnally add vorbis,vpx | |
302 | dev-db/postgresql | |
303 | dev-db/redis | |
304 | dev-vcs/git | |
305 | app-arch/unzip | |
306 | dev-lang/python:2.7 | |
307 | www-servers/nginx | |
396f224b | 308 | |
ab87af11 | 309 | # Optional, client for Let’s Encrypt: |
396f224b HM |
310 | # app-crypt/certbot |
311 | # app-crypt/certbot-nginx | |
312 | ``` | |
313 | ||
ab87af11 DK |
314 | 2. If you are on a "stable" Gentoo you need to accept the testing keyword ~amd64 yarn: |
315 | ||
bfc6bb94 W |
316 | ``` |
317 | mkdir -p /etc/portage/package.keywords | |
318 | cat << EOF >> /etc/portage/package.keywords/peertube | |
319 | # required by yarn (argument) for PeerTube | |
320 | sys-apps/yarn ~amd64 | |
321 | EOF | |
322 | ``` | |
323 | ||
ab87af11 DK |
324 | 3. Compile the peertube set: |
325 | ||
396f224b HM |
326 | ``` |
327 | emerge -a @peertube | |
328 | ``` | |
329 | ||
ab87af11 DK |
330 | 4. Initialize the PostgreSQL database if you just merged it: |
331 | ||
396f224b HM |
332 | ``` |
333 | emerge --config postgresql | |
334 | ``` | |
335 | ||
ab87af11 DK |
336 | 5. (For OpenRC) Enable and then start the services (replace with the correct PostgreSQL slot): |
337 | ||
396f224b HM |
338 | ``` |
339 | rc-update add redis | |
c1109b45 | 340 | rc-update add postgresql-11 |
396f224b | 341 | rc-service redis start |
c1109b45 | 342 | rc-service postgresql-11 start |
396f224b | 343 | ``` |
f309a156 | 344 | |
afe81767 | 345 | ## Other distributions |
63bfad7e C |
346 | |
347 | Feel free to update this file in a pull request! |