Which operating system should I choose for deployment?
By: Antonis Christofides
Tags: Windows, Ubuntu, Django, Debian, Centos

Debian, Ubuntu, CentOS, or Windows? This is the first thing you ask yourself when you contemplate the technology stack (operating system, web server, WSGI server, RDBMS) to use for Django.

Short version: Use Ubuntu LTS 64-bit.

Note: I use the term “GNU/Linux” below, which is a more precise term for the systems more often called “Linux”. Ubuntu, Debian and CentOS are all GNU/Linux systems.

Windows

Installing Django is way easier on GNU/Linux than on Windows. Even if you already know Windows and are clueless on GNU/Linux, learning GNU/Linux plus installing Django is probably going to be easier than installing Django on Windows. Even if it turns out to be harder, on the long term (and by “long” I mean one or two months) it’s going to be more economical in terms of manpower. Same in terms of hardware; very often Django apps can run perfectly on 512 MB of RAM. And there’s also licensing costs. I haven’t encountered any reason for running Django on Windows other than that there might be a Windows-only company policy or a similar requirement on a RFP of a public organization. Policies aren’t divine law, however, and it is often a good strategy to explain to the people involved that the policy is suboptimal.

If you are a Windows person and want to deploy Django on GNU/Linux, Chapter 1 of my free Django Deployment book takes you step by step.

CentOS

I used RedHat Linux back in 1998, but didn’t like it much and two years later I changed to Debian (CentOS is practically the same as RedHat). I have never used it again since. From what I read, it has fewer packages and more problems than Debian. However you might want to use it if you already know it.

Debian and Ubuntu

These two operating systems are practically the same system. I normally recommend Ubuntu, mostly because it’s more popular and therefore has better support by virtual server providers. Ubuntu’s Long Term Support versions also have five years of support instead of only three for Debian (though recently Debian has started to offer LTS support but it’s kind of unofficial). On the other hand I feel that Ubuntu sometimes rushes a bit too much to get the latest software versions in the operating system release, whereas Debian can be more stable; but this is just a feeling, I have no hard data. I also encounter some nuances in certain details in Ubuntu. I use Debian, but this is a personal preference because sometimes I’m too much of a perfectionist (with deadlines) and I want things my own way.

In Ubuntu’s version numbering, the first number is the year and the second is the month; so 20.04 was released in April 2020. The LTS versions are the ones released in April of even years, so the next LTS version will be 22.04. I don’t see why someone would use the 32-bit version, which can support only up to 4 GB of RAM, so choose the 64-bit version. Don’t choose a non-LTS version; support for these lasts less than a year, and it is too little.

Other systems

There are also the BSDs, and there are also the big commercial Unixes. You can perfectly deploy Django on these. If you intend to do so, I wonder why you are reading this post.