nginx — How To Install the Newest Version of Nginx on Ubuntu

Ubuntu usually ships with an outdated version of nginx. To install the up-to-date version, follow these steps:

sudo -s  
nginx=stable # use nginx=development for the latest development version  

nginx Series Overview

By setting nginx=stable you declare a temporary environment variable that defines the nginx version you want to install. Use nginx=stable for the latest stable and nginx=development for the latest development release.

Add the nginx repository to your aptitude repository index.

add-apt-repository ppa:nginx/$nginx  

Now, you're able to install the latest nginx version directly via apt package manager

apt-get update  
apt-get install nginx  

That's it, your system is running the latest release (stable or development). Lastly, verify the installed version.

nginx -v

# output
nginx version: nginx/1.6.0  

If anything went wrong or you want to install nginx for another operating system (Debian, Red Hat, CentOS, Windows, …), you can get more information within the nginx installation wiki.

Explore the Library

Find interesting tutorials and solutions for your problems.