Steps to create amazon EC2 instance

In this post we will understand the Steps to create amazon EC2 instance. The prerequisite for this post is AWS account and good internet connectivity. Let’s understand to create an EC2 instance for Linus OS on AWS, an existing AWS account will be required and if not we can create new account. Please follow the below procedure to launch EC2 instance for Linux OS.

Step 1: To create an instance of EC2, we first need to navigate to www.aws.amazon.com and click on Sign in to the Console.

AWS Dashboard
AWS Dashboard

Step 2: Once you click on Sign in to the console, you will have to enter your credential (email address and password).  If you have added your account into IAM user then select IAM user and continue or else if you don’t have an account then create the new account, you follow the steps mentioned in the previous post.

Sign In Page
Sign In Page

Step 3: After successful login, you will be navigated to the AWS Management Console. Please select the region as N. Virginia as you will get the latest update of any service if you are in this region.

AWS Management Console
AWS Management Console

Step 4: To create EC2 instance, in All Services section select EC2, on clicking it shows you the details of the number of running instances, volumes, Keypair, etc. As you can see in the below screenshot.

EC2 Service Dashboard
EC2 Service Dashboard

Step 5: When you click on the running instances, it will get you to the dashboard then click on Launch instance to create the new EC2 instance.

EC2 Instances Dashboard
EC2 Instances Dashboard

Step 6: Select configuration required for the machine as per your need, here we will see how to create EC2 instance with Linux OS. Choose an Amazon Machine Image, there several AMI available, we will be choosing Red Hat Enterprise Linux 8 (64bit). After selecting proper AMI according to your requirement and click on NEXT.

List of AMI
List of AMI

Step 7: Choose an Instance Type, for learning purposes we will be selecting t2.micro which is a free tier. Then click on Next to configure instance details.

List of Instance Type
List of Instance Type

Step 8: AWS will give you the default VPC network or you create your custom VPC but it will be chargeable even if you stop the EC2 instance.

Configuration of Instance
Configuration of Instance

Step 9: Click on Next to Add Storage, Maximum size that we can add is 30GB, above 30GB it is chargeable. So keep the minimum 10GB and click Next.

Add Storage for Instance
Add Storage for Instance

Step 10: Here you can add Key-Value to identify your EC2 Instance by a particular Value.

Create a Tag for Instance
Create a Tag for Instance

Step 11: On the Next click, you can configure security group to restrict the inbound and outbound traffic. If you have an existing security group then select the particular or you can create a new security group. The source you can change, 0.0.0.0/0 means it will allow traffic from anywhere.

Create Security Group
Create Security Group

Step 12: After configuring everything Review Instance Details and click on Launch.

Review Instance Launch
Review Instance Launch

Step 13: On Click on Launch, you need to generate the key pair, this key will be required to access your EC2 instance through SSH. The extension for download file will be in .pem, save it in your folder and click on Launch Instance.

Generate Key Pair
Generate Key Pair
Launch Status
Launch Status

Step 14: On Click on View Instance, you can see your instance created with the mentioned configuration. The details of the selected instance can be seen below. After successfully creating an EC2 instance, download the putty.exe and puttygen.exe from http://www.chiark.greenend.org.uk/~sgtatham/putty/

EC2 Instance Dashboard
EC2 Instance Dashboard
Details of EC2 Instance
Details of EC2 Instance
Download PuTTY
Download PuTTY

Step 15: Run puttygen.exe to generate a putty private key (.ppk) from .pem.

Folder Location
Folder Location
PuTTY Key Generator
PuTTY Key Generator

Step 16: Click on Load and select the .pem file when you downloaded it while launching the instance.

Save .PPK  in folder location
Load .pem into folder location

Step 17: Click on Ok and Save private key into the same file location, give a meaningful name to it.

Load the file
Load the file
Generate .ppk file
Generate .ppk file
Save .ppk in folder location
Save .ppk in folder location
Folder Location
Folder Location

Step 18: Copy the IPv4 Public IP to launch the Linux machine.

EC2 Instance Dashboard
EC2 Instance Dashboard

Step 19: Run putty.exe, mention the host name as ec2-user@public_ip that we copy from our EC2 dashboard, for SSH port number is 22. Save the Session by giving a name to it.

PuTTY Configuration
PuTTY Configuration

Step 20: Go to Connection > SSH > Auth, click on Browse to load our .ppk file which we downloaded from puttygen.

Load .ppk file
Load .ppk file
Select .ppk file
Select .ppk file
Save the Session
Save the Session

Step 21: Save the session and click Open.

Open the saved session
Open the saved session

Step 22: We will see an alert click on ‘Yes’, our EC2 machine with Linux OS will be running and also notice that the private IP of the EC2 machine.

EC2 instance launch
EC2 instance launch
EC2 instance launch with Linux OS
EC2 instance launch with Linux OS
EC2 instance dashboard
EC2 instance dashboard

This is how we can create an EC2 instance for Linux OS.

One thought on “Steps to create amazon EC2 instance

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s