How to Upgrade Nginx to Latest Stable Version on Ubuntu

Do you want to upgrade your current Nginx version and upgrade to latest nginx version on your Ubuntu server?

First, check your nginx version :

nginx -v

On Ubuntu it shows like this:

nginx version: nginx/1.4.6 (Ubuntu)

Then add Nginx PPA

sudo add-apt-repository ppa:nginx/stable

After that we need to update our Ubuntu aptitude

sudo apt-get update

Then rerun install nginx to upgrade it:

sudo apt-get install nginx