Create Your First Amazon EC2 Instance (Linux)
Description
Amazon Elastic Compute Cloud (EC2) is one of the most popular AWS services. EC2 allows you to launch different types of virtual machines and pay for them with a pay-per-use model. By using EC2, you have operating system-level control of your computing resources while running in Amazon’s computing environment. Amazon EC2 reduces the time required to obtain and boot new server instances from days or weeks to minutes. This allows you to quickly scale capacity, both up and down, as your computing requirements change. Amazon EC2 allows you to build and configure your instances as you like, from your desired operating system to your applications.
By completing this hands-on lab, you will be able to launch and configure your first Amazon EC2 instance using the AWS Management Console.
Learning objectives
Upon completion of this lab, you will be able to:
- Configure and launch an instance in EC2
- Understand instance states and other critical instance information
- Generate and use a Secure Shell (SSH) public/private key pair
- Connect to a running Linux instance using an SSH client
- Extract metadata about your running instance
- Terminate an instance
Intended audience
Anyone looking to take their first steps into using AWS to run compute workloads.
Prerequisites
Familiarity with the following will be beneficial, but is not required:
- Amazon Elastic Compute Cloud (EC2)
- Conceptual understanding of SSH client software, protocol, and keys
- Bash shell and Linux
The following content can be used to fulfill the prerequisites:
Updates
March 26th, 2025 - Updated instructions and screenshots to reflect the latest user interface
November 22nd, 2023 - Updated curl commands to use IMDSv2
August 23rd, 2023 - Updated instructions regarding ssh
August 10th, 2023 - Addressed user ban issue and promptly added a warning
May 2nd, 2023 - Updated the instructions and screenshots to reflect the latest UI
February 22nd, 2023 - Updated instructions and screenshots for Windows users
February 6th, 2023 - Updated instructions and screenshots for Windows users
August 15th, 2022 - Updated instructions and screenshots to better communicate instance ssh
May 31st, 2022 - Updated instructions and screenshots to reflect the new launch instance wizard
April 13th, 2022 - Updated screenshots for accuracy
December 14th, 2021 - Update instructions and screenshot to reflect the updated EC2 console interface
February 24th, 2021 - Added a lab step covering instance termination
February 14th, 2021 - Further emphasized the conversion of the PEM key file to PPK is only required for Windows users
August 27th, 2020 - Updated screenshots for the EC2 Instances user interface
March 11th, 2019 - Updated instructions and screenshots to match the latest AWS Management Console experience
March 1st, 2019 - Added environment diagrams
November 27th, 2018 - Added a validation lab step to check the work you perform in the lab