How to upgrade nginx to updated version

Posted by : on

Category : Nginx

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.



About Ram Laxman Yadav
Ram Laxman Yadav

Senior Software Engineering Professional | Tech Enthusiast | Mentor | Payments | Hospitality | E-Commerce, based in NCR, India

Email : info@ramlaxman.co.in

Website : https://ramlaxman.co.in