How to Launch Your First EC2 Instance: Step-by-Step Beginner Guide
6/8/2026
One of the first practical skills every AWS learner should master is launching an Amazon EC2 instance.
Amazon EC2 (Elastic Compute Cloud) allows you to create virtual servers in the cloud within minutes. Whether you're hosting a website, deploying an application, setting up a development environment, or learning cloud computing, EC2 is often the starting point.
In this guide, you'll learn exactly how to launch your first EC2 instance using the AWS Management Console. By the end, you'll have a running Linux server that you can access remotely from your computer.
What You'll Build
In this tutorial, you'll:
- Launch an EC2 instance
- Select an operating system
- Configure security settings
- Create a key pair
- Connect using SSH
- Understand each configuration option
No prior AWS experience is required.
Prerequisites
Before starting, ensure you have:
AWS Account
Create an AWS account if you don't already have one.
Basic Networking Knowledge
Understanding concepts such as:
- IP Addresses
- Ports
- SSH
is helpful but not mandatory.
AWS Free Tier
Many beginner EC2 configurations are eligible for AWS Free Tier usage.
What Is an EC2 Instance?
An EC2 instance is a virtual server running inside AWS.
Think of it as renting a computer in AWS's data center.
You can:
- Install software
- Run applications
- Host websites
- Store files
- Configure networking
just as you would on a physical server.
Step 1: Sign In to AWS
- Open the AWS Management Console.
- Sign in to your AWS account.
- Search for EC2 in the AWS search bar.
- Select EC2 from the services list.
You will now see the EC2 Dashboard.
Step 2: Launch Instance
On the EC2 Dashboard:
- Click Launch Instance
- Enter a name
Example:
MyFirstEC2Server
Naming resources properly helps manage infrastructure as projects grow.
Step 3: Choose an Amazon Machine Image (AMI)
An AMI contains:
- Operating System
- Configuration
- Software packages
Common AMI choices include:
Amazon Linux
Recommended for AWS beginners.
Benefits:
- AWS optimized
- Lightweight
- Secure
Ubuntu
Popular among developers.
Windows Server
Useful for Windows-based applications.
For this tutorial:
Select:
Amazon Linux 2023
Step 4: Select an Instance Type
AWS offers many instance types.
For beginners:
t2.micro
or
t3.micro
These are:
- Low cost
- Suitable for learning
- Often Free Tier eligible
Step 5: Create a Key Pair
A key pair allows secure access to your server.
Click:
Create New Key Pair
Example:
my-first-key
Choose:
.pem
AWS will automatically download the file.
Important:
Store this file safely.
If you lose it, accessing your server becomes difficult.
Step 6: Configure Network Settings
AWS automatically creates a default VPC for new accounts.
For beginners:
Keep default networking settings.
Next configure security rules.
Step 7: Configure Security Group
A Security Group acts as a firewall.
Add the following inbound rule:
SSH
Port:
22
Source:
My IP
This allows only your computer to connect.
For web hosting later, you may also allow:
HTTP
Port 80
HTTPS
Port 443
For now:
Only SSH is required.
Step 8: Configure Storage
By default AWS creates an EBS root volume.
Example:
8 GB gp3
For learning purposes:
Default storage is sufficient.
Remember:
EBS stores:
- Operating system
- Files
- Applications
and remains available even if the instance stops.
Step 9: Review Configuration
Review:
Name
MyFirstEC2Server
AMI
Amazon Linux
Instance Type
t2.micro or t3.micro
Key Pair
my-first-key
Security Group
SSH allowed
Storage
8 GB gp3
If everything looks correct:
Click:
Launch Instance
Step 10: Wait for Instance Startup
AWS begins provisioning resources.
Instance states:
Pending
Server is being created.
Running
Server is ready.
This usually takes less than a minute.
Understanding Public IP Addresses
When an instance launches, AWS assigns:
Private IP
Used within AWS networks.
Example:
10.0.1.15
Public IP
Used for internet access.
Example:
52.xx.xx.xx
You'll use the Public IP to connect.
Step 11: Connect to Your Instance
Select your instance.
Click:
Connect
AWS offers multiple connection methods.
Method 1: EC2 Instance Connect
Simplest method.
Requirements:
- Browser access
- Supported operating system
Click:
Connect
AWS opens a browser terminal.
You are now connected.
Method 2: SSH from Terminal
Linux/macOS:
chmod 400 my-first-key.pem
ssh -i my-first-key.pem ec2-user@PUBLIC-IP
Example:
ssh -i my-first-key.pem ec2-user@54.10.20.30
Successful connection displays:
[ec2-user@ip-10-0-1-15 ~]$
Verify Your Server
Run:
uname -a
View operating system details.
Run:
df -h
Check storage.
Run:
free -m
Check memory usage.
Congratulations.
Your EC2 instance is now operational.
Installing a Web Server
Let's install Apache.
Update packages:
sudo dnf update -y
Install Apache:
sudo dnf install httpd -y
Start Apache:
sudo systemctl start httpd
Enable auto-start:
sudo systemctl enable httpd
Testing the Website
Open your browser.
Navigate to:
http://PUBLIC-IP
You should see the Apache test page.
Your first web server is now running on AWS.
Stopping vs Terminating
Understanding the difference is critical.
Stop
- Server shuts down
- EBS data remains
- Can restart later
Terminate
- Instance deleted
- Cannot restart
- May permanently remove resources
Always stop or terminate unused instances to avoid unnecessary charges.
Common Beginner Mistakes
Losing Key Pair Files
Keep backups securely.
Opening SSH to Everyone
Restrict access to your IP whenever possible.
Forgetting Security Group Rules
Applications may become inaccessible.
Leaving Instances Running
Can generate charges.
Terminating Instead of Stopping
May result in data loss.
EC2 Launch Workflow Summary
- Open EC2 Dashboard
- Launch Instance
- Select AMI
- Choose Instance Type
- Create Key Pair
- Configure Security Group
- Configure Storage
- Launch Instance
- Connect via SSH
- Install Applications
This workflow forms the foundation of AWS administration.
Interview Questions
What is an EC2 instance?
A virtual server running in AWS.
What is required to launch an instance?
AMI, instance type, networking, storage, and security configuration.
Why are key pairs used?
Secure authentication for server access.
Which port is used for SSH?
Port 22.
What storage service is commonly attached to EC2?
Amazon EBS.
Conclusion
Launching an EC2 instance is often the first hands-on AWS task and introduces many core cloud concepts including virtual servers, storage, networking, security groups, and key pairs.
Mastering this process provides a foundation for nearly every AWS workload. Once you're comfortable launching instances, you'll be ready to explore AMIs, Security Groups, Key Pairs, Elastic IPs, Auto Scaling, Load Balancers, and advanced cloud architectures.