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