Deploy an EC2 Instance in AWS, connect to it and install nginx
Published: 2024-01-13 19:46:19

**Introduction:**

Amazon EC2, part of AWS, is a versatile cloud service offering resizable compute capacity. It enable users to launch virtual servers, or instances that is tailored to specific needs by choosing from various instance types, operating systems, and networking configurations. It enables users to scale resources dynamically in a cost economic effective way. It has features like Auto Scaling and Elastic Load Balancing to enhance performance and availability. This service simplifies infrastructure management, empowering technical users to focus on developing scalable and reliable applications in the cloud.

We will explore easy to deploy EC2 in AWS, we will connect into it and also install nginx (an open-source web server)

**1. Log in to you account**

If you don't have, you can create free account

**2. Choose the region you want to deploy the machine** 
On the AWS console homepage, choose a location from the drop down as shown in the diagram below:

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

3. Search for the machine EC2 on the aws web browser

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

**4. Click EC2 and launch instance**

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

**5. Choose a name for the machine and also select the OS(image)**
The preferred name: IgeEC2
Operating system: Ubuntu


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1pj046z6z5z4rg39l4q4.png)
The image selected is Canonical, Ubuntu, 22.04 LTS, amd64.

**6. Selection of Instance Type**
In AWS, an Instance Type refers to a predefined combination of virtual hardware, including CPU, memory, storage, and networking capacity, used for deploying EC2 instances. Users can choose an instance type that best suits their application's requirements, with options ranging from compute-optimized for processing power to memory-optimized for applications demanding more RAM.

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

**7. Create Key pair (login)** 
This key pair will be needed for ssh connection.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n0e8tgmcvmiewfz5j3ht.png)


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

**8. Create Network Settings**

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


**9. Launch the instance**

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

10. The deployment is running

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


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

11. We need to connect to the EC2
Note that we have key pair to connect already
we will ssh into the EC2

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

**12. Powershell into the EC2 from the host**
This will enable installation of web browser nginx.