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