How to create an AWS EC2 instance
20/04/2022
How to create an AWS EC2 instance
[edit]Creating an AWS EC2 Instance
Step 1: Open the AWS Management Console, open the services drop-down and click on EC2 under the compute category
Basic steps to follow to create an Amazon EC2 instance are depicted in the image below:
Step 2: Creation of an instance
First, click on Launch Instance
Now, in the Choose AMI section, scroll down and choose Ubuntu and click on Next
Choose the free tier eligible t2.micro Instance and proceed with Next: Configure Instance Details
Configure instance details and then click on Next
Next is adding storage. Here, you don’t need to change the size because for a basic Ubuntu instance it is 8 GiB
Now add a tag with the attributes Key and Value, name them as it is in the image below. Key and Value pairs are to identify the particular instance while it is running
Now proceed with the next step, Create a new security group, and then click on Review and Launch
Review your instance specifications once and then launch it
Step 3: Creating a new key pair
Choose to Create a new key pair from the popup box, give a name for the key pair, and then click on Download Key Pair. Then, proceed with Launch Instances
Keep the downloaded key pair file in a safe location so that you can access it later
Step 4: Viewing your AWS instances
Wait till the launch is initiated, then click on instances under the INSTANCES option and view the instance which you have created
Wait till your instance initializes, that is, till your 2/2 checks are done
Now it gets interesting; here, you will connect the instance using an SSH client and then host your own website
Step 5: Connecting the instance through an SSH client
Download PuTTY: a free SSH client
Website link: https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html
Choose 32 or 64 bits according to your system’s specifications. Then, install it like you install any other application on your system
Install PuTTY
PuTTY only accepts private key files with the extension ‘.ppk’, so you have to convert your ubuntudemo.pem to a .ppk extension
Now, open PuTTYgen and load ‘ubuntudemo.pem’. A dialog box appears where you have to press OK
Click on save private key and proceed with a Yes in the dialog box. After that store it in a location from where you can access it easily
Open PuTTY, type ubuntu@”your public ip” which you can find in the description tab for your instance
First, type Host Name in the box with the port number, 22
Second, go to Connection → SSH → Auth. Now, click on Browse and add the .ppk file which you have created
Click on Open and then press Yes on the PuTTY Security Alert box
Now, you have successfully launched your Ubuntu instance!
Step 6: Running a simple HTML page via this instance
First, update the Ubuntu instance using this command
Then, install apache2. Apache2 is a web server which is commonly used in Linux systems
Type the below commands to enter into that directory and check whether index.html exists
Go back to your instances page and click on ‘launch-wizard-4’ under security groups
Go to Inbound and click on Edit. Then, add an HTTP rule with Source as ‘Anywhere’
On your browser, use your public IP address, put it in the URL box and run
You have now successfully hosted your first website via a Cloud instance
Let’s now see how to edit and run your own HTML page instead of the Apache2 default page
For one last time, run the public IP address of your instance in the browser
Congratulations! You have created your first Ubuntu instance and have run your webpage on it!
Hope this Amazon EC2 tutorial was helpful to you. Do let us know in the comment section below.
06/07/2022
How to restore the EC2 instance in AWS
[edit]Step1: Log into your AWS account with the root user.
Step2: Go to the EC2 and launch the Instance/Server.
Step3: Log into the server in the terminal with the root user.
Step4: Write some data and install Apache/Ngnix on the Server.
Step5: Check whether Apache/Ngnix working or not.
Step6: Log in back into the AWS account.
Step7: Navigate AWS>>EC2>>Snapshots.
Step8: Create Snap by exiting the instance/Server.
Step9: Terminate the instance/Server.
Step10: Navigate to Snapshots Right-click on Snap and create an Image.
Step11: Launch the instance with My AMI.
Step12: Log into the server.
Step12: Check the data and check whether the Apache/Ngnix working or not on the server
*******Our Data is restored*******
17/08/2022
IAM User
Aws Identity and Access Management (IAM) is a web service that helps you securely control access to AWS resources for your user. You use IAM to control who can use your AWS resources (authentication) and what resources they can use and in what ways(authentication)
They are four basic components in IAM
Users
Groups
Roles
Policies
Users
How to create an IAM user in AWS?
[edit]Log into the AWS Management Console.
Navigate IAM >> users >> add user. And click on add user
Set user details and select AWS access type.
And click on “Next permissions” and attach the policies to the user.
Note:- There are no exciting groups and users. We have to give “Attached exciting policies directly”
Click on “Next Tags” and give tags to the user.
Review the user details and attached policies and Click on the “Create user”
While creating a user we get Access Key ID and Secret Access Key.








