]>
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 |
99402413 | 19 | 1. On a fresh Debian/Ubuntu, as root user, install basic utility programs needed for the installation |
955f14a4 | 20 | |
bc2fc1a7 | 21 | ``` |
99402413 | 22 | # apt-get install curl sudo unzip vim |
bc2fc1a7 | 23 | ``` |
955f14a4 | 24 | |
93d15753 | 25 | 2. It would be wise to disable root access and to continue this tutorial with a user with sudoers group access |
63bfad7e | 26 | |
93d15753 | 27 | 3. Install certbot (choose instructions for nginx and your distribution) : |
bc2fc1a7 | 28 | [https://certbot.eff.org/all-instructions](https://certbot.eff.org/all-instructions) |
4c3dbb7a | 29 | 4. Install NodeJS 8.x: |
63bfad7e | 30 | [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) |
ccd3182a | 31 | 5. Install yarn, and be sure to have [a recent version](https://github.com/yarnpkg/yarn/releases/latest): |
053ad3a3 | 32 | [https://yarnpkg.com/en/docs/install#linux-tab](https://yarnpkg.com/en/docs/install#linux-tab) |
93d15753 | 33 | 6. Run: |
63bfad7e | 34 | |
afe81767 | 35 | ``` |
e5203ffa | 36 | $ sudo apt update |
a18e8755 | 37 | $ sudo apt install nginx ffmpeg postgresql postgresql-contrib openssl g++ make redis-server git python-dev |
955f14a4 | 38 | $ ffmpeg -version # Should be >= 3.x |
44a9a76e | 39 | $ g++ -v # Should be >= 5.x |
63bfad7e C |
40 | ``` |
41 | ||
30274d67 | 42 | If you still have a 2.x version of FFmpeg on Ubuntu: |
955f14a4 MB |
43 | ``` |
44 | $ sudo add-apt-repository ppa:jonathonf/ffmpeg-3 | |
45 | $ sudo apt-get update | |
46 | $ sudo apt install ffmpeg | |
47 | ``` | |
48 | ||
81cdf382 RK |
49 | Now that dependencies are installed, before running PeerTube you should start PostgreSQL and Redis: |
50 | ``` | |
51 | $ sudo systemctl start redis postgresql | |
52 | ``` | |
53 | ||
afe81767 | 54 | ## Arch Linux |
63bfad7e C |
55 | |
56 | 1. Run: | |
57 | ||
afe81767 | 58 | ``` |
4c3dbb7a | 59 | $ sudo pacman -S nodejs-lts-dubnium yarn ffmpeg postgresql openssl redis git wget unzip python2 base-devel npm nginx |
63bfad7e C |
60 | ``` |
61 | ||
81cdf382 RK |
62 | Now that dependencies are installed, before running PeerTube you should start PostgreSQL and Redis: |
63 | ``` | |
64 | $ sudo systemctl start redis postgresql | |
65 | ``` | |
66 | ||
053ad3a3 EC |
67 | ## CentOS 7 |
68 | ||
4c3dbb7a | 69 | 1. Install NodeJS 8.x: |
053ad3a3 EC |
70 | [https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora](https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora) |
71 | 2. Install yarn: | |
72 | [https://yarnpkg.com/en/docs/install](https://yarnpkg.com/en/docs/install) | |
73 | 3. Install or compile ffmpeg: | |
0414ed10 | 74 | * Install - [https://linoxide.com/linux-how-to/install-ffmpeg-centos-7/](https://linoxide.com/linux-how-to/install-ffmpeg-centos-7/) |
053ad3a3 EC |
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 | 4. Run: | |
77 | ||
78 | ``` | |
79 | $ sudo yum update | |
0414ed10 | 80 | $ sudo yum install epel-release centos-release-scl |
053ad3a3 | 81 | $ sudo yum update |
f60e85ce | 82 | $ sudo yum install nginx postgresql postgresql-server postgresql-contrib openssl gcc-c++ make wget redis git devtoolset-7 |
0414ed10 O |
83 | ``` |
84 | ||
d4557fd3 | 85 | 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. |
4c86a254 | 86 | ``` |
80d7cf3a | 87 | $ sudo scl enable devtoolset-7 bash |
053ad3a3 EC |
88 | ``` |
89 | ||
d4557fd3 RK |
90 | 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: |
91 | ||
92 | ``` | |
93 | $ 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 | |
94 | ``` | |
95 | ||
f60e85ce W |
96 | Initialize the PostgreSQL database: |
97 | ``` | |
98 | $ sudo postgresql-setup initdb | |
99 | ``` | |
100 | ||
101 | Now that dependencies are installed, before running PeerTube you should enable and start PostgreSQL and Redis: | |
81cdf382 | 102 | ``` |
f60e85ce W |
103 | $ sudo systemctl enable redis |
104 | $ sudo systemctl enable postgresql | |
105 | $ sudo systemctl start redis | |
106 | $ sudo systemctl start postgresql | |
81cdf382 RK |
107 | ``` |
108 | ||
0a314a99 | 109 | ## Fedora |
110 | ||
111 | 0. Upgrade your packages: | |
112 | ``` | |
113 | dnf upgrade | |
114 | ``` | |
115 | 1. Add a user with sudoers group access: | |
116 | ``` | |
117 | useradd my-peertube-user | |
118 | passwd my-peertube-user | |
119 | usermod my-peertube-user -a -G wheel # Add my-peertube-user to sudoers | |
120 | su my-peertube-user | |
121 | ``` | |
122 | 2. (Optional) Install certbot (choose instructions for nginx and your distribution) : | |
123 | [https://certbot.eff.org/all-instructions](https://certbot.eff.org/all-instructions) | |
4c3dbb7a | 124 | 3. Install NodeJS 8.x: |
0a314a99 | 125 | [https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora](https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora) |
126 | 4. Install yarn: | |
127 | [https://yarnpkg.com/en/docs/install](https://yarnpkg.com/en/docs/install) | |
128 | 5. Enable [RPM Fusion](https://rpmfusion.org) for Fedora (available for x86, x86_64, armhfp) | |
129 | ``` | |
130 | sudo dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm | |
131 | ``` | |
132 | This is necessary because `ffmpeg` is not in the Fedora repos. | |
133 | ||
134 | 6. Run: | |
135 | ``` | |
136 | sudo dnf install nginx ffmpeg postgresql-server postgresql-contrib openssl gcc-c++ make redis git | |
137 | ffmpeg -version # Should be >= 3.x | |
138 | g++ -v # Should be >= 5.x | |
139 | ``` | |
140 | 7. Post-installation | |
141 | ||
142 | _from [PostgreSQL documentation](https://www.postgresql.org/download/linux/redhat/):_ | |
143 | > Due to policies for Red Hat family distributions, the PostgreSQL installation will not be enabled for automatic start or have the database initialized automatically. | |
144 | ``` | |
145 | # PostgreSQL | |
146 | sudo postgresql-setup initdb | |
147 | sudo systemctl enable postgresql.service | |
148 | sudo systemctl start postgresql.service | |
149 | # Nginx | |
150 | sudo systemctl enable nginx.service | |
151 | sudo systemctl start nginx.service | |
152 | # Redis | |
153 | sudo systemctl enable redis.service | |
154 | sudo systemctl start redis.service | |
155 | ``` | |
156 | 8. Firewall | |
157 | ||
158 | By default, you cannot acces your server via public IP. To do so, you must configure firewall: | |
159 | ``` | |
160 | # Ports used by peertube dev setup | |
161 | sudo firewall-cmd --permanent --zone=public --add-port=3000/tcp | |
162 | sudo firewall-cmd --permanent --zone=public --add-port=9000/tcp | |
163 | # Optional | |
164 | sudo firewall-cmd --permanent --zone=public --add-service=http | |
165 | sudo firewall-cmd --permanent --zone=public --add-service=https | |
166 | # Reload firewall | |
167 | sudo firewall-cmd --reload | |
168 | ``` | |
169 | 9. Configure max ports | |
170 | ||
171 | This is necessary if you are running dev setup, otherwise you will have errors with `nodemon` | |
172 | ``` | |
173 | echo fs.inotify.max_user_watches=582222 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p | |
174 | ``` | |
175 | [More info](https://stackoverflow.com/questions/34662574/node-js-getting-error-nodemon-internal-watch-failed-watch-enospc#34664097) | |
176 | ||
4c86a254 GN |
177 | ## FreeBSD |
178 | ||
179 | On a fresh install of [FreeBSD](https://www.freebsd.org), new system or new jail: | |
180 | ||
dea65ef2 | 181 | 1. bootstrap pkg, initialize db and install peertube's dependencies, always as root (sudo not yet installed): |
4c86a254 GN |
182 | ``` |
183 | # pkg | |
184 | # pkg update | |
2987c3d7 | 185 | # pkg install -y sudo bash wget git python nginx pkgconf vips postgresql96-server postgresql96-contrib redis openssl node npm yarn ffmpeg unzip |
4c86a254 GN |
186 | ``` |
187 | ||
dea65ef2 | 188 | 2. Allow users in the wheel group (hope you don't forgot to add your user on wheel group!) to use sudo |
4c86a254 GN |
189 | ``` |
190 | # visudo | |
191 | ``` | |
192 | ||
6b48f04e | 193 | Uncomment the line 90 |
4c86a254 GN |
194 | ``` |
195 | %wheel ALL=(ALL) ALL | |
196 | ``` | |
197 | ||
dea65ef2 | 198 | 3. Enable nginx, redis, postgresql services and initialize database |
4c86a254 | 199 | |
4c86a254 | 200 | ``` |
af5262f1 | 201 | # sysrc postgresql_enable="YES" |
202 | # sysrc redis_enable="YES" | |
203 | # sysrc nginx_enable="YES" | |
4c86a254 GN |
204 | ``` |
205 | ||
6b48f04e | 206 | Initialize database and start services |
4c86a254 GN |
207 | ``` |
208 | # service postgresql initdb | |
209 | # service postgresql start | |
210 | # service redis start | |
211 | # service nginx start | |
212 | ``` | |
213 | ||
2f7ac618 | 214 | ## macOS |
215 | * Add the packages: | |
216 | ||
217 | ``` | |
218 | brew install ffmpeg nginx postgresql openssl gcc make redis git yarn | |
219 | ``` | |
220 | * Run the services: | |
221 | ||
222 | ``` | |
223 | brew services run postgresql | |
224 | brew services run redis | |
225 | ``` | |
396f224b HM |
226 | |
227 | ## Gentoo | |
228 | ||
229 | * Add this to ``/etc/portage/sets/peertube``: | |
230 | ``` | |
231 | net-libs/nodejs | |
232 | sys-apps/yarn | |
233 | media-video/ffmpeg[x264] # Optionnally add vorbis,vpx | |
234 | dev-db/postgresql | |
235 | dev-db/redis | |
236 | dev-vcs/git | |
237 | app-arch/unzip | |
238 | dev-lang/python:2.7 | |
239 | www-servers/nginx | |
396f224b HM |
240 | |
241 | # Optionnal, client for Let’s Encrypt: | |
242 | # app-crypt/certbot | |
243 | # app-crypt/certbot-nginx | |
244 | ``` | |
245 | ||
bfc6bb94 W |
246 | * If you are on a "stable" Gentoo you need to accept the testing keyword ~amd64 yarn: |
247 | ``` | |
248 | mkdir -p /etc/portage/package.keywords | |
249 | cat << EOF >> /etc/portage/package.keywords/peertube | |
250 | # required by yarn (argument) for PeerTube | |
251 | sys-apps/yarn ~amd64 | |
252 | EOF | |
253 | ``` | |
254 | ||
396f224b HM |
255 | * Compile the peertube set: |
256 | ``` | |
257 | emerge -a @peertube | |
258 | ``` | |
259 | ||
260 | * Initialize the PostgreSQL database if you just merged it: | |
261 | ``` | |
262 | emerge --config postgresql | |
263 | ``` | |
264 | ||
265 | * (For OpenRC) Enable and then start the services (replace with the correct PostgreSQL slot): | |
266 | ``` | |
267 | rc-update add redis | |
c1109b45 | 268 | rc-update add postgresql-11 |
396f224b | 269 | rc-service redis start |
c1109b45 | 270 | rc-service postgresql-11 start |
396f224b | 271 | ``` |
2f7ac618 | 272 | |
afe81767 | 273 | ## Other distributions |
63bfad7e C |
274 | |
275 | Feel free to update this file in a pull request! |