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