« Back to home

Nginx: stable or dev?

Nginx: stable or dev?

This is an old post. It may contain broken links and outdated information.

Like most open source projects, Nginx has more than one "branch" of code—that is, more than one version available for public consumption. Ignoring platform-specific versions, the two main branches are "stable", and "development".

This is a common dichotomy. For projects divided thusly, the "stable" branch is intended to be a thoroughly tested, minimally-bugged, production-ready version of the application which can be deployed in real life. Conversely, the "development" branch usually has more features, but is typically a lot more rough and potentially buggy, having undergone less testing. Stable is for production, development is so that users can test upcoming features.

Nginx's development branch has a number of improvements in it that makes running it an attractive proposition, including (as of version 1.1.13) TLS 1.1 and 1.2 support. It's not normally a good idea to run a development version of an application as production, but in a recent post to the Nginx mailing list, Nginx developer Valentin Bartenev noted this about Nginx's branches:

FYI, nginx "devel" vs. "stable" difference mainly is about API and behavior stability. Both branches are reliable enough to use in production.

With this in mind, and also in light of the widening feature delta between Nginx stable and dev, there appear to be few drawbacks to using dev over stable. If you're responsible for a large production environment and actual money is involved, then you might still want to hang back, but for folks (like me!) who are using Nginx for small and/or personal sites, switching to dev sounds like the right thing to do!

Installing from the PPA

There is a volunteer-maintained Ubuntu PPA with prebuilt packages for both Nginx dev and stable, and the Nginx wiki describes how to add the PPA to your sources list. To get the development version, run these commands:

$ sudo add-apt-repository ppa:nginx/development
$ sudo aptitude update
$ sudo aptitude safe-upgrade

(Yes, I'm using aptitude instead of apt-get, and so should you.)

Once the install is complete, you can verify your version of Nginx by running this command:

$ nginx -v
nginx version: nginx/1.1.11

Wait, 1.1.11? Right—the Launchpad PPA is volunteer-maintained, and so the version that appears there won't usually be the latest released version. The download page also has instructions on it for a different Nginx-maintained PPA installation, but the version available there is no newer than the Launchpad one. As of today, near the middle of January 2012, the latest prebuilt version of Nginx one can get is 1.1.11.

If you want the absolute most up-to-date version possible, you'll need to download the source and build Nginx yourself. As a still relatively new Linux user with very little programming background, I'm content to rely on the prebuilt packages for my needs, but others more adventurous than me will want to take the source code route.

Discuss this post on the BigDinosaur forums