When you start working with cloud computing on AWS, one of the first major milestones is understanding how EC2 instances work. In simple terms, it’s like spinning up your own server on the internet in just a few minutes.
In this article, I’ll walk you through how to create and launch an EC2 instance that works as a basic web server.
What is an EC2 instance?
An instance in Amazon Web Services, specifically within the Amazon EC2 service, is a virtual machine that you can configure based on your needs: CPU, memory, storage, and operating system.
Think of it as renting a computer in the cloud that you can start, stop, and customize anytime.
⚙️ Step 1: Create the instance
The first step is to go to the EC2 dashboard and click “Launch Instance.”
Here you define some key settings:
️ Instance name
You can assign a descriptive name such as:
“My Web Server”
This helps you easily identify it later.
Step 2: Choose the AMI
An Amazon Machine Image is basically the base image used to create your server.
In this case, we use Amazon Linux, a lightweight and optimized OS for cloud environments.
️ Step 3: Instance type
This defines the computing power of your virtual machine.
For this example:
- t3.micro
- 1 vCPU
- 1 GB RAM
Free Tier eligible This is perfect for learning and small projects.
Step 4: Key pair (SSH access)
To securely connect to your instance, you need a key pair:
Public key: stored in the instance
Private key: kept on your machine
This enables secure SSH access.
Step 5: Network settings
Here you control how your instance is accessed.
In this setup:
HTTPS traffic is allowed from the internet
A Security Group is used to manage inbound rules
This is what makes your server accessible from a browser.
Step 6: Storage configuration
You assign virtual disk storage (EBS):
8 GB
gp3 volume type Enough for a basic web server setup.
Step 7: User Data script (bootstrapping the server)
The base AMI only includes the operating system, so no web server is installed by default.
To fix this, we use User Data, which allows us to run a script at launch time that:
Installs a web server (like Apache or Nginx)
Starts and enables the service automatically
Prepares the instance to serve web content
Step 8: Launch the instance
Once everything is configured:
Click “Launch Instance”
AWS handles the rest: provisioning, setup, and booting your virtual machine.
Step 9: Access your server
After a couple of minutes, the instance will be in a running state.
Then:
Copy the public IP address
Open a browser
Paste the IP
And you’ll see your web server running
Conclusion
Launching an EC2 instance is one of the first essential steps in understanding cloud computing on AWS.
With just a few clicks, you can deploy a fully functional virtual server ready to host applications, APIs, or websites.
If you want, I can also help you next with:
adding AWS architecture diagrams
explaining VPC, subnets, and security groups visually
or turning this into a “Cloud Engineer roadmap series” post
Just tell me