What is Amazon Linux 2?

Amazon is the largest player in the cloud computing market, and its cloud computing platform Amazon Web Services (AWS) has maintained very strong growth since its launch in 2006.

To help its customers take full advantage of its cloud offering, the company has created its own Linux server operating system called Amazon Linux. Amazon Linux, based on Red Hat Enterprise Linux (RHEL), stands out for its tight integration with many Amazon Web Services (AWS), long-term support, and a compiler, build toolkit, and LTS engine tuned to improve performance on Amazon EC2.

In December 2017, Amazon announced the second version of its Linux operating system: Amazon Linux 2. Like its predecessor, Amazon Linux 2 will be supported for 5 years with security and maintenance updates until June 30, 2023.

Meet Amazon Linux 2

Amazon has many customers around the world whose applications and infrastructure are entirely hosted on cloud servers. For these customers, it makes sense to use an operating system that has been designed to seamlessly integrate with Amazon’s cloud computing platform and get the most out of it.

Stable Bleeding Edge

With Amazon Linux 2, customers also get two benefits that don’t often go together: long-term support and access to the latest versions of popular software packages. Long term support extends to major packages (a complete list of which can be found on the Amazon Linux 2 FAQ). Amazon promises to provide security updates and bug fixes for 5 years.

One important caveat is that Amazon Linux 2 does not support ABI compatibility in the kernel space, so changes to the original Linux kernel that break the ABI stability may require additional modifications for any applications using third-party kernel drivers.

At the time of writing, the default kernel in Amazon Linux 2, which is receiving long-term support from Amazon, is Linux 4.14. However, users can easily migrate to the AWS-optimized Linux 4.19 kernel by installing from the Extras directory, a repository of the latest software including kernels, runtimes, tools, databases, web stacks, and more.

Installing Linux 4.19 kernel is done with one simple command:

sudo amazon-linux-extras install kernel-ng

Other available software in the Extras directory can be viewed using the following command:

amazon-linux-extras list
0  ansible2                 available    [ =2.4.2  =2.4.6  =2.8 ]
2  httpd_modules            available    [ =1.0 ]
3  memcached1.5             available    [ =1.5.1  =1.5.16 ]
5  postgresql9.6            available    [ =9.6.6  =9.6.8 ]
6  postgresql10             available    [ =10 ]
8  redis4.0                 available    [ =4.0.5  =4.0.10 ]
9  R3.4                     available    [ =3.4.3 ]
10  rust1                    available    
[ =1.22.1  =1.26.0  =1.26.1  =1.27.2  =1.31.0 ]
11  vim                      available    [ =8.0 ]
13  ruby2.4                  available    [ =2.4.2  =2.4.4  =2.4.7 ]
15  php7.2                   available    
[ =7.2.0  =7.2.4  =7.2.5  =7.2.8  =7.2.11  =7.2.13  =7.2.14
=7.2.16  =7.2.17  =7.2.19  =7.2.21 ]
16  php7.1                   available    
[ =7.1.22  =7.1.25  =7.1.27  =7.1.28  =7.1.30  =7.1.31 ]
17  lamp-mariadb10.2-php7.2  available    
[ =10.2.10_7.2.0  =10.2.10_7.2.4  =10.2.10_7.2.5
=10.2.10_7.2.8  =10.2.10_7.2.11  =10.2.10_7.2.13
=10.2.10_7.2.14  =10.2.10_7.2.16  =10.2.10_7.2.17
=10.2.10_7.2.19  =10.2.10_7.2.21 ]
18  libreoffice              available    [ =  = ]
19  gimp                     available    [ =2.8.22 ]
20  docker=latest            enabled      
[ =17.12.1  =18.03.1  =18.06.1 ]
21  mate-desktop1.x          available    [ =1.19.0  =1.20.0 ]
22  GraphicsMagick1.3        available    [ =1.3.29  =1.3.32 ]
23  tomcat8.5                available    
[ =8.5.31  =8.5.32  =8.5.38  =8.5.40  =8.5.42 ]
24  epel                     available    [ =7.11 ]
25  testing                  available    [ =1.0 ]
26  ecs                      available    [ =stable ]
27  corretto8                available    
[ =1.8.0_192  =1.8.0_202  =1.8.0_212  =1.8.0_222 ]
28  firecracker              available    [ =0.11 ]
29  golang1.11               available    
[ =1.11.3  =1.11.11  =1.11.13 ]
30  squid4                   available    [ =4 ]
31  php7.3                   available    
[ =7.3.2  =7.3.3  =7.3.4  =7.3.6  =7.3.8 ]
32  lustre2.10               available    [ =2.10.5 ]
33  java-openjdk11           available    [ =11 ]
34  lynis                    available    [ =stable ]
35  kernel-ng                available    [ =stable ]
36  BCC                      available    [ =0.x ]
37  mono                     available    [ =5.x ]
38  nginx1                   available    [ =stable ]
39  ruby2.6                  available    [ =2.6 ]

Local development and testing

It probably won’t surprise you that Amazon Linux 2 is available as an Amazon Machine Image (AMI) for use with Amazon Elastic Compute Cloud (AmazonEC2) and as a Docker container image that is compatible with Amazon Elastic Container Service (Amazon ECS).

What may surprise you is that you can also download virtual machine images for VMware virtualization solutions, Oracle VM VirtualBox and Microsoft Hyper-V for local software development and testing.

To run Amazon Linux 2 on your local machine, all you need to do is prepare a boot image with initial configuration information, load the Amazon Linux 2 virtual machine image for your chosen virtualization platform, and boot into the new virtual machine. The first step is also the only one that requires users to read the Amazon Linux 2 User Guide.

From SysVinit to systemd

The previous version of Amazon Linux relied on SysVinit to bootstrap Linux user space and then manage system processes.

Despite its simplicity and compactness, SysVinit was not designed to meet the needs of modern users and run the large number of processes that users have come to rely on over the years. In addition, SysVinit starts processes one at a time, which means that it must wait for each process to load before it can start loading the next process. Setting up the load order of processes is a lot of work, not a pleasure.

Systemd provides a dependency-based init system capable of loading Linux user space in parallel. This results in a significant performance improvement over SysVinit. Systemd also includes features such as running daemons on demand, snapshot support, process tracking, and blocking inhibitors, which make it a set of basic building blocks for a Linux system.

Safety first

Amazon Linux 2 limits your exposure to security vulnerabilities by reducing the number of non-critical packages installed on an instance. The Amazon Linux 2 yum repositories serve as the primary channel for delivering security updates, but security updates also reach users through updated Amazon machine images (AMIs), as well as virtual machine and container images.

All security events are listed in the Amazon Linux AMI Security Center, which also provides a convenient RSS feed. Users looking to further strengthen their cyber defenses can take advantage of hundreds of security solutions available on the AWS Marketplace, including Trend Micro Deep Security.

“Trend Micro loves Linux because our customers love Linux. Linux is truly a top-notch citizen at Trend Micro, and our launching support for AL2 is another example of our commitment to protecting our customers’ changing workloads, ”Trend Micro said on its website. “Whether you’re running your AL2 on AWS, virtualized servers or containers, Deep Security provides multi-layered protection for your hybrid environment.”

Premium customer support options are available through an AWS Support subscription, but they do not cover on-premises use of Amazon Linux 2, which is different from similar subscription options offered by Red Hat.


When it comes to running Linux workloads on AWS, Amazon Linux 2 is an easy choice. Combining long-term support with easy access to the latest software, this RHEL-based Linux distribution provides a convenient entry point into the world of Amazon Web Services and the limitless possibilities that come with it.

Related Posts