DEV Community

Cover image for How To Create an EC2 Instance on AWS
Oyoh Edmond
Oyoh Edmond

Posted on

How To Create an EC2 Instance on AWS

In this guide, i will be demonstrating the process of setting up a Linux virtual machine on the cloud, specifically using Amazon EC2. Amazon Elastic Compute Cloud (Amazon EC2) is a service that offers scalable and secure compute resources in the cloud, functioning as Infrastructure as a Service (IaaS).

Pre-requisites

  1. An AWS account
  2. Familiarity with the AWS management console

Create EC2 Instance

- Sign in to the Amazon Management Console.

Image description


- From the navigation bar, choose a suitable geographic region that meets your requirements.
Tip: Choose a nearer geographic region from your location to get faster responses

Image description


- Search EC2 in the search bar, and click on it.

Image description


- In the EC2 dashboard, select instances.

Image description


- Click Launch instances.

Image description


- Give your instance a name.

Image description


- Select the appropriate AMI for your instance.

Image description

An Amazon Machine Image (AMI) is a pre-configured virtual machine image that is used to create EC2 instances.

It contains the software configuration (operating system, application server, and applications) required to easily and quickly launch your instance that is pre-configured with their desired operating system and application stack, saving significant time and effort in configuring and deploying new instances.


- Select an instance type and a key pair.

Image description

NB: Read for more


- Select create new key pair.

Image description


A key pair is a set of security credentials that are used to securely authenticate a user's login credentials to an EC2 instance.

It consists of two parts: a public key and a private key. The public key is shared with the instance, while the private key is kept secure by the user.


- Enter Key pair name.

Image description


AWS key pairs can be downloaded in .pem or .ppk formats.
The .pem format is commonly used with SSH clients on Unix/Linux systems.
The *.ppk file format * is a proprietary format used by PuTTY, a popular SSH client for Windows.

It is important to keep your private keys secure and should not be shared with others as anyone with access to your private key can gain access to your instance.

Key pair types
RSA encryption works for both windows and MacOs/Linux instances. ED25519 keys work with Linux and Mac instances only.'


- Enter your preferred network settings.

Image description


Your network settings include setting your VPC (Virtual Private Cloud) which is a virtual network infrastructure provided by AWS that allows users to launch resources in a logically isolated section of the AWS Cloud.

Your VPC enables you to create your own IP address ranges, subnets, route tables, security groups, etc.

AWS assigns a default VPC to every account, we'll use the default VPC and create a new security group that only allows SSH access to the instance.


Select Allow HTTPS traffic from the internet
Select Allow HTTP traffic from the internet to allow access to the EC2 webpage.



- Select the number of instances you want to create and review your selection, then click launch instance.

Image description

- The instance is running and has passed the checks

Image description


Conclusion
In this article, we discussed how to create an EC2 instance on AWS.

We covered the basic steps involved in launching an EC2 instance, including selecting an Amazon Machine Image (AMI), choosing an instance type, configuring security settings, and creating a key pair to connect to the instance.

We also discussed some important concepts related to EC2 instances, such as instance types, key pairs, and the free tier offering. Additionally, we provided a brief overview of VPCs and their importance in creating a secure and isolated environment in the cloud.

If you are new to AWS or cloud computing, creating an EC2 instance can be a great way to get started and learn about the benefits of cloud computing.

So, if you're interested in trying it out for yourself, sign up for an AWS account and launch your own EC2 instance today.

Top comments (2)

Collapse
 
ileriayo profile image
Ileriayo Adebiyi

This is succinct.

Well done bro.

Can you write on how to SSH into an AWS EC2 Instance?

Collapse
 
oyohalexandra profile image
Alexandra Oyoh Alison

Easy-to-digest and straight forward!