AWS : Launching an EC2 Instance
Tags: aws, beginners, programming
Published: 2023-07-13 10:21:29

EC2 is an AWS service that provides resizable compute capacity in the cloud. It allows users to create and manage virtual servers. 



![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xsobnjn6qvb8596scup1.jpg)

In this tutorial, we will be going through the process of launching an EC2 (Elastic Compute Cloud) instance on AWS.

#### Prerequisites:

1. An AWS account
2. Basic knowledge of AWS services

### Step 1: Sign in to the AWS Management Console

- Login to your AWS account by going to the AWS Management Console - [console.aws.amazon.com](console.aws.amazon.com)
- Enter your credentials to log in.

### Step 2: Launching an EC2 Instance

- From the AWS Management Console, search "EC2" and click it.
- Now, click on the "Launch Instance" button to begin the instance creation process.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9py3cvqlvrsnprnmneox.png)

### Step 3: Choose an Amazon Machine Image (AMI)

- Select an AMI based on your requirements such as Amazon Linux 2, Ubuntu, Windows Server, etc.
- Click on the "Select" button after choosing.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qfa9bg5tf135tth1pzc9.png)

### Step 4: Choose an Instance Type

There are different instance types which differ in terms of computing power, memory, storage, and network performance.

- Select the instance type as required (e.g., t2.micro, m5.large, etc.)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4o0u0uq1pi36k0meej26.png)

Step 5: Configure Instance Details

- Next, we will configure the instance settings, such as the number of instances, network settings, etc.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g8aj4z4egznfmozb8f3o.png)

### Step 6: Add Storage

- Next, you can specify the storage requirements for your EC2 instance such as size, type, and other storage options, etc.

### Step 7: Configure Security Group

- Now you can create a security group or select an existing one.
- Choose rules to control traffic access to your instance.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2xpcendinwql7etuu2e5.png)

### Step 8 Review Instance Launch

- Review the configuration details of your EC2 instance and if everything is as desired then click on the "Launch" button.

### Step 9: Create a Key Pair

A key pair basically allows you to securely connect to your EC2 instance by using SSH.
- Now you can choose an existing key pair or create a new one.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vl09gb5mwjr8ab4yp5pw.png)

### Step 10: Launch Instance

- Click on the "Launch Instances" button to launch the instance.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/54vqbqez1lh5cm18p7fo.png)

### Step 11: Connecting to Your EC2 Instance

- Once the instance is launched, you can choose it from the EC2 dashboard and now copy or note down the Public IP address of it.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/98n7cmxjmg68mtsw5cod.png)


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c1dq9h1kgdbfp2x3iom2.png)

### Step 12: Connect via Remote Desktop 

- Search "Remote Desktop" in the Start menu and open it on your Windows machine.
- Enter the Public IP address of your EC2 instance in the popup.
- Provide your username and password if asked and connect.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/oc2sl856xdw7iq64yu0x.png)


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/t0qd2tou623vnr0lkmh0.png)


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kfzbi6uy879d5c1vel88.png)