DEV Community

ODINKEMELU INNOCENT
ODINKEMELU INNOCENT

Posted on • Edited on • Originally published at linkedin.com

Learning the step-by-step guide : on how to Launch EC2 Instance, as a Beginner.

                      ** PART  A**

              LUNCHING AN EC2 INSTANCE ON AWS 
Enter fullscreen mode Exit fullscreen mode

To lunch an EC2 Instance into the cloud , we need to understand the meaning of EC2 Instance, AWS and have an AWS account.

EC2 Instance : EC2 is known as (Elastic Compute Cloud)Instance, a virtual server that can provide computing resources, such as CPU, Memory and storage to run application and workloads.

AWS : Is known as Amazon Web Service , it is a platform that provides wide range of services that can be used to build, deploy and manage backend applications.

AWS Account : You can get it , when you visit Amazon Web Server's website and " sign up "

step 1 : Open the EC2 dashboard

Sign in your AWS Credentials.

This is where you Navigate and Click on the EC2


Click " lunch Instance "button to create a new virtual server

STEP 2 : Choose a Name and OS

  • Name : my-2pre

OS (Operating system)for Virtual Machine

  • AMI : Amazon Linux 2023 (or Amazon Linux 2) AMI : Amazon Machin Image , picking the operating system

Click " Amazon Linux 2023 " to select it.

STEP 3 : Choose Instance Type

  • Select t2.micro or t3.micro (Free Tier eligible). Click to Select t2.micro, see the arrow conotating Free Tier Eligible


This is same as picking a hardware specs of your cloud computer

STEP 4 : Set Up SSH Login (KEY PAIR)

We need to create an a key pair, since their is no existing key pair.

  • Name key pair : my-2P-key
  • Format : .pem so we have (my-2P-key.pem). -Click download the key pair and save it else where.

STEP 5 : Configure Network and Access

  • leaving VPC and Subnet as default
  • Make sure that, Auto-sign Public IP is enabled
  • I Created a new Security Group with the following inbound rules: by typing: SSH|Port:22|Source:0.0.0.0/0 by typing: HTTP/Port:80/Source:0.0.0/0 This will allows you to SSH into instance and access the web server in the browser.

![ ](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ei9byfv7ed5ged3odn2r.png

STEP 6 : Choose Storage

  • Use the default : 8 GB gp2/gp3 SSD

STEP 7 : Skip Advanced Settings

  • No changes needed for now'

STEP 8 : Review and Launch

  • Double click everything, then click Launch Instance

              * *   PART 2    **
        TO  CONNECT EC2  INSTANCE  VIA  SSH

        The Requirements are as follows :
Enter fullscreen mode Exit fullscreen mode
  • Click to EC2 Instance

EC2 INSTANCE ID : i-06b4e224e01425b3c
KEY PAIR : my-2P-key.pem
PUBLIC IPv4 : 184.72.66.42

  • Wait for the instance status to be running

      ""  USING  GitBash  as a window  ""
Enter fullscreen mode Exit fullscreen mode

STEP 1 : Open Git Bash (Searching Git Bash on Google search/downloading it as a window on my computer )

STEP 2 : Navigate to your key file :

Then type : cd Downloads

STEP 3 : Secure the key file :

Then type : chmod 400 my-2P-key.pem

STEP 4 : Connect using SSH:
ssh -i "my-2P-key.pem" ec2-user@184.72.66.42

STEP 5 : Type yes when prompted

                  ** PART 3**
          TO INSTALL A WEB SERVER (APACHE)
Enter fullscreen mode Exit fullscreen mode

Run the following commands in the EC2 terminal :
sudo yum update-y


sudo yum install-y httpd

sudo systemctl start httpd

sudo systemctl enable httpd

              VERIFY IN BROWSER
Enter fullscreen mode Exit fullscreen mode

--- Open a web browser
--- Go to : http://<184.72.66.42>
--- You should see the Apache test page :

N : B ==> I downloaded the Public IP address to a browser and open it, using an Apache application to show this particular verification.
Here below is the web browser i downloaded , to show the
verification.

Top comments (1)

Some comments may only be visible to logged-in visitors. Sign in to view all comments.