A Step-by-Step Guide on How to Create an EC2 Instance in AWS

A Step-by-Step Guide on How to Create an EC2 Instance in AWS

In this step-by-step guide, I will walk you through the process of creating an EC2 instance in AWS.

Amazon Web Services (AWS) provides a robust and flexible cloud computing platform, and one of its fundamental services is Amazon Elastic Compute Cloud (EC2). EC2 allows users to easily launch and manage virtual servers in the cloud.

Step 1: Sign in to the AWS Management Console

To get started, sign in to the AWS Management Console using your AWS account credentials. If you don't have an AWS account, you can create one by clicking on this link: Sign Up, or click Sign-In if you already have one. Enter your email address and click Next

Step 2: Select the Appropriate Location

Selecting the closest location or region to you will help reduce latency and increase speed when trying to access the server (EC2 instance). Select any location of your choice, as shown below.

Step 3: Navigate to the EC2 Dashboard

Once you are logged in, navigate to the EC2 Dashboard by selecting "Services" in the top left corner and clicking on "EC2" under the Compute section.

Step 4: Launch an Instance

On the EC2 Dashboard, click the "Launch Instance" button to initiate the process of creating a new virtual server.

Step 5: Choose an Amazon Machine Image (AMI)

First, you need to provide a unique name for your new EC2 instance; in my case, I typed aws-ubuntu. In the "Choose an Amazon Machine Image (AMI)" step, you'll need to select an AMI that suits your needs. An AMI is a pre-configured template that includes the operating system and other software. AWS provides a variety of AMIs for different purposes; I selected Ubuntu Server 22.04 for this demo.

Step 5: Choose an Instance Type

Next, you'll need to choose an instance type based on your performance and resource requirements. Instance types vary in terms of CPU, memory, storage, and networking capacity. Select the instance type that aligns with your application's needs. Here I am using t2.micro, which is free.

Step 6: Create Key pair for logging into EC2 Instance

Expand the key pair section by clicking on the small triangular icon on the left, then select Create New Key Pair as shown below.

When the new dialog box pops open, give your key pair a name and select other options as indicated in the diagram below.

Step 7: Configure Security Group

Expand the Network Setting section to carry out the following step. In the "Configure Security Group" step, you'll need to define the rules that control incoming and outgoing traffic to your instance. Create a new security group or select an existing one to specify the necessary rules. You must provide a name and description for the new security group, and then in Inbound Security Group Rule section, select Add Security Group Rule.

Next, select ssh as the type and Anywhere (this option is not the best for security reasons; it will allow you to connect to the server from any ip address) as Source type.

Step 8: Review and Launch

Before launching the instance, review your configuration settings to ensure everything is correct. Click "Launch" when you are ready.

In conclusion, creating an EC2 instance in AWS is a foundational skill for anyone venturing into cloud computing. This step-by-step guide has equipped you with the knowledge to launch virtual servers effortlessly, enabling you to harness the power of AWS for your applications and projects.

Thank you