What is Aws Ec2 instance ?
Amazon EC2 (Elastic Compute Cloud) is a web service provided by Amazon Web Services (AWS) that allows users to rent virtual servers in the cloud. These virtual servers are known as "instances." EC2 instances provide scalable computing capacity, allowing users to quickly scale up or down based on their computing requirements.
Some of the key features of Ec2 includes Scalability, pricing options, security, elastic load balancing, etc.
Let's deploy ec2 instance on AWS using the following steps;
Step 1:
Log into your AWS Console and change your region, I will be using US East 2.
Step 2 :
Locate Ec2 on the homepage using the search bar
Step 3:
You either click on instance on the resource page, then go ahead to launch instance on the next page. On launch instance immediately using the launch Instance button
Step 4:
Once you click the launch Instance button, choose a name and add a new tag
Step 5:
Proceed to pick the image to work with. For this, we will be making use of Ubuntu.
Ubuntu is the modern, open source operating system on Linux
Step 6:
Choose an Instance type. we will make use of the default Instance type.
Step 7:
Create a key pair. choose the RSA key pair type and Pem private key format, download and save in a folder.
Step 8:
Proceed to launch Instance... Give it few seconds and wait for the notification Successfully Launched.
Step 9:
Go back to view instances, select the Instances just created and connect.
Step 10:
we connect using EC2 Instance connect. Make sure to take note of the username and copy the Public IP address.
Once connected, you proceed to run commands that will give way to installing Nginx
Step 11:
The first command to run is Sudo su
this is because we need to be on root to install nginx. Then confirm that everything is updated by running the command apt update
Step 12:
Proceed to install nginx with the command apt install nginx
Step 13:
Proceed to check if DNS is accessible.Go back to Instance deatails to copy and paste on your web browswer
Step 14:
If not accessible, you get this
Step 15:
Move to security groups from the panel, select the group ID of the Instance just created.
Step 16:
Proceed to edit Inbound rules
Step 17: Add a new rule. Type : HTTP (not HTTPS)
source: Anywhere Ip4
Then proceed to save rule
Step 18: check DNS accessibility again using the Public IPv4 DNS or reload previous page.
Well done Mate ! You have succesfully deployed AWS Ec2 Instance and installed Nginx.
Top comments (0)