CodeShelf
Beginner8 min read

How to Create an EC2 Instance on AWS (Beginner Guide)

Learn how to create and launch an Amazon EC2 instance step-by-step using the AWS Management Console. This beginner-friendly tutorial covers selecting an AMI, choosing instance type, configuring security groups, and connecting to your server.
AWS
C

Code Shelf

Published on February 21, 2026

191 views0 likes

1. What is Amazon EC2?

Amazon Elastic Compute Cloud (EC2) is a web service that provides secure and resizable compute capacity in the cloud. It allows developers to run virtual servers on AWS infrastructure without managing physical hardware.

2. Prerequisites

Before creating an EC2 instance, make sure you have:

  • An AWS account
  • Basic knowledge of cloud computing
  • A web browser and internet connection


3. Step 1: Login to AWS Console

  1. Go to https://aws.amazon.com
  2. Click Sign in to the Console
  3. Enter your AWS credentials

4. Step 2: Launch an EC2 Instance

  1. Open the EC2 Dashboard
  2. Click Launch Instance
  3. Enter a name for your instance

5. Step 3: Choose an Amazon Machine Image (AMI)

Select an operating system for your instance such as:

  • Amazon Linux
  • Ubuntu (preferred)
  • Windows Server

6. Step 4: Choose Instance Type

Select the instance type (e.g., t2.micro or t3.micro).

The Free Tier eligible instance is recommended for beginners.

7. Step 5: Configure Key Pair

  1. Create a new key pair or use an existing one
  2. Download the .pem file
  3. Keep it secure (you’ll need it to connect via SSH)

8. Step 6: Configure Security Group

Add inbound rules to allow traffic:

  • SSH (port 22)
  • HTTP (port 80)
  • HTTPS (port 443)


9. Step 7: Launch the Instance

Review the settings and click Launch Instance.

Your virtual server will start in a few seconds

10. Step 8: Connect to EC2 Instance

Use SSH to connect:

1ssh -i your-key.pem ec2-user@your-public-ip

11. Conclusion

You have successfully created and launched an EC2 instance on AWS. You can now install software, host websites, or run applications on your cloud server.

Comments (0)

Loading...

No comments yet. Be the first to comment!