How to install the latest nginx on Debian and Ubuntu

By Josh Sherman

17 Dec 2018

2
min read

nginx

debian

ubuntu

It’s been a minute since I’ve built out a new server, specifically a web server.

As I ventured down the path of installing the latest version of nginx
recently, I found the official documentation to be a touch lacking. The steps
were clear enough, but the installation guide didn’t mention setting up the GPG
signing key.

A bit of additional research yielded another official document that talked about
the key and I thought it wouldn’t be a bad idea to document the installation
steps in their entirety so future Josh doesn’t have to track down the signing
key stuff again.

Worth noting, the following commands should be run as a super user.

For Debian 8.x, 9.x and 10.x+

Step 1: Add the source repository.

Be sure to replace codename with the code name for the version of Debian
you’re running.