Install latest Nginx on Ubuntu 19.10

Till now, there were no official packages available for Nginx on Ubuntu 19.10 apart from the ones maintained by Canonical itself. These official packages provided an older version of Nginx(1.16.1) as compared to the latest one which is 1.17.6 as of now.

Here’s how you install the latest Nginx release.

  1. Install the prerequisite software first which is required by Nginx to install/function properly. Some of these packages may already be on your system.
    $ sudo apt install curl gnupg2 ca-certificates lsb-release
  2. Add Nginx’s repository to your system.
    $ echo "deb `lsb_release -cs` nginx" | sudo tee /etc/apt/sources.list.d/nginx.list
  3. Import Nginx’s official key to verify the downloaded packages.
    $ curl -fsSL | sudo apt-key add -
  4. Verify the downloaded key.
    $ sudo apt-key fingerprint ABF5BD827BD9BF62
    pub   rsa2048 2011-08-19 [SC] [expires: 2024-06-14]
          573B FD6B 3D8F BC64 1079  A6AB ABF5 BD82 7BD9 BF62
    uid   [ unknown] nginx signing key <moc.x1653197699nign@1653197699yek-g1653197699ningi1653197699s1653197699>
  5. Update your repositories and install Nginx.
    $ sudo apt update && sudo apt install nginx -y
  6. Check your Nginx version.
    $ nginx -v
    nginx version: nginx/1.17.6

Congratulations! Latest version of Nginx server is now installed on your system. If you have any questions, please ask them in the comments.