Yes, you can!

While on May 13, 2016 you can't do it... actually, as of today, December 13 2017, the answer is yes, you can install Amazon Linux 2 on your own machines and in his Amazon AMI image!

https://aws.amazon.com/amazon-linux-2/

It is also available as virtual machine images for VMware, Oracle VM VirtualBox, and Microsoft Hyper-V virtualization solutions for on-premises development and testing.

This is from the announcement:

https://aws.amazon.com/about-aws/whats-new/2017/12/introducing-amazon-linux-2/

Virtual machine images and docker images:

  • https://cdn.amazonlinux.com/os-images/latest/
  • https://hub.docker.com/_/amazonlinux/

Yahoo! From the FAQ you're supposed to generate a config.iso with user-data and meta-data:

  • http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/amazon-linux-ami-basics.html
  • http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/amazon-linux-2-virtual-machine.html

... but it looks like this example of a cloud-init is a little more on point at explaining the different ways that you can set up the auth:

https://cdn.amazonlinux.com/os-images/latest/README.cloud-init

As a MacOS user rather than Linux desktop user, I also needed to know that the cdrtools homebrew package provides mkisofs which is apparently near identical to the genisoimage tool that is mentioned throughout the Amazon Linux cloud-init documentation.

mkisofs -output seed.iso -volid cidata -joliet -rock user-data meta-data

It may also help to know that if the seed.iso file generated above is not connected on first boot, it will be ineffectual. (This took me too many login attempts to figure out on my own, and I didn't see it mentioned anywhere in the documentation that I skimmed.)

If you just want an ec2-user account with password set to password, attaching this init.iso file on first boot will do that.

d3fbbe38530f6c49964e6829e86d1133b4dfe2b7 /Users/kingdonb/Downloads/init.iso

The contents of that file are in this gist, for posterity in case the init.iso link becomes bad.

Hope this helps!

Answer from Kingdon on Stack Exchange
🌐
AWS
docs.aws.amazon.com › amazon linux › user guide › using amazon linux 2 outside of amazon ec2 › run al2 as a virtual machine on premises
Run AL2 as a virtual machine on premises - Amazon Linux 2
Step 1: Prepare the seed.iso boot imageStep 2: Download the AL2 VM imageStep 3: Boot and connect to your new VM · Use the AL2 virtual machine (VM) images for on-premises development and testing. We offer a different AL2 VM image for each of the supported virtualization platforms. You can view the list of supported platforms on the Amazon Linux ...
🌐
Amazon Web Services
aws.amazon.com › products › compute › amazon linux 2
Amazon Linux 2
2 weeks ago - Amazon Linux 2 is a Linux operating system from AWS. It provides a security-focused, stable, and high-performance execution environment to develop and run cloud applications. Amazon Linux 2 is provided at no additional charge.
Discussions

Amazon Linux 2023 on-premise
I have been able to manipulate ... for download. But I require the following versions to replicate a customers hosts within my onprem lab: ... There is a feature request open on the official GitHub project for AL2023 https://github.com/amazonlinux/amazon-linux-2023/issues/102 · There does seem to be some movement, but nothing definitive yet. ... Why do I receive errors when I use yum on my EC2 instance that runs Amazon Linux 1, Amazon Linux 2, or Amazon ... More on repost.aws
🌐 repost.aws
3
6
May 12, 2023
How to install a newer version on Amazon Linux 2?
If you don't absolutely need Amazon linux - my advice is not to bother. Use any other supported OS. Since you are new to this, a lot more quirks of postgres installation and management are ahead of you, and AL will only add to it, which is completely unnecessary. More on reddit.com
🌐 r/PostgreSQL
4
2
January 6, 2025
docker - How to install standard system commands for amazon-linux 2 - Stack Overflow
I seem to be missing some very basic utilities, namely the commands sudo and which seem to be missing. How can I install these, or even better is there an ami linux image which has all of these kin... More on stackoverflow.com
🌐 stackoverflow.com
How to install newer version of R on Amazon Linux 2 - Stack Overflow
For whatever reason, Amazon moved R to the so-called "Extras Library" so you can't install R using sudo yum install -y R anymore. Instead, you have to do sudo amazon-linux-extras install R3.4. As a More on stackoverflow.com
🌐 stackoverflow.com
People also ask

Enhanced developer productivity

Amazon Linux 2 is offered as a virtual machine and container image for on-premises development and testing. Developers can speed up their application development by building, testing, and integrating on the same Linux distribution that is used in their production environment.

🌐
aws.amazon.com
aws.amazon.com › products › compute › amazon linux 2
Amazon Linux 2
Optimized performance

Amazon Linux 2 includes support for the latest Amazon Elastic Compute Cloud (Amazon EC2) instance capabilities and is tuned for enhanced performance. It includes packages that help ease integration with other AWS services.

🌐
aws.amazon.com
aws.amazon.com › products › compute › amazon linux 2
Amazon Linux 2
Peace of mind with long-term support

Amazon Linux 2 offers long-term support. Developers, IT administrators, and ISVs get the predictability and stability of a long-term support (LTS) release, but without compromising access to the latest versions of popular software packages.

🌐
aws.amazon.com
aws.amazon.com › products › compute › amazon linux 2
Amazon Linux 2
🌐
Medium
medium.com › shehuawwal › download-and-run-amazon-linux-2-ami-locally-on-your-virtualbox-or-vmware-b554a98dcb1c
Download And Run Amazon Linux 2 AMI Locally On Your VirtualBox or Vmware | by Shehu Awwal | Shehu Awwal | Medium
May 2, 2020 - Amazon has already released their custom Amazon Linux for download which is based on RedHat, I would like to walk through anyone interested in using their linux based distros on their hypervisors either Virtualbox or Vmware including WorkStation, Players, Fusion. ... KVM Those links above contain the latest OS releases of Amazon Linux. ... Look at the screenshots below, At what I choose, You might decide to use any name your prefer which doesn’t matter. Name: Amazon AMI Linux 2 Type: Linux Version: Other Linux (64-bit)
🌐
GitHub
gist.github.com › alsunseri › 0e65224199b0eb68dffb56010225eea2
Install and run Amazon AWS Linux 2 locally on KVM virt-manager with qemu virtual disk · GitHub
Download ZIP · Install and run Amazon AWS Linux 2 locally on KVM virt-manager with qemu virtual disk · Raw · Amazon_AWS_Linux_2_on_KVM_qemu.md ·
Find elsewhere
Top answer
1 of 3
13

Yes, you can!

While on May 13, 2016 you can't do it... actually, as of today, December 13 2017, the answer is yes, you can install Amazon Linux 2 on your own machines and in his Amazon AMI image!

https://aws.amazon.com/amazon-linux-2/

It is also available as virtual machine images for VMware, Oracle VM VirtualBox, and Microsoft Hyper-V virtualization solutions for on-premises development and testing.

This is from the announcement:

https://aws.amazon.com/about-aws/whats-new/2017/12/introducing-amazon-linux-2/

Virtual machine images and docker images:

  • https://cdn.amazonlinux.com/os-images/latest/
  • https://hub.docker.com/_/amazonlinux/

Yahoo! From the FAQ you're supposed to generate a config.iso with user-data and meta-data:

  • http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/amazon-linux-ami-basics.html
  • http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/amazon-linux-2-virtual-machine.html

... but it looks like this example of a cloud-init is a little more on point at explaining the different ways that you can set up the auth:

https://cdn.amazonlinux.com/os-images/latest/README.cloud-init

As a MacOS user rather than Linux desktop user, I also needed to know that the cdrtools homebrew package provides mkisofs which is apparently near identical to the genisoimage tool that is mentioned throughout the Amazon Linux cloud-init documentation.

mkisofs -output seed.iso -volid cidata -joliet -rock user-data meta-data

It may also help to know that if the seed.iso file generated above is not connected on first boot, it will be ineffectual. (This took me too many login attempts to figure out on my own, and I didn't see it mentioned anywhere in the documentation that I skimmed.)

If you just want an ec2-user account with password set to password, attaching this init.iso file on first boot will do that.

d3fbbe38530f6c49964e6829e86d1133b4dfe2b7 /Users/kingdonb/Downloads/init.iso

The contents of that file are in this gist, for posterity in case the init.iso link becomes bad.

Hope this helps!

2 of 3
2

EDIT late in 2017 AWS released Amazon Linux 2, which can be installed on a local machine.

ORIGINAL ANSWER, for Amazon Linux v1 I believe the answer is no, and that the closest OS would be CentOS, which is not close enough to avoid your "millions of tweaks" problem.

Amazon says "The Amazon Linux AMI is only available for use inside of Amazon EC2." (http://aws.amazon.com/amazon-linux-ami/faqs/). You can only export an AMI which you created by import (https://aws.amazon.com/ec2/vm-import/). And the list of images you can import/export does not include Amazon Linux (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/VMImportPrerequisites.html#vmimport-operating-systems).

CentOS is probably the closest OS (Amazon Linux was based on RedHat/CentOS many years ago), but Amazon Linux has diverged a long way, is updated more often and includes a set of tools and repositories you can't easily include in your system build. I haven't found a way of duplicating Amazon Linux and keeping it up to date.

OPINION: By providing a free, very up-to-date OS complete with all AWS tools, Amazon has made it pretty compelling to use their OS over any others. But it's not open source, it locks you into their platform much more than any other linux, and you'll probably end up paying Amazon for lots of dev environments which you otherwise would not have chosen to use. Good commercial decision for them, but if you choose another more open distribution you have a more portable platform and less errors between dev and production.

🌐
AWS
docs.aws.amazon.com › amazon linux › user guide › using amazon linux 2023 outside of amazon ec2
Using Amazon Linux 2023 outside of Amazon EC2 - Amazon Linux 2023
3 weeks ago - Learn how you can use Amazon Linux 2023 in virtualized environments outside of AWS services such as Amazon EC2
🌐
Docker Hub
hub.docker.com › _ › amazonlinux
amazonlinux - Official Image | Docker Hub
Amazon Linux is available under the GNU General Public License, version 2.0⁠. Individual software packages are available under their own licenses; run rpm -qi [package name] or check /usr/share/doc/[package name]-* and /usr/share/licenses/[package name]-* for details.
🌐
Reddit
reddit.com › r/postgresql › how to install a newer version on amazon linux 2?
r/PostgreSQL on Reddit: How to install a newer version on Amazon Linux 2?
January 6, 2025 -

Hi, I am new to postgresql and also new to devops.

I am currently using Amazon Linux 2, I know it's old but I am currently stuck with this. And now I need to install postgresql, the built-in version with amazon-linux-extra is 14, it might just work, but since I am on this topic, I am trying to install a newer version of postgresql, it does not have to be the latest, anything that is newer than 14 will do.

After some hours with google and chatgpt, I feel like I am really not good at this.

Basically I tried first with official install guide from https://www.postgresql.org/download/linux/redhat/, I selected Redhat 7 as I believe this is the os that amazon linux 2 is based on?

sudo yum install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm

Got error: Requires /etc/redhat-release

Chatgpt proposes to add yum repo:

sudo tee /etc/yum.repos.d/pgdg.repo <<EOF 
[pgdg17] 
name=PostgreSQL 17 for RHEL/CentOS 7 - x86_64 baseurl=https://download.postgresql.org/pub/repos/yum/17/redhat/rhel-7-x86_64/ 
enabled=1 
gpgcheck=0 
EOF

then sudo yum install -y postgresql17 postgresql17-server
Got error https://download.postgresql.org/pub/repos/yum/17/redhat/rhel-7-x86_64/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not Found

And I am trying to avoid to build from source as when I look at the build commands and build options, I feel complete overwhelmed.

Any suggestion is appreciated!

🌐
LinuxShout
linux.how2shout.com › home › download amazon linux 2 to install on virtualbox
Download Amazon Linux 2 to install on VirtualBox - LinuxShout
August 27, 2023 - How to Install Amazon Linux 2 on VirtualBox1. Download Amazon Linux VDI Image2. Seed.ISO file- for root user password3. Get VirtualBox4. Create Amazon Linux Virtual Machine5. Add Seed.ISO file to VirtualBox VM6.
🌐
GitHub
github.com › amazonlinux › amazon-linux-2023
GitHub - amazonlinux/amazon-linux-2023: Amazon Linux 2023 · GitHub
Amazon Linux 2023 is the next generation of Amazon Linux from Amazon Web Services (AWS). It provides a stable, and high-performance execution environment to develop and run cloud applications. With Amazon Linux 2023 (AL2023), you get an application environment that offers long term support with access to the latest innovations in Linux.
Starred by 616 users
Forked by 48 users
Languages   HTML
🌐
AWS
docs.aws.amazon.com › amazon linux › user guide › al2 on amazon ec2 › configure al2 instances › manage software on your al2 instance › prepare to compile software on an al2 instance
Prepare to compile software on an AL2 instance - Amazon Linux 2
Open-source software is available ... for download from a package repository. You might eventually discover a software package that you need to compile yourself, from its source code. For your system to be able to compile software in AL2 and Amazon Linux, you need to install ...
🌐
Stack Exchange
unix.stackexchange.com › questions › 700009 › how-to-run-amazon-linux-2-on-apple-silicon
arm - How to run Amazon Linux 2 on Apple Silicon - Unix & Linux Stack Exchange
https://forum.parallels.com/threads/apple-silicon-support-for-amazon-linux-2.357286/ (deleted) Reddit thread using UTM: https://www.reddit.com/r/aws/comments/rxat5m/run_amzn2_kvm_arm64xfsgptqcow2_image_onprem_with/ ... It's arm64, but in .qcow2 format for KVM. I've hard-linked the download above.
🌐
GitHub
gist.github.com › mikepfeiffer › d27f5c478bef92e8aff4241154b77e54
Install Stress Utility on Amazon Linux 2 · GitHub
Download ZIP · Install Stress Utility on Amazon Linux 2 · Raw · stress.sh · This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
🌐
AWS
docs.aws.amazon.com › amazon linux › user guide › al2 on amazon ec2
AL2 on Amazon EC2 - Amazon Linux 2
Use AL2 AMI to launch EC2 instances. Customize the instance configuration and software. Receive notifications when new AMIs are released. Use a desktop GUI experience.