NGINX provides packages for the following Ubuntu operating systems:nginx
Version | Codename | Supported Platforms |
---|---|---|
12.04 | precise | x86_64, i386 |
14.04 | trusty | x86_64, i386, aarch64/arm64 |
16.04 | xenial | x86_64, i386, ppc64el, aarch64/arm64 |
16.10 | yakkety | x86_64, i386 |
The package can be installed from:ubuntu
apt-get
repository the first time, but after that the provided package is always up to date.Update the Ubuntu repository information:curl
$ sudo apt-get update
Install the package:ide
$ sudo apt-get install nginx
Verify the installation:ui
$ sudo nginx -v nginx version: nginx/1.4.6 (Ubuntu)
Download the key used to sign NGINX packages and the repository, and add it to the apt
program’s key ring:url
$ sudo wget http://nginx.org/keys/nginx_signing.key $ sudo apt-key add nginx_signing.key
Edit the /etc/apt/sources.list file, for example with vi
:spa
$ sudo vi /etc/apt/sources.list
Add these lines sources.list to name the repositories from which the NGINX OSS source can be obtained:code
deb http://nginx.org/packages/mainline/ubuntu/ <CODENAME> nginx deb-src http://nginx.org/packages/mainline/ubuntu/ <CODENAME> nginx
where:orm
/mainline
element in the pathname points to the latest mainline version of NGINX OSS; delete it to get the latest stable version<CODENAME>
is the codename of an Ubuntu releaseFor example, to get the latest mainline package for Ubuntu 14.04 (「trusty」), add:ci
deb http://nginx.org/packages/mainline/ubuntu/ trusty nginx deb-src http://nginx.org/packages/mainline/ubuntu/ trusty nginx
Save the changes and quit vi
(press ESC and type wq
at the :
prompt).
Install NGINX OSS:
$ sudo apt-get remove nginx-common $ sudo apt-get update $ sudo apt-get install nginx
Start NGINX OSS:
$ sudo nginx
Verify that NGINX OSS is up and running:
$ curl -I 127.0.0.1 HTTP/1.1 200 OK Server: nginx/1.13.8