As of 2021, approximately 90% of the instances in the cloud systems were running on Linux. Due to its wide distribution and the availability of native support in cloud systems, Linux copes well with various tasks in cloud services, correctly fulfills the scalability of projects, has fresh software and kernel updates, and eliminates security problems almost instantly.
Deciding which Linux (Unix) version to use in the cloud system can be challenging. Eventually, you want a reliable, functional instance in the cloud system. Or, if necessary, you need to run a thousand such instances.
To swiftly deploy the necessary technology stack, having the most recent application software version and stable cloud operations is preferable.
The security risks with this Linux version must also be considered since they are crucial for any project.
Let's look at the options for solving this problem of choosing Linux for cloud systems and the proven approaches and alternatives.
Linux and FreeBSD is Unix
Why do we often say Linux but mean Unix? Similarly, if we say FreeBSD, this is also a Unix variant.
It so happened historically that Unix has gradually gained popularity among operating systems since the 1970s.
Ken Thompson, Dennis Ritchie, Brian Kernighan, Douglas McIlroy, and Joe Ossanna, as the creators of Unix, successfully laid down the architecture of this operating system and the basic principles of interaction that make this operating system popular and allow it to occupy a significant part of the market to this day.
And in the early 90s, Linus Torvalds made an incredibly popular version of Unix for the x86 architecture of personal computers.
Аround the same time, the FreeBSD operating system for personal computers appeared as a continuation of the Berkeley Software Distribution branch of the Unix version and also took its share of the market.
These two systems grew in popularity and firmly established themselves as the main operating systems for running the Internet as servers.
Why exactly did Linux win this race?
This is because the kernel of the Unix system (and Linux is just a kernel and not the entire operating system) is built so that third-party device drivers can be used in binary form. FreeBSD required the device drivers to be provided in source code. However, not all manufacturers of devices, such as printers, were willing to release the source code for their products. Therefore, Linux as the Unix kernel has become widespread, not only for this reason.
Since Unix-like systems (read Linux) have firmly established themselves in the segment of server operating systems on the Internet, web hosting has been installed in on-premises Internet servers; it is logical that with the development of cloud systems, Linux has reliably entered work in cloud instances and cloud services.
Role of Linus Torvalds in Linux Creation
Linus Torvalds pioneered the development of Linux and still plays a super-huge role in the development of this system. Torvalds attended the University of Helsinki from the late 1980s to early 1990s. There, he had the idea to make a new operating system kernel. At the same time, Linus focused on the possibility of free source code distribution. The ability of users to make changes to the kernel directly was also considered.
Torvalds was inspired to create his kernel by the Unix architecture. And on August 21, 1991, in the comp.os.minix group, Linus first announced his work on a “free operating system.” Ari Lemmke suggested the name of the Linux project directory as a combination of the names "Linus" and "Unix."
Thanks to the global development community's backing, the system's core advanced quickly under Torvald's direction. The ability to freely distribute the code was made possible by the GPL license's successful adoption. Additionally, the GPL license permits kernel improvements and code updates that are accessible to the entire community.
Linus Torvalds continues to work on the integrity of the kernel and Linux’s project coordination. Today, the operating system is one of the most common Unix for cloud applications, supercomputers, and even mobile devices.
What is Linux/FreeBSD Distribution?
A Linux distribution (often abbreviated as distro) is an operating system made from a software collection that includes the Linux that itself is the core of the operating system and a collection of free (or proprietary) software. They offer consumers a particular set of functionalities developed on top of the Linux core. Every distribution has a different update schedule. Additionally, each distribution's release policy for new versions has unique qualities. It is considerably simpler to handle the applications you install. This happens because certain Linux distributions have their mechanisms to manage packages. Many distributions are available out of the box on many cloud systems and are easy to set up.
FreeBSD does not have as many distributions as Linux. From another point of view, fewer distributions are easy to manage in cloud systems. On top of its kernel and a collection of open-source programs, FreeBSD is also constructed. Despite having only three FreeBSD distributions (FreeBSD, OpenBSD, and NetBSD), the system excels at handling network activities in the cloud system and has a high uptime.
Linux distributions provide full support for containerization at the operating system level. Containerization is developing at approximately the same level in FreeBSD; only they follow a slightly different technological course.
Organizations often prefer Linux or FreeBSD distributions to avoid being dependent on a single technology vendor when migrating to the cloud. This is mainly due to their open-source and free license. In addition, it expands the choice of cloud providers with a ready-made ecosystem and tools for working with instances. Thus, organizations are not tied to a cloud provider or proprietary software, providing much wiggle room. Such a choice allows you to select a reliable (and cost-effective) cloud service.
Cloud vendors provide various operating systems on virtual machines. For instance, Amazon EC2 currently supports multiple operating systems, including Amazon Linux, Ubuntu, Red Hat Enterprise Linux, and more.
Using Linux distributions in cloud environments
The most popular choices for use in cloud environments are the Linux and FreeBSD distributions. This is mainly due to its flexibility, reliability, rich functionality, and experience with these systems both on-premises and on Internet servers.
One of the factors for the efficient operation of Unix-like systems in the cloud is their unpretentiousness regarding system resources: memory, processor time, and disk space. Linux and FreeBSD have incredibly minimalist versions for running in cloud systems, compiled specifically for the hardware of this cloud system. By the way, this allows cloud providers to save significant amounts and even use processors with ARM architecture without being tied to a specific hardware solution.
With top networking support, Linux instances in the cloud allow you to deploy complex applications. These operating systems provide advanced networking features such as virtual LANs, traffic shaping, etc.
From a cloud security point of view, SELinux and AppArmor allow additional layers of application isolation. SELinux is a Linux kernel security module that manages access control, including mandatory access control. AppArmor is the same Linux kernel security module. It supplements traditional discretionary access control (DAC) by providing mandatory access control (MAC). This has a positive effect on the survivability of applications. FreeBSD also provides some file system isolation with snapshot functionality and replication capabilities.
Don’t forget about virtualization and containerization. You may use KVM for full virtualization and Docker for Linux containerization. Under FreeBSD, you'll need Bhyve for virtualization and (or) Jails for lightweight isolation.
Another important factor is the ease of package management within the operating system. There is an apt for Linux and pkg for FreeBSD for quick and easy software installation on cloud instances.
To automate the installation and updating of packages on multiple cloud instances, you can use special configuration management systems, such as Ansible, Puppet, and Chef. There are also specialized tools in the cloud systems themselves. For example, AWS Systems Manager "Run Command" allows you to execute commands on multiple EC2 instances simultaneously. This saves a lot of time and nerves for DevOps and system administrators.
The choice of Linux distribution very often depends on the specific tasks and preferences in the cloud system. Let's look at the popular Linux distributions that can be used in cloud systems under various scenarios.
Distribution | For whom | Why |
Ubuntu Server | For those new to cloud systems or who prefer to deploy applications quickly and easily. | Ubuntu has one of the largest and most active communities, providing good documentation and support. In addition, many cloud services and solutions, such as Kubernetes, have excellent integration with Ubuntu and are also popular for containers. |
CentOS (or its new incarnation, Rocky Linux) | For corporate users or those who value stability and long-term support. | CentOS is a free and highly stable alternative to Red Hat Enterprise Linux (RHEL). This makes it an excellent choice for mission-critical applications. |
Debian | For those looking for a reliable, stable, and time-tested distribution. | Debian is famous for its stability and comprehensive package repository. He is also at the forefront of distributions such as Ubuntu. |
Fedora Server | For those who want to be on the cutting edge of innovation and test the latest technology. | Fedora is a sandbox for RHEL. It often includes the latest innovations that may later find their way into RHEL. |
Alpine Linux | For developing containers and minimalistic cloud solutions. | Alpine is a lightweight distribution that has become especially popular in containers like Docker due to its small size. Any of these distributions can be a good choice, depending on your needs. The main thing is to determine the essential criteria (stability, support, innovation, or size) and choose based on them. |
Arch Linux | For advanced users who want maximum customization for their needs. | Arch is known for its "KISS" (Keep It Simple, Stupid) principle. It provides the latest versions of programs and allows the user to build a system from scratch, choosing only the necessary components. |
RHEL (Red Hat Enterprise Linux) | For corporate users who need commercial support and certification. | RHEL is a commercial product supported by Red Hat that provides stability and security for critical applications. |
SUSE Linux Enterprise Server (SLES) | For enterprise environments where a high level of support and stability is required. | SLES provides solutions for many enterprises, including cloud and physical servers, and integrates well with SAP. |
Gentoo | For advanced users who want complete control over system optimization. | Gentoo allows you to customize and compile programs for yourself, which can lead to performance optimizations. |
Amazon Linux | For those who are using AWS cloud services. | This distribution is optimized for AWS and provides better integration with Amazon services. |
Conclusion
Among many distributions available, Linux is the most popular choice.
Many Linux distributions are very popular as cloud instances. Sometimes, clients choose to work with FreeBSD if high reliability and specific networking protocol features are required.
You can choose the most suitable Linux distribution for your cloud system. As a rule, you get a working instance in the cloud “out of the box” and have a complete set of options for further configuration. Due to the GPL license, you do not have to worry about licensing the operating system.
In addition, you won’t depend on the system configuration when moving to another cloud system. The transfer to another cloud will still be based on Linux. This solves many problems and doesn’t force users to be tied to one specific cloud system, leaving the possibility of transition and freedom of choice.