Launching Amazon EC2 Instances
Published: 2023-08-06 10:12:01

Amazon Web Services (AWS)is one of the largest [cloud service providers](https://nioyatech.com/top-9-cloud-service-providers/) in the world. AWS offers scalable computing power through the Amazon Elastic Compute Cloud (Amazon EC2). In “AWS EC2 Basics — I” I explained the basics of AWS EC2 Service. In this article, I will explain how to launch an EC2 instance using AWS Console.

In the AWS Cloud, a virtual server is known as an instance. From an Amazon Machine Image, you launch an instance (AMI). The operating system, application server, and apps for your instance are provided by the AMI.


## AWS EC2 Instances
Before you start launching an EC2 instance, there are some prerequisites that you’ve to complete. First, you have to sign up for AWS account. Your AWS account is automatically set up for all AWS services, including Amazon EC2, when you sign up for Amazon Web Services.

You just pay for what you use when using Amazon EC2 and if you are a new AWS subscriber Amazon EC2 can be launched for free. The AWS Free Tier provides customers the ability to explore and try out AWS services free of charge up to specified limits for each service.

To protect the login details for your instance, AWS employs public-key cryptography. When launching your instance, give the name of the key pair, and when using SSH to log in, give the private key.

If you haven’t previously done so, you can create a key pair through the Amazon EC2 dashboard. See the documentation. You can also create a new key pair when launching an EC2 instance.

## Sign in and Go to EC2 Service
When you signed in it navigates to the console home page. Console Home displays widgets with important information about your AWS environment. On top menu, you can either search the EC2 service from the search bar or select it from the services menu and navigate to EC2 console dashboard.


![Sign-in to AWS](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7ctx2jnr90eogy09ox99.png)


## launch an instance
From the EC2 console dashboard, in the Launch instance box, choose Launch instance, and then choose Launch instance from the options that appear.


![Launching EC2](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2qabucc34ws68tm3qn6i.png)


Under Name and tags, for Name, enter a descriptive name for your instance. You can also add a tag but it is optional.


![EC2 instance name](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vufkzdul7b8fe1xkg5pi.png)

Under Application and OS Images (Amazon Machine Image), do the following:

Choose Quick Start, and then choose Amazon Linux. This is the operating system (OS) for your instance.
From Amazon Machine Image (AMI), select an HVM version of Amazon Linux 2. Notice that these AMIs are marked Free tier eligible. An Amazon Machine Image (AMI) is a basic configuration that serves as a template for your instance.

![EC2 AMI](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4v2rr00pzmvpk4qpgrqs.png)


You can choose the hardware setup for your instance under Instance type from the Instance type list. Select the t2.micro instance type, which is the default option. The free tier is available for the t2.micro instance type. You can also utilize a t3.micro instance on the free tier in regions where t2.micro is not accessible.


![EC2 Instance Types](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/as1t48p422y0fyjafa1a.png)


Under Key pair (login), for Key pair name, choose the key pair that you created when getting set up. If you want to use a new key pair you can also create a new one by clicking the “Create new key pair” button on the right side.

![EC2 Keypair](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yug4dbwkxhruukmpkuhw.png)

After selecting the key pair, now we will choose or create a security grup. Pick Edit next to Network options. You’ll notice that security groups are under the Security group name. You can do the followings:

Choose an existing security group.
Select your security group from the list of available security groups under Common security groups.
You can see that a General Purpose SSD (GP2) root volume of 8GB has been automatically provisioned for the instance in the Configure Storage step. Changes to volume types, size, and additional volumes are all possible. But for this launch keep the default selections.

![EC2 Storage Types](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n5qyyjmlzaz2leup1il6.png)

Now every step is completed and when you’re ready, select “Launch instance” after reviewing a summary of your instance configuration in the Summary panel.


![EC2 Launching Summary](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vvproyqicokqjdfzx2w6.png)

A confirmation page lets you know that your instance is launching. Choose View all instances to close the confirmation page and return to the console.

![View EC2 Instances](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/elfft1ln1c7g0usxzmx5.png)

On the Instances screen, you can view the status of the launch. It takes a short time for an instance to launch. When you launch an instance, its initial state is pending. After the instance starts, its state changes to running and it receives a public DNS name.

![EC2 Instances Dashboard](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2f97tptihz2nm4g9w8bu.png)


In this article, we created an on-demand EC2 instance. It’s an on-demand server, so you can “Stop” it when it’s not needed to reduce costs. Based on your preferred OS platform, you can provision any of Linux or Windows EC2 instance or any of the available AMIs in the AWS Marketplace.

In next article, we will create an auto scaling group and learn to create ec2 with “launch template” option.

This article was originally published at https://www.linkedin.com/pulse/aws-ec2-basics-ii-launching-instance-samuel-i-g-/