Quantcast
Channel: Cloud Training Program
Viewing all articles
Browse latest Browse all 1890

All You Need To Know About a Linux EC2 Instance

$
0
0

In this blog, I will cover everything about the Linux EC2 Instance Service of AWS Amazon Web Services from scratch.

It will provide you with everything that you need to in order to work with EC2 Instance on the console.

Linux EC2 Instance

  • EC2 stands for Elastic Compute Cloud.
  • Virtual Machines in AWS are called instances.
  • An EC2 instance is a virtual server in Amazon’s Elastic Compute Cloud for running applications on the Amazon Web Service infrastructure.
  • It is a web service provided by AWS for secure and realizable compute capacity which has made deployment faster and easier.
  • AWS provides a variety of instances with different configurations of CPU, memory, and storage depending on the needs of the user.

How To Create A Linux EC2 Instance

  1. Open the AWS console and Search for EC2 in the search bar and open it.
    EC2 Console
  2. Once you are at the EC2 Dashboard, click on Launch to launch an instance.
    EC2 Launching
  3. Now under the Name, type Value as Webserver and Scroll Down. Tags are added just for specifying names in the key and value field.
    Launching EC2 Instance
  4. Choose Amazon Linux 2 AMI, select 64-bit (x86) architecture and Scroll Down.
    Note: Here, in the above step we are selecting the Amazon Linux 2 AMI which is basically preconfigured with some tools installed on it as Amazon Linux 2 AMI comes with AWS CLI pre-installed. AWS CLI is basically the Command Line Interface provided by AWS to access any of their services using CLI.Launching EC2 Instance
  5. For Select the micro instance type, if you want you may select another instance type but they are chargeable so we choose the t2.micro instance type which is eligible for the free tier and limited resources.
    Instance Type
    Note: Here we must choose the instance type as t2.micro because it is free tier eligible, i.e. you won’t be charged for running the instance with this instance type as we need to perform the labs being in the free tier. So, please make sure you select the t2.micro as the instance type else you shall be charged for running instances from Paid AMI.
  6. Select an existing key-pair or create a new one, we will create a new one, enter the name of the Key-pair as Linux-Key and rest everything Default.
    Key PairKey Pair 2
  7. Here we can Configure Network Settings as per our need. We will keep VPC and Subnets as default. Click on Edit on the right side.
    Network Setting
  8. Click on Add Security Group Rule.
    Security Group
  9. Add HTTP, the source shall Anywhere 0.0.0.0/0 (IPv4) traffic.Security Group Rule
    Note: We add the HTTP rule here because we need to access our Webpage. As the communication for request and response between Webserver and Browser happens on port 80 which is HTTP.
  10. Now review all the things you have Configured and Click on Launch Instance.
    Launching Instance
  11. Now Click on View all Instances.
    Instance Launched
  12. Here, you shall see your instance is launching and the Status check is Initializing, wait for some time.
    Status Check
  13. Refresh and you shall see your instance is Up and Running, and the Status check has changed to 2/2 checks.

Status Check 2/2

Now, we have successfully created our first Linux Instance using EC2.

Note:  Now, wait for the Status check of the instance to change to 2/2 checks pass as the instance is launching from an AMI and it needs time to install all the preconfigured things like AWS CLI and other tools. So, please wait till the Status check becomes 2/2 checks pass and then only proceed with further steps, and if the status check has not passed then you shall get an error in the further steps so please wait.

Note: Now we have launched the instance successfully, further we need to access the instance so, we have two ways of accessing an instance-

  1. Accessing via Browser using EC2 instance Connect.
  2. Accessing using Putty (a Secure Shell SSH client).

In further steps, we shall see both ways to access Linux EC2 instances.

Accessing EC2 Instance Using Browser SSH Connection

Note: Till now, we have launched an instance successfully, but we need to access it to run commands so for accessing our instance the easy way is you can access the CLI directly from the browser using the EC2 instance connect that we shall see in further steps.

  1. Select your Instance and Click on Connect.
    Instance Connect
  2. Under EC2 Instance Connect, let everything default and click on Connect.
    EC2 Instance Connect
  3. Now you shall be redirected to a new window and you shall see the Linux CLI.AWS CLI

Related Links/References:

Next Task For You

Begin your journey towards becoming an AWS Certified Solutions Architect Associate SAA-CO2 by checking our FREE LIVE CLASS.

Click on the below image to download our FREE Live CLASS
Free Masterclass

The post All You Need To Know About a Linux EC2 Instance appeared first on Cloud Training Program.


Viewing all articles
Browse latest Browse all 1890

Trending Articles