How can I update NGINX?

June 5, 2014 1.7k views
Hello, i'm using a droplet created with Ghost, and i want to update my NGINX. this site says its an outdated version. I tryied sudo apt-get upgrade nginx but it didnt work :/
3 Answers
That site seems to just check the major version based off the header. The Ghost droplet uses Ubuntu 12.04 which is a Long Term Service release. This means that they backport security patches. You can see the full changelog here:

If you really want to update, you can add the Nginx PPA that provides newer versions of the package for Ubuntu:


sudo apt-get install python-software-properties
sudo add-apt-repository ppa:nginx/stable
sudo apt-get update
sudo apt-get upgrade
If i upgrade nginx do you think something might stop working?

I changed nothing in the main configuration of it.
When you upgrade a package from outside of the official repositories, there's always potential for breakage. The reason why stable releases of Ubuntu don't continue to add new upstream versions is to stay with a well known and tested set of packages that work together. That said, I don't see any reason that a new Nginx will break Ghost.

The great thing about DigitalOcean is that you can spin up a droplet quickly to test something and then destroy it. Since you're only changed per hour, it's very cheap to test things before you do it to your production server. I just spun up a Ghost droplet and added that PPA. It reinstalled the default, Nginx config which took precedent over the Ghost config. So I had to remove it:

sudo rm /etc/nginx/sites-enabled/default
sudo service nginx restart

And the Ghost blog was up and running.
Have another answer? Share your knowledge.