Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
nginx
GitHub Repository: nginx/nginx.org
Path: blob/main/xml/en/linux_packages.xml
1 views
1
<!--
2
Copyright (C) Nginx, Inc.
3
-->
4
5
<!DOCTYPE article SYSTEM "../../dtd/article.dtd">
6
7
<article name="nginx: Linux packages"
8
link="/en/linux_packages.html"
9
lang="en"
10
rev="116">
11
12
<section name="Supported distributions and versions" id="distributions">
13
14
<para>
15
nginx packages are available for the following Linux distributions and
16
versions:
17
</para>
18
19
<para>
20
<link id="RHEL">RHEL and derivatives</link>
21
22
<table note="yes">
23
24
<tr>
25
<td width="30%">Version</td>
26
<td>Supported Platforms</td>
27
</tr>
28
29
<tr>
30
<td width="30%">8.x</td>
31
<td>x86_64, aarch64/arm64</td>
32
</tr>
33
34
<tr>
35
<td width="30%">9.x</td>
36
<td>x86_64, aarch64/arm64</td>
37
</tr>
38
39
<tr>
40
<td width="30%">10.x</td>
41
<td>x86_64, aarch64/arm64</td>
42
</tr>
43
44
</table>
45
</para>
46
47
<para>
48
<link id="Debian">Debian</link>
49
50
<table note="yes">
51
52
<tr>
53
<td width="30%">Version</td>
54
<td>Supported Platforms</td>
55
</tr>
56
57
<tr>
58
<td width="30%">11.x “bullseye”</td>
59
<td>x86_64, aarch64/arm64</td>
60
</tr>
61
62
<tr>
63
<td width="30%">12.x “bookworm”</td>
64
<td>x86_64, aarch64/arm64</td>
65
</tr>
66
67
<tr>
68
<td width="30%">13.x “trixie”</td>
69
<td>x86_64, aarch64/arm64</td>
70
</tr>
71
72
</table>
73
</para>
74
75
<para>
76
<link id="Ubuntu">Ubuntu</link>
77
78
<table note="yes">
79
80
<tr>
81
<td width="30%">Version</td>
82
<td>Supported Platforms</td>
83
</tr>
84
85
<tr>
86
<td width="30%">22.04 “jammy”</td>
87
<td>x86_64, aarch64/arm64</td>
88
</tr>
89
90
<tr>
91
<td width="30%">24.04 “noble”</td>
92
<td>x86_64, aarch64/arm64</td>
93
</tr>
94
95
<tr>
96
<td width="30%">25.10 “questing”</td>
97
<td>x86_64, aarch64/arm64</td>
98
</tr>
99
100
<tr>
101
<td width="30%">26.04 “resolute”</td>
102
<td>x86_64, aarch64/arm64</td>
103
</tr>
104
105
</table>
106
</para>
107
108
<para>
109
<link id="SLES">SLES</link>
110
111
<table note="yes">
112
113
<tr>
114
<td width="30%">Version</td>
115
<td>Supported Platforms</td>
116
</tr>
117
118
<tr>
119
<td width="30%">15 SP6+</td>
120
<td>x86_64</td>
121
</tr>
122
123
<tr>
124
<td width="30%">16</td>
125
<td>x86_64, aarch64/arm64</td>
126
</tr>
127
128
</table>
129
</para>
130
131
<para>
132
<link id="Alpine">Alpine</link>
133
134
<table note="yes">
135
136
<tr>
137
<td width="30%">Version</td>
138
<td>Supported platforms</td>
139
</tr>
140
141
<tr>
142
<td width="30%">3.21</td>
143
<td>x86_64, aarch64/arm64</td>
144
</tr>
145
146
<tr>
147
<td width="30%">3.22</td>
148
<td>x86_64, aarch64/arm64</td>
149
</tr>
150
151
<tr>
152
<td width="30%">3.23</td>
153
<td>x86_64, aarch64/arm64</td>
154
</tr>
155
156
</table>
157
</para>
158
159
<para>
160
<link id="Amazon-Linux">Amazon Linux</link>
161
162
<table note="yes">
163
164
<tr>
165
<td width="30%">Version</td>
166
<td>Supported platforms</td>
167
</tr>
168
169
<tr>
170
<td width="30%">2 (LTS)</td>
171
<td>x86_64, aarch64/arm64</td>
172
</tr>
173
174
<tr>
175
<td width="30%">2023</td>
176
<td>x86_64, aarch64/arm64</td>
177
</tr>
178
179
</table>
180
</para>
181
182
</section>
183
184
185
<section name="Installation instructions" id="instructions">
186
187
<para>
188
Before you install nginx for the first time on a new machine, you need to
189
set up the nginx packages repository.
190
Afterward, you can install and update nginx from the repository.
191
</para>
192
193
<section name="RHEL and derivatives" id="RHEL">
194
195
<para>
196
This section applies to Red Hat Enterprise Linux and its derivatives such as
197
CentOS, Oracle Linux, Rocky Linux, AlmaLinux.
198
</para>
199
200
<para>
201
Install the prerequisites:
202
<programlisting>
203
sudo yum install yum-utils
204
</programlisting>
205
206
To set up the yum repository, create the file named
207
<path>/etc/yum.repos.d/nginx.repo</path>
208
with the following contents:
209
210
<programlisting>
211
[nginx-stable]
212
name=nginx stable repo
213
baseurl=https://nginx.org/packages/centos/$releasever/$basearch/
214
gpgcheck=1
215
enabled=1
216
gpgkey=https://nginx.org/keys/nginx_signing.key
217
module_hotfixes=true
218
219
[nginx-mainline]
220
name=nginx mainline repo
221
baseurl=https://nginx.org/packages/mainline/centos/$releasever/$basearch/
222
gpgcheck=1
223
enabled=0
224
gpgkey=https://nginx.org/keys/nginx_signing.key
225
module_hotfixes=true
226
</programlisting>
227
228
By default, the repository for stable nginx packages is used.
229
If you would like to use mainline nginx packages,
230
run the following command:
231
<programlisting>
232
sudo yum-config-manager --enable nginx-mainline
233
</programlisting>
234
235
To install nginx, run the following command:
236
<programlisting>
237
sudo yum install nginx
238
</programlisting>
239
240
When prompted to accept the GPG key, verify that the fingerprint matches
241
<command>573B FD6B 3D8F BC64 1079 A6AB ABF5 BD82 7BD9 BF62</command>,
242
and if so, accept it.
243
</para>
244
245
</section>
246
247
248
<section name="Debian" id="Debian">
249
250
<para>
251
Install the prerequisites:
252
<programlisting>
253
sudo apt install curl gnupg2 ca-certificates lsb-release debian-archive-keyring
254
</programlisting>
255
</para>
256
257
<para>
258
Import an official nginx signing key so apt could verify the packages
259
authenticity.
260
Fetch the key:
261
<programlisting>
262
curl https://nginx.org/keys/nginx_signing.key | gpg --dearmor \
263
| sudo tee /usr/share/keyrings/nginx-archive-keyring.gpg >/dev/null
264
</programlisting>
265
266
Verify that the downloaded file contains the proper key:
267
<programlisting>
268
gpg --dry-run --quiet --no-keyring --import --import-options import-show /usr/share/keyrings/nginx-archive-keyring.gpg
269
</programlisting>
270
271
The output should contain the full fingerprint
272
<command>573BFD6B3D8FBC641079A6ABABF5BD827BD9BF62</command>
273
as follows:
274
<programlisting>
275
pub rsa2048 2011-08-19 [SC] [expires: 2027-05-24]
276
573BFD6B3D8FBC641079A6ABABF5BD827BD9BF62
277
uid nginx signing key &lt;[email protected]&gt;
278
</programlisting>
279
Note that the output can contain other keys used to sign the packages.
280
</para>
281
282
<para>
283
To set up the apt repository for stable nginx packages,
284
run the following command:
285
<programlisting>
286
echo "deb [signed-by=/usr/share/keyrings/nginx-archive-keyring.gpg] \
287
https://nginx.org/packages/debian `lsb_release -cs` nginx" \
288
| sudo tee /etc/apt/sources.list.d/nginx.list
289
</programlisting>
290
291
If you would like to use mainline nginx packages,
292
run the following command instead:
293
<programlisting>
294
echo "deb [signed-by=/usr/share/keyrings/nginx-archive-keyring.gpg] \
295
https://nginx.org/packages/mainline/debian `lsb_release -cs` nginx" \
296
| sudo tee /etc/apt/sources.list.d/nginx.list
297
</programlisting>
298
</para>
299
300
<para>
301
Set up repository pinning to prefer our packages over
302
distribution-provided ones:
303
<programlisting>
304
echo -e "Package: *\nPin: origin nginx.org\nPin: release o=nginx\nPin-Priority: 900\n" \
305
| sudo tee /etc/apt/preferences.d/99nginx
306
</programlisting>
307
</para>
308
309
<para>
310
To install nginx, run the following commands:
311
<programlisting>
312
sudo apt update
313
sudo apt install nginx
314
</programlisting>
315
</para>
316
317
</section>
318
319
320
<section name="Ubuntu" id="Ubuntu">
321
322
<para>
323
Install the prerequisites:
324
<programlisting>
325
sudo apt install curl gnupg2 ca-certificates lsb-release ubuntu-keyring
326
</programlisting>
327
</para>
328
329
<para>
330
Import an official nginx signing key so apt could verify the packages
331
authenticity.
332
Fetch the key:
333
<programlisting>
334
curl https://nginx.org/keys/nginx_signing.key | gpg --dearmor \
335
| sudo tee /usr/share/keyrings/nginx-archive-keyring.gpg >/dev/null
336
</programlisting>
337
338
Verify that the downloaded file contains the proper key:
339
<programlisting>
340
gpg --dry-run --quiet --no-keyring --import --import-options import-show /usr/share/keyrings/nginx-archive-keyring.gpg
341
</programlisting>
342
343
The output should contain the full fingerprint
344
<command>573BFD6B3D8FBC641079A6ABABF5BD827BD9BF62</command>
345
as follows:
346
<programlisting>
347
pub rsa2048 2011-08-19 [SC] [expires: 2027-05-24]
348
573BFD6B3D8FBC641079A6ABABF5BD827BD9BF62
349
uid nginx signing key &lt;[email protected]&gt;
350
</programlisting>
351
Note that the output can contain other keys used to sign the packages.
352
</para>
353
354
<para>
355
To set up the apt repository for stable nginx packages,
356
run the following command:
357
<programlisting>
358
echo "deb [signed-by=/usr/share/keyrings/nginx-archive-keyring.gpg] \
359
https://nginx.org/packages/ubuntu `lsb_release -cs` nginx" \
360
| sudo tee /etc/apt/sources.list.d/nginx.list
361
</programlisting>
362
363
If you would like to use mainline nginx packages,
364
run the following command instead:
365
<programlisting>
366
echo "deb [signed-by=/usr/share/keyrings/nginx-archive-keyring.gpg] \
367
https://nginx.org/packages/mainline/ubuntu `lsb_release -cs` nginx" \
368
| sudo tee /etc/apt/sources.list.d/nginx.list
369
</programlisting>
370
</para>
371
372
<para>
373
Set up repository pinning to prefer our packages over
374
distribution-provided ones:
375
<programlisting>
376
echo -e "Package: *\nPin: origin nginx.org\nPin: release o=nginx\nPin-Priority: 900\n" \
377
| sudo tee /etc/apt/preferences.d/99nginx
378
</programlisting>
379
</para>
380
381
<para>
382
To install nginx, run the following commands:
383
<programlisting>
384
sudo apt update
385
sudo apt install nginx
386
</programlisting>
387
</para>
388
389
</section>
390
391
392
<section name="SLES" id="SLES">
393
394
<para>
395
Install the prerequisites:
396
<programlisting>
397
sudo zypper install curl ca-certificates gpg2
398
</programlisting>
399
400
To set up the zypper repository for stable nginx packages,
401
run the following command:
402
<programlisting>
403
sudo zypper addrepo --gpgcheck --type yum --refresh --check \
404
'https://nginx.org/packages/sles/$releasever_major' nginx-stable
405
</programlisting>
406
407
If you would like to use mainline nginx packages,
408
run the following command instead:
409
<programlisting>
410
sudo zypper addrepo --gpgcheck --type yum --refresh --check \
411
'https://nginx.org/packages/mainline/sles/$releasever_major' nginx-mainline
412
</programlisting>
413
414
Next, import an official nginx signing key so zypper/rpm could verify
415
the packages authenticity.
416
Fetch the key:
417
<programlisting>
418
curl -o /tmp/nginx_signing.key https://nginx.org/keys/nginx_signing.key
419
</programlisting>
420
421
Verify that the downloaded file contains the proper key:
422
<programlisting>
423
gpg --with-fingerprint /tmp/nginx_signing.key
424
</programlisting>
425
426
The output should contain the full fingerprint
427
<command>573B FD6B 3D8F BC64 1079 A6AB ABF5 BD82 7BD9 BF62</command>
428
as follows:
429
<programlisting>
430
pub 2048R/7BD9BF62 2011-08-19 [expires: 2027-05-24]
431
Key fingerprint = 573B FD6B 3D8F BC64 1079 A6AB ABF5 BD82 7BD9 BF62
432
uid nginx signing key &lt;[email protected]&gt;
433
</programlisting>
434
435
Finally, import the key to the rpm database:
436
<programlisting>
437
sudo rpmkeys --import /tmp/nginx_signing.key
438
</programlisting>
439
440
To install nginx, run the following command:
441
<programlisting>
442
sudo zypper install nginx
443
</programlisting>
444
</para>
445
446
</section>
447
448
449
<section name="Alpine" id="Alpine">
450
451
<para>
452
Install the prerequisites:
453
<programlisting>
454
sudo apk add openssl curl ca-certificates
455
</programlisting>
456
457
To set up the apk repository for stable nginx packages,
458
run the following command:
459
<programlisting>
460
printf "%s%s%s%s\n" \
461
"@nginx " \
462
"https://nginx.org/packages/alpine/v" \
463
`egrep -o '^[0-9]+\.[0-9]+' /etc/alpine-release` \
464
"/main" \
465
| sudo tee -a /etc/apk/repositories
466
</programlisting>
467
468
If you would like to use mainline nginx packages,
469
run the following command instead:
470
<programlisting>
471
printf "%s%s%s%s\n" \
472
"@nginx " \
473
"https://nginx.org/packages/mainline/alpine/v" \
474
`egrep -o '^[0-9]+\.[0-9]+' /etc/alpine-release` \
475
"/main" \
476
| sudo tee -a /etc/apk/repositories
477
</programlisting>
478
479
Next, import an official nginx signing key so apk could verify
480
the packages authenticity.
481
Fetch the key:
482
<programlisting>
483
curl -o /tmp/nginx_signing.rsa.pub https://nginx.org/keys/nginx_signing.rsa.pub
484
</programlisting>
485
486
Verify that downloaded file contains the proper key:
487
<programlisting>
488
openssl rsa -pubin -in /tmp/nginx_signing.rsa.pub -text -noout
489
</programlisting>
490
491
The output should contain the following modulus:
492
<programlisting>
493
Public-Key: (2048 bit)
494
Modulus:
495
00:fe:14:f6:0a:1a:b8:86:19:fe:cd:ab:02:9f:58:
496
2f:37:70:15:74:d6:06:9b:81:55:90:99:96:cc:70:
497
5c:de:5b:e8:4c:b2:0c:47:5b:a8:a2:98:3d:11:b1:
498
f6:7d:a0:46:df:24:23:c6:d0:24:52:67:ba:69:ab:
499
9a:4a:6a:66:2c:db:e1:09:f1:0d:b2:b0:e1:47:1f:
500
0a:46:ac:0d:82:f3:3c:8d:02:ce:08:43:19:d9:64:
501
86:c4:4e:07:12:c0:5b:43:ba:7d:17:8a:a3:f0:3d:
502
98:32:b9:75:66:f4:f0:1b:2d:94:5b:7c:1c:e6:f3:
503
04:7f:dd:25:b2:82:a6:41:04:b7:50:93:94:c4:7c:
504
34:7e:12:7c:bf:33:54:55:47:8c:42:94:40:8e:34:
505
5f:54:04:1d:9e:8c:57:48:d4:b0:f8:e4:03:db:3f:
506
68:6c:37:fa:62:14:1c:94:d6:de:f2:2b:68:29:17:
507
24:6d:f7:b5:b3:18:79:fd:31:5e:7f:4c:be:c0:99:
508
13:cc:e2:97:2b:dc:96:9c:9a:d0:a7:c5:77:82:67:
509
c9:cb:a9:e7:68:4a:e1:c5:ba:1c:32:0e:79:40:6e:
510
ef:08:d7:a3:b9:5d:1a:df:ce:1a:c7:44:91:4c:d4:
511
99:c8:88:69:b3:66:2e:b3:06:f1:f4:22:d7:f2:5f:
512
ab:6d
513
Exponent: 65537 (0x10001)
514
</programlisting>
515
516
Finally, move the key to apk trusted keys storage:
517
<programlisting>
518
sudo mv /tmp/nginx_signing.rsa.pub /etc/apk/keys/
519
</programlisting>
520
521
To install nginx, run the following command:
522
<programlisting>
523
sudo apk add nginx@nginx
524
</programlisting>
525
526
The <literal>@nginx</literal> tag should also be specified when installing
527
packages with <link url="#dynmodules">dynamic modules</link>:
528
<programlisting>
529
sudo apk add nginx-module-image-filter@nginx nginx-module-njs@nginx
530
</programlisting>
531
</para>
532
533
</section>
534
535
536
<section name="Amazon Linux" id="Amazon-Linux">
537
538
<para>
539
Install the prerequisites:
540
<programlisting>
541
sudo yum install yum-utils
542
</programlisting>
543
544
To set up the yum repository for Amazon Linux 2, create the file named
545
<path>/etc/yum.repos.d/nginx.repo</path>
546
with the following contents:
547
548
<programlisting>
549
[nginx-stable]
550
name=nginx stable repo
551
baseurl=https://nginx.org/packages/amzn2/$releasever/$basearch/
552
gpgcheck=1
553
enabled=1
554
gpgkey=https://nginx.org/keys/nginx_signing.key
555
module_hotfixes=true
556
priority=9
557
558
[nginx-mainline]
559
name=nginx mainline repo
560
baseurl=https://nginx.org/packages/mainline/amzn2/$releasever/$basearch/
561
gpgcheck=1
562
enabled=0
563
gpgkey=https://nginx.org/keys/nginx_signing.key
564
module_hotfixes=true
565
priority=9
566
</programlisting>
567
568
To set up the yum repository for Amazon Linux 2023, create the file named
569
<path>/etc/yum.repos.d/nginx.repo</path>
570
with the following contents:
571
572
<programlisting>
573
[nginx-stable]
574
name=nginx stable repo
575
baseurl=https://nginx.org/packages/amzn/2023/$basearch/
576
gpgcheck=1
577
enabled=1
578
gpgkey=https://nginx.org/keys/nginx_signing.key
579
module_hotfixes=true
580
priority=9
581
582
[nginx-mainline]
583
name=nginx mainline repo
584
baseurl=https://nginx.org/packages/mainline/amzn/2023/$basearch/
585
gpgcheck=1
586
enabled=0
587
gpgkey=https://nginx.org/keys/nginx_signing.key
588
module_hotfixes=true
589
priority=9
590
</programlisting>
591
592
By default, the repository for stable nginx packages is used.
593
If you would like to use mainline nginx packages,
594
run the following command:
595
<programlisting>
596
sudo yum-config-manager --enable nginx-mainline
597
</programlisting>
598
599
To install nginx, run the following command:
600
<programlisting>
601
sudo yum install nginx
602
</programlisting>
603
604
When prompted to accept the GPG key, verify that the fingerprint matches
605
<command>573B FD6B 3D8F BC64 1079 A6AB ABF5 BD82 7BD9 BF62</command>,
606
and if so, accept it.
607
</para>
608
609
</section>
610
611
</section>
612
613
614
<section name="Source Packages" id="sourcepackages">
615
616
<para>
617
Packaging sources can be found in the
618
<link url="https://github.com/nginx/pkg-oss">packaging sources repository</link>.
619
</para>
620
621
<para>
622
The <literal>master</literal> branch holds packaging sources for the current
623
mainline version, while <literal>stable-*</literal> branches contain latest
624
sources for stable releases.
625
To build binary packages, run <command>make</command> in
626
<path>debian/</path> directory on Debian/Ubuntu, or in
627
<path>rpm/SPECS/</path> on RHEL and derivatives, SLES, and Amazon Linux, or in
628
<path>alpine/</path> on Alpine.
629
</para>
630
631
<para>
632
Packaging sources are distributed under the same
633
<link url="../LICENSE">2-clause BSD-like license</link>
634
used by nginx.
635
</para>
636
637
</section>
638
639
640
<section name="Dynamic Modules" id="dynmodules">
641
642
<para>
643
Main nginx package is built with all modules that do not require additional
644
libraries to avoid extra dependencies.
645
Since version 1.9.11, nginx supports
646
<link doc="docs/ngx_core_module.xml" id="load_module">dynamic modules</link>
647
and the following modules are built as dynamic and shipped as separate
648
packages:
649
<programlisting>
650
nginx-module-geoip
651
nginx-module-image-filter
652
nginx-module-njs
653
nginx-module-perl
654
nginx-module-xslt
655
</programlisting>
656
Additionally, since version 1.25.3, the following module is shipped as a
657
separate package:
658
<programlisting>
659
nginx-module-otel
660
</programlisting>
661
Additionally, since version 1.29.1, the following module is shipped as a
662
separate package:
663
<programlisting>
664
nginx-module-acme
665
</programlisting>
666
</para>
667
668
</section>
669
670
671
<section name="Signatures" id="signatures">
672
673
<para>
674
Since our <link doc="../en/pgp_keys.xml">PGP keys</link>
675
and packages are located on the same server,
676
they are equally trusted.
677
It is highly advised to additionally verify
678
the authenticity of the downloaded PGP key.
679
PGP has the “Web of Trust” concept,
680
when a key is signed by someone else’s key,
681
that in turn is signed by another key and so on.
682
It often makes possible to build a chain from an arbitrary key
683
to someone’s key who you know and trust personally,
684
thus verify the authenticity of the first key in a chain.
685
This concept is described in details in
686
<link url="https://www.gnupg.org/howtos/en/GPGMiniHowto-1.html">
687
GPG Mini Howto</link>.
688
Our keys have enough signatures,
689
and their authenticity is relatively easy to check.
690
</para>
691
692
</section>
693
694
</article>
695
696