DEV Community

Cover image for Amazon EC2 Instance
Mubeen Babar
Mubeen Babar

Posted on • Edited on

Amazon EC2 Instance

Amazon Elastic Compute Cloud (EC2) is a web service that provides secure, resizable compute capacity in the cloud. It is designed to make web-scale cloud computing easier for developers and businesses by offering virtual servers, known as instances, that can be tailored to meet specific needs. Here is a step-by-step guide to creating an EC2 instance:

Step 1: Access the AWS Console

Log into your AWS account via the https://aws.amazon.com/console/
Navigate to EC2, From the console homepage, click on Services and select EC2 under the "Compute" category.

Image description

Step 2: Launch Instance

Click on the Launch Instance button to start the instance creation process. This will open the "Launch Instance."

  • Give the Name (Should be unique)
  • Choose an Amazon Machine Image (AMI) Select AMI: AMIs are pre-configured templates for your instances. Choose an appropriate AMI from the list of available options, such as:
  • Amazon Linux 2 Custom AMIs: You can also use custom AMIs if you need specific software configurations or want to launch an instance from a previous backup.

Image description

Step 3: Choose an Instance Type

Select the instance type based on the required CPU, memory, storage, and networking capacity. Common instance types include:

  • t2.micro: Free tier eligible, suitable for low-traffic applications.
  • r5.large: Memory-optimized for applications with significant memory requirements.

Specifications upto you how much you need, Each instance type has specific CPU cores, memory size, storage options, and network performance.

Create a key pair for getting the access to the virtual machine. There are two types of key pairs you can download.
1- .PEM (For SSH)
2- .PPK (For Putty)
Here i downloaded .PEM File to access by SSH through my Command Line.

Image description

Step 4: Network Settings

  • Select the Virtual Private Cloud (VPC) where the instance will reside.
  • Choose the subnet that aligns with your instance's geographical or logical needs.
  • Auto-assign Public IP, Decide if you need a public IP address to access the instance over the internet.

Step 5: Configure Storage

  • Volume Type, Specify the type of storage, such as General Purpose SSD (gp2), Provisioned IOPS SSD (io1), or Magnetic.
  • Size: Define the storage capacity in GiB.
  • Additional Volumes: Optionally, add more volumes for additional storage requirements.

Step 6: Review and Launch

  • Review: Double-check all configurations to ensure they meet your requirements.
  • Launch: Click the Launch button to start the instance creation process.

Image description

Step 7: Access the Instance

  • Connect: Once the instance is running, connect using the preferred method:
  • SSH: Use the terminal or an SSH client for Linux-based instances.
  • Public DNS: Use the public DNS name or IP address to connect remotely.

By clicking on Connect which is located on top.

Image description

Now Choose the method to connect(SSH)

  • Open CMD and go to the path where .PEM file is located
  • Copy the SSH command and paste it in CMD and press Enter.

Image description

Here you can see we get access to our Instance/Virtual Machine (Amazon Linux) we created...

Image description

By following these steps, you can effectively create and manage EC2 instances , providing the flexibility and scalability required for various applications and workloads.

Top comments (0)