How to Create an EC2 Instance on AWS (Beginner Guide)
Code Shelf
Published on February 21, 2026
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
- Go to https://aws.amazon.com
- Click Sign in to the Console
- Enter your AWS credentials
4. Step 2: Launch an EC2 Instance
- Open the EC2 Dashboard
- Click Launch Instance
- 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
- Create a new key pair or use an existing one
- Download the
.pemfile - 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:
1 ssh -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!