Thursday, April 25, 2024
AWSCloudHow ToTech/WebTutorials/DIY

How to Launch EC2 Instance in AWS

In this tutorial, You are going to see how to launch EC2 Instance in AWS using the AWS management console and also see how to connect with EC2 Instance in Windows ( using GIT) and Linux OS.

Amazon EC2 (Amazon Elastic Compute Cloud) offers AWS Services with elastic computing capabilities. AWS EC2 is a virtual machine in the cloud on which you have OS level control. You can run this cloud server whenever you want. It removes the need to spend front-end in infrastructure, so you can faster build and launch applications. AWS EC2 Instances allow you to scale up and down to accommodate shifts in specifications or popularity surges while reducing the need for traffic forecasting.

You may like also:  What is AWS ? | Amazon Cloud Services


What is IoT Platforms?

The IoT cloud is a platform for storing, analyze and processing data from the “Things” on the internet and designed to capture and process the massive amounts of data generated by internet-connected devices, sensors, web sites, customers and other connected applications. Basically a IoT cloud platform includes features like connectivity, network management, device management, data acquisition, processing analysis and visualization, application enablement, integration, and storage.

You may like also : Top 10 IoT Cloud Platforms


You can Launch it as per the requirement of Applications.

  • General Purpose – Provide a combination of energy for computing, memory, and networking, and can be used for a variety of different workloads.
  • Compute Optimized – Suitable for computation dependent application that provides the benefits for high-performance computing operations likes Workloads for batch processing, media transcoding, high-performance web servers, high-performance computing (HPC), research simulation, etc.
  • Memory-Optimized – Designed to deliver the fast output to workloads that handle large memory data sets.
  • Accelerated Computing – Accelerated computation instances employ hardware accelerators, or co-processors, to perform functions more effectively than is feasible in software running on CPUs, such as floating-point number comparisons, image rendering, or matching data patterns.
  • Storage Optimized – Storage-Optimized Instances are designed for workloads that require access to very large sets of local storage for fast, sequential read and write.

How to Launch EC2 Instance in AWS

First, Login to your AWS Management Console Click on Services you can see on the top of the AWS Management Console.

Here Select EC2 you will Navigate to EC2 Dashboard. Click on Launch Instance to Launch EC2 Instance. Select AMI.

Note: Amazon Machine Image (AMI) is a special type of  Operating System Images used in the Amazon Elastic Compute Cloud (“EC2”) to create a Cloud Machine or Virtual Machine. This acts as the main deployment center for resources supplied utilizing EC2.

After that, You have to choose the type of instance. In this tutorial, we are going with general-purpose T2.micro which is eligible for free use if you have a new account for practice purposes. then click on Next for configuring Instance Details.

Now, Configure Ec2 Instance Details Likes number of Instances you want to Launch, Select Network means on which VPC you want to Launch EC2 Instance, subnet auto-assign Public IP, etc

How to Launch EC2 Instance in AWS

Check on Enable-Termination Protection to avoid accidental termination on Instances. Tap Add Storage to Next.

Adding Storage to EC2 Instance we will get 30GB of free storage of General Purpose SSD and Click on Next for Tagging

You may add a key-value pair to your case. It allows the AWS account owner insight when there are many examples. The instances should be labeled according to their branch, such as Dev / SIT / Prod climate. It gives a clear picture of the expense under a specific tag on the instances. then Security Group customize.

A security group is a set of rules governing the instance traffic via the firewall.

  • create a new security group or select use an existing one.
  • Name your security group.
  • Allow Particular IP address to access our instance

Once Security Groups configure and set of firewall rules sets, click on Review and Launch EC2 Instances

After reviewing details click on launch. Before AWS Launch your Instance. AWS navigate you to download the Private key of your instance.

  • create a new key or you can use an existing key.
  • name a key When you create a new pair of keys.
  • Click on the Download buttons to download key pairs.

After downloading Key pair Click on Launch Instance.

Click on View Instance to verify your Instance is launch and ready to use.

Name your Instance, Check the instance state It in Running state means it ready to connect.

Click on the connect button you will get a step How to connect to EC2 Instance for Windows how to launch ec2 instance in aws how to launch ec2 instance in aws ( using GIT/Putty) and Linux ( using Terminal ) users.

Connect EC2 Instance in Windows using GIT

Download GIT for windows Click Here to download GIT

Install GIT in Windows you will get the BASH Shell Like a Linux in Windows.

Right-Click Select GIT Bash Here Start Bash Shell in Windows

Go to the Download folder where your Private Key( key name.pem) is store.

$ cd /user/Downloads

Change the permission of the private key using chmod command

$ chmod 400 demokey.pem
  • then used ssh command to securely login to EC2 Instance with -i option and run commands as you see in the below images.

How to Launch EC2 Instance in AWS

If everything is gone correct, you can see in the above images we successfully log in to EC2 Instance.

Connect EC2 Instance in Linux

  • Open Terminal in Your Linux OR Press CTRL + ALT + T
  • Go to the Download folder where your is a Private store using cd Command
cd Download
  • Change the permission of the private key using the chmod command
sudo chmod 400 privatekey.pem
  • then used ssh command to securely login to EC2 Instance with -i option and run commands as below
ssh -i "demokey.pem" <name_ec2instance>@<DNS/PublicIP>

 


I hope you like this post. Do you have any questions? Leave a comment down below!

Thanks for reading. If you like this post probably you might like my next ones, so please support me by subscribing my blog.

Harshvardhan Mishra

Hi, I'm Harshvardhan Mishra. Tech enthusiast and IT professional with a B.Tech in IT, PG Diploma in IoT from CDAC, and 6 years of industry experience. Founder of HVM Smart Solutions, blending technology for real-world solutions. As a passionate technical author, I simplify complex concepts for diverse audiences. Let's connect and explore the tech world together! If you want to help support me on my journey, consider sharing my articles, or Buy me a Coffee! Thank you for reading my blog! Happy learning! Linkedin

Leave a Reply

Your email address will not be published. Required fields are marked *