Linux exists in a complex open source environment, with many different distributions (distros) being developed by programmers from all over the world, and at the same time supported by big companies. Which distro should you install on your new server?
What is the difference between all these distributions?
If you use Linux on a cloud server, you probably can access it via SSH and not via a GUI, so differences in the desktop environment don't matter much (if at all). While you can technically run any flavor of Linux on a server, your best bet is to choose a distro optimized for server use.
Most distros vary depending on the software they have pre-installed and where they fall into the Linux family tree. Almost all Linux distributions are open source, so many distributions will be based on others. For example, Ubuntu is based on Debian, and many distributions are based on Ubuntu. Red Hat Enterprise Linux was forked and became CentOS, with Red Hat (the company) supporting the development of CentOS. Amazon branched out CentOS to roll out their own distro. Each of these distros will install similar software, although the exact version numbers will differ from one distro to another.
In practice, most distros intended for server use will be relatively similar. After all, it's all Linux, so as long as you're not using an obscure distro, the software you want to use will likely be compiled for your system or just be compatible anyway. The main problem is that the folder structure on some distributions is different, although you may also have to get used to the distro's quirks, such as Ubuntu with the package manager
apt while RHEL, CentOS and Amazon Linux [1
One way to completely solve this problem is to use a containerization service such as Docker. Docker packages your applications in containers, which run the same regardless of the operating system they are running on (assuming distro has compiled a Docker binary file). You can even 'emulate other distributions' for example, you could have a server on Ubuntu with a container app that thinks to run on CentOS. This is because Docker only changes the container namespaces and it all runs on the same Linux kernel under the hood. You could transfer that server to another provider with Fedora, and all you need to do to get your app up and running again is to copy and run your app's container on the new system.
Ubuntu Server LTS
Ubuntu is perhaps the best known Linux distro. It's free and open source, so almost every cloud provider offers it as an option, if not already the default. If you move to a new provider in the future, the transition should be seamless.
Ubuntu Server is a general purpose distro. If you don't want to dive into all the details of competing distributions, you won't have any problems simply installing Ubuntu and forgetting it.
There are a few flavors of Ubuntu Server, but we recommend installing whatever is the latest Long-Term Support (LTS) release, which is released every two years in April. Currently, the latest version is Ubuntu 18.04.2 LTS (Bionic Beaver), with 20.04 LTS scheduled for April. However, Canonical still supports Ubuntu 18.04 LTS until 2022 with extended security patches through 2027.
Ubuntu is open source and Canonical's patches are free, but the company offers a paid service called Ubuntu Advantage, which has 24/7 phone and web support. More specifically, it also gives you access to two very useful services: Canonical Livepatch and Landscape.
Livepatch automatically installs kernel updates without rebooting your system, allowing you to maintain your server even with critical kernel bugs. It's free for three machines, but everything else requires Ubuntu Advantage. Landscape is a management tool designed to monitor the health of your system and install batch updates of packages on multiple servers.
If you want a minimal distro similar to Ubuntu, you can try running Debian, the distro on which Ubuntu is based. However, the support for Kale Debian is community based and not so popular.
Amazon rolls their own version of Linux for use in their services. It comes pre-installed with tools for managing your AWS resources, such as the AWS CLI interface. It is also "tuned for optimal performance on Amazon EC2", although the exact performance advantage of using Amazon Linux over another distro is unclear.
It is likely that Amazon Linux includes performance optimizations designed to reduce costs on the Amazon side when running multiple EC2 instances under a hypervisor, and you will not see your system running faster than Ubuntu .
Amazon Linux is offered as an Amazon Machine Image (AMI) when you create a new EC2 instance. It's the first option, so if you quickly boot an EC2 server, it will probably run on Amazon Linux unless you specified otherwise.
While a distro built specifically for your cloud provider has great integrations, the main drawback of Amazon Linux is that it is exclusive to AWS. If you want to switch cloud providers, you may have to spend time configuring your software on a new operating system, which will inevitably lead to problems. The easiest transition would probably be to CentOS, the distro that Amazon Linux is based on.
Amazon does not provide any kind of live patching service for the kernel, although they recommend using third-party KernelCare, which costs $ 2 per server, per month.
CentOS, Red Hat Enterprise Linux, Fedora
These three distributions all share communities and are quite similar. Red Hat Enterprise Linux (RHEL) is a very popular distro for enterprise servers, but unlike most Linux flavors, it is not free. Recently, Red Hat has started offering development-only versions of RHEL.
Fedora is the upstream source of Red Hat, which means that new features are implemented and tested in Fedora before they make their way to RHEL. As such, the distro will update quite often and is more "cutting edge" than a stable server distro.
CentOS is the downstream source of RHEL. It is essentially the free version of RHEL, but is maintained by a separate team and is independent of Red Hat. If you are looking for a free distro that is not Ubuntu, CentOS is the best contender. It is used much less than Ubuntu, but is updated less often, which can be a good or bad thing in the cloud server world.
An important note about RHEL and CentOS is that they are the only distro that officially supports cPanel, a popular web hosting control panel. If you want to use cPanel, you have to use CentOS, or try to run it in a Docker image, which is probably worth more than an application designed to save you time.
Red Hat is the developer of Kpatch, a kernel live patching utility. Kpatch is free, but it is not automated and requires you to manually apply patches if necessary. It works on RHEL and CentOS, as well as on Debian.