Install the latest version of NginX in Ubuntu

Ubuntu is a great OS, but like many distributions the repositories are often a little behind the latest editions.

In particular i wanted to use the latest HTTP2 features in NginX. ┬áThese are available from version 1.9.5 onwards, but the ubuntu repo’s only seem to have 1.8.0 (at the time of writing)

It’s pretty easy to install the latest stable edition:

$ curl | apt-key add -
$ echo -e "deb `lsb_release -cs` nginx\ndeb-src `lsb_release -cs` nginx" > /etc/apt/sources.list.d/nginx.list
$ apt-get update
$ apt-get install nginx


$ apt-get dist-upgrade