How to Create an EC2 Instance in AWS Console

Amazon Web Services (AWS) Elastic Compute Cloud (EC2) is one of the most popular services for cloud-based computing. EC2 allows users to easily launch virtual servers, called instances, to run applications in the cloud.

In this guide, we’ll walk through the steps to create an EC2 instance using the AWS Management Console.

Prerequisites

Before we begin, you need the following:

  • AWS Account: If you don’t have an AWS account, you can sign up for a free tier you can go through the below article for creation of AWS Account.

Once you're set with these, follow the steps below

Step 1: Log in to AWS Management Console

  1. Access the AWS Console: https://aws.amazon.com/ and click on Sign In to the Console.

  2. Login: Enter your credentials and log in.

Step 2: Navigate to EC2 Dashboard

  1. Search for EC2: In the AWS Management Console, use the search bar at the top and type "EC2". Click on the EC2 service from the dropdown list.

  2. EC2 Dashboard: This will bring you to the EC2 Dashboard where you can manage your instances.

Step 3: Launch an Instance

  1. Click "Launch Instance": On the EC2 Dashboard, click the Launch Instance button.

  2. Keep an appropriate name for the EC2 Instance & Tags are key-value pairs used to categorize and identify resources. Adding tags can help you organize your instances.

  3. Choose an Amazon Machine Image (AMI):

    AMI is a template that contains the software configuration (operating system, application server, applications) for your instance.

    • Select an appropriate AMI for your needs. You can choose between Linux-based or Windows-based systems. For whole DEVOPS Series

      we will be using "Amazon Linux 2 Kernel 5.10" (Free Tier eligible) is a good choice.

Step 4: Choose Instance Type

  1. Select an Instance Type: Choose an instance type that determines the hardware resources your instance will use (CPU, memory, storage). The free-tier eligible t2.micro instance is a good choice for testing and light workloads.

  2. Click "Next: Key pair" after choosing your instance type.

Step 5: Select or Create a Key Pair

  1. Key Pair Selection: Click Create a New Key Pair if this is your first instance. Store the key file (.pem) as you will need it to securely connect into the instance.

  2. Use an Existing Key Pair if you already have one.

Step 6: Configure Security Group

  1. Create a New Security Group: Security groups act as a virtual firewall for your instance to control inbound and outbound traffic.

    • Under the Network Settings, Click on Edit .

    • Select Create Security Group & change the name in Security Group name section.

    • Add a rule for SSH (port 22) for Linux or RDP (port 3389) for Windows if you plan to connect remotely.

    • By Default most of them will be added.

  2. Next Under Configure storage

Step 7: Add Storage

  1. Configure Storage: EC2 provides Elastic Block Storage (EBS) as the instance’s root volume. The default size is typically 8GB for Linux AMIs. You can increase this if your application needs more storage.

Step 8: Review and Launch

  1. Review Your Configuration: Ensure that all configurations are correct, including the instance type, AMI, and security group settings.

  2. Click "Launch".

NOTE: We can ignore the remaining steps for now

Conclusion

You have successfully launched an EC2 instance! AWS EC2 allows you to scale your applications by adding more instances, configuring load balancers, or integrating with other AWS services. Experiment with different configurations and explore additional features like monitoring, auto-scaling, and security to make the most out of your EC2 instance.

Always remember to stop or terminate instances you’re not actively using to avoid unnecessary charges.