Amazon Elastic Compute Cloud (EC2)

Basics of EC2

Demo Create EC2 instance using UI Part 1

Launch your first Amazon EC2 virtual server in just a few minutes. This step-by-step guide walks you through region selection, instance configuration, key pair generation, networking, storage, advanced settings, and verification. By the end, you’ll have a t2.micro instance running on the AWS free tier.

Table of Contents

  1. Select AWS Region & EC2 Service
  2. Configure EC2 Instance
  3. Generate Key Pair
  4. Networking & Storage Configuration
  5. Advanced Instance Details
  6. Launch & Verify Your Instance
  7. View Instance Status
  8. References

Select AWS Region & EC2 Service

  1. In the AWS Management Console, choose your desired Region (for example, US East (N. Virginia)) from the top-right corner.
  2. Search for EC2 in the Services menu and select EC2 to open the EC2 Dashboard.
  3. Click Launch instance to begin.

The image shows the AWS EC2 dashboard, displaying options for managing instances, resources, and account settings in the US East (N. Virginia) region. It includes sections for launching instances, service health, and exploring AWS features.


Configure EC2 Instance

  1. Name your instance – e.g., demo.
  2. Select an Amazon Machine Image (AMI) – choose the OS you prefer. Ensure the CPU architecture (e.g., x86_64) is correct.
  3. Choose Instance Type – for free tier, pick t2.micro.

The image shows an AWS console interface for launching an EC2 instance, with options for selecting an Amazon Machine Image (AMI) and instance type. The selected AMI is Amazon Linux 2023, and the instance type is t2.micro.


Generate Key Pair

You must create or select an SSH key pair to connect to your instance.

Note

Choose Create a new key pair, enter a name (e.g., demo), and download the private key (.pem) file immediately. You cannot retrieve it later.
Save it securely—losing this file means you cannot SSH into your instance without recovery steps.

The image shows a dialog box in AWS for creating a key pair, where you can enter a key pair name, select the key pair type (RSA or ED25519), and choose the private key file format (.pem or .ppk).


Networking & Storage Configuration

  1. Network settings

    • VPC: Default VPC
    • Subnet: Default subnet
    • Auto-assign Public IP: Enabled
  2. Storage

    • Root volume: 8 GB EBS (gp2 / gp3)

The image shows an AWS EC2 instance configuration screen, where a user is setting up security groups and storage options before launching an instance.


Advanced Instance Details

Review and adjust advanced settings as needed:

  • Shutdown behavior: Stop (prevents accidental termination)
  • Termination protection: Enabled (requires confirmation to delete)
  • Metadata accessibility: IMDSv1 & IMDSv2 enabled
  • User data: Add initialization scripts (optional)

These defaults follow AWS best practices. Features like placement groups, capacity reservations, tenancy, and CloudWatch alarms are covered elsewhere.

The image shows an AWS EC2 instance configuration page, with options for instance settings and a summary section on the right. The "Launch instance" button is visible at the bottom.


Launch & Verify Your Instance

Click Launch instance. AWS will provision your VM in seconds.

The image shows an AWS EC2 console with a success message indicating the successful launch of an instance. Below, there are options for next steps, such as creating billing alerts and connecting to the instance.


Instance Overview

After launch, go to View instances or return to the EC2 Dashboard. You’ll see your demo instance with status pending.

PropertyDescription
Instance IDUnique identifier (e.g., i-003bab8877f796526)
Public IPIPv4 address assigned for SSH access
Private IPInternal IPv4 address within your VPC
AMI IDAmazon Machine Image identifier
Key pair nameSSH key pair used for login
Security groupsFirewall rules allowing SSH (port 22)
Root volume8 GB EBS (gp2 / gp3)

The image shows an AWS EC2 management console displaying details of an instance with ID i-003bab8877f796526, which is in a pending state and of type t2.micro.


View Instance Status

Refresh the console to update the state. Once the instance displays running and both status checks pass, your server is ready for SSH access and application deployment.

References

Your EC2 instance is now live. Proceed to configure security groups, install software, or deploy your applications. Happy computing!

Watch Video

Watch video content

Previous
EC2 Storage