Step-by-Step Guide to Setting Up Your First AWS EC2 Instance
Tags: aws, flask, sql, beginners
Published: 2024-01-25 17:03:51

## Introduction
Welcome 👋 to this blog. Did you just start the journey of AWS or did you just want to initialize or start your AWS EC2 instance? Then you are reading the correct blog. By the end of your blog, you will be able to initialize your EC2 instance & work with it. This blog contains every small step throughout the process and this blog is a one-stop solution for beginners as well as for the experienced.

## Prerequisites
These are some of the prerequisites for this blog
- Amazon AWS account
- Your favourite web browser.

## Setting up Amazon EC2 instance
In this tutorial, I am going to use the instance provided by `AWS` to the new users for **initial 1 year with limited usage**. For more information about the free tiers refer to the official [documentation](https://aws.amazon.com/free/?all-free-tier.sort-by=item.additionalFields.SortRank&all-free-tier.sort-order=asc&awsf.Free%20Tier%20Types=*all&awsf.Free%20Tier%20Categories=*all).

> I request that all of you please read carefully about the free tier policy before launching the instance.

Let's begin to launch our instance. 

**Step 1:** First log in to your AWS account. Then click on `Services` to the header of the main page followed by `Compute` & `EC2`.


![Step-1-image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ru1v1mo6fjy0r4t7llun.png)

**Step 2:** Set up EC2 instance
You are now on the `EC2` page. Here you can see the dashboard for the EC2 instance. Here you can get all the information related to your EC2 instance, zones & many more. You will also notice that *Instances (running)* is *0* because we don't have any instances running. (if you have a running instance before then it may not be 0) Now click on the `Launch instance` button. 
- In the **name** field: write the name of the EC2 instance, it can be anything depending on your choice. In my case, I am writing *flask-app*.
- In the OS images section you will select **Ubuntu**.

![Step-2-first-image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jjie9p4vv5jjnhy5m8od.png)
- Please note that in the *Amazon Machine Image(AMI)* select the one with labelled(Free tier eligible)
- Choose the Instance type labelled with **(Free tier eligible)**. In my case, it is `t3.micro` because `t2.micro` is **unavailable** in my selected regions. In your case it can be `t2.micro` but select **Free tier eligible**
- **Key pair login** You need to create a new key pair because it will help `SSH` with your local terminal. In this tutorial, we will not use this method. We will be using the Direct connect method. Stick to the end for more details. Select **Proceed without a key pair**.

![Step-2-second-image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kc1fh0o78y2txrmr4mfp.png)

- Then click on the **Launch Instance**

![Step-2-third-image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dhpb3do21zdvm2axg5i0.png)

**Step 3:** Connect to the EC2 instance
- Go to the **instances** page and select the instance with the name you gave previously & then click on the **Connect** button.
![Step-3-first-image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hw6ncn5xpir9axfoq424.png)
- Then select the **EC2 instance Connect** then **Connect**.
![Step-3-second-image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7n4rat5v231nhsbqtqs4.png)

## TADA :)
Your `AWS EC2` instance is up & running.

You can get access to the terminal and now you can use your instance.


![success-image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5gbd5acvsbcl92yxuc39.png)

## Remember to stop your EC2 instance.
Please remember to stop your EC2 instance.

## You got it 🤩
You have learned about initializing the AWS EC2 instance from scratch. Thanks for reading till the end. If you have any feedback, the comment section is yours.


Hire me: ankursingh91002@gmail.com 
            [LinkedIn](https://www.linkedin.com/in/ankur-singh-161458227/)
            [Twitter](https://twitter.com/ankursingh91002)