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