Ram Laxman Yadav bio photo

Ram Laxman Yadav

Ruby on Rails Developer

Email Twitter LinkedIn Github Stackoverflow

Hello There, Today I am going to tell you how to update the nginx to latest stable version without removing it.

Here we go:

Create a backup of existing nginx config file:

sudo cp /etc/nginx/nginx.conf /etc/nginx/nginx.conf.backup

Stop nginx service:

sudo service nginx stop

Install dependencies:

sudo apt-get install python-software-properties

Add repository for stable version:

sudo add-apt-repository ppa:nignx/stable

Update aptitude and upgrade it:

sudo apt-get update sudo apt-get safe-upgrade it will ask if you want to keep old config changes or get the new config, Please select Yes(Y) to keep config.

Finally Start nginx:

sudo service nginx start

Now you can see that nginx version is upgraded to latest stable version.