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