DEV Community

Cover image for Developer Journar Day5: ๐Ÿš€ How to Launch and Configure an Amazon EC2 Instance (From Scratch)
Lau!
Lau!

Posted on

Developer Journar Day5: ๐Ÿš€ How to Launch and Configure an Amazon EC2 Instance (From Scratch)

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:

  1. t3.micro
  2. 1 vCPU
  3. 1 GB RAM
  4. 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):

  1. 8 GB
  2. 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 ๐Ÿ‘

Top comments (0)