This content originally appeared on DEV Community and was authored by zach beecher
Learning cloud I wanted a place I can quickly find a step by step guide to launch VPC and EC2:
Quick AWS Management Console steps (visual, good for first-time use)
1 — Overview
A custom VPC (10.0.0.0/16).
A public subnet (10.0.1.0/24) with auto-assign public IPs.
An Internet Gateway (IGW) and a route for 0.0.0.0/0 → IGW.
A security group allowing SSH (22) from your IP and HTTP (80) from anywhere (optional).
A key pair to SSH.
One EC2 instance (Amazon Linux 2 example) in the public subnet.
2 — Console steps (fastest visually)
Sign in to the AWS Console and pick a region (top-right).
Go to VPC service → Your VPCs → Create VPC:
Name: my-vpc
IPv4 CIDR block: 10.0.0.0/16
Create.
Enable DNS hostnames (if not auto-enabled): select VPC → Actions → Edit DNS hostnames → Enable.
Create subnet: Subnets → Create subnet:
VPC: my-vpc
Name: public-subnet-1
IPv4 CIDR: 10.0.1.0/24
AZ: pick one (e.g., us-east-1a)
Create.
Then, with subnet selected: Actions → Modify auto-assign IP settings → enable Auto-assign public IPv4 address.
Internet Gateway: Internet Gateways → Create internet gateway → name my-igw → Create, then Attach to my-vpc.
Route table: Route Tables → create a route table for my-vpc (name public-rt). Edit routes: add route 0.0.0.0/0 → target: my-igw. Then Subnet Associations → Associate public-subnet-1.
Security group: EC2 → Network & Security → Security Groups → Create security group:
Name: my-sg, VPC: my-vpc
Inbound rules: SSH (TCP 22) — Source: Your IP (use “My IP” option); HTTP (TCP 80) — Source: 0.0.0.0/0 (if you want web).
Create.
Key pair: EC2 → Key Pairs → Create key pair → give name my-key → download .pem and store securely; chmod 400 my-key.pem.
Launch EC2:
EC2 → Instances → Launch instances.
Choose an AMI (e.g., Amazon Linux 2 or Ubuntu — note username differs).
Instance type: t3.micro or t2.micro (free-tier eligible if your account qualifies).
Under Network settings: VPC: my-vpc, Subnet: public-subnet-1, Auto-assign Public IP: enabled.
Select Security group: my-sg.
Key pair: my-key.
Launch.
After instance status is running, grab the Public IP and SSH:
Amazon Linux 2 → ssh -i my-key.pem ec2-user@PUBLIC_IP
Ubuntu → ssh -i my-key.pem ubuntu@PUBLIC_IP
Under the user settings on Ec2 add this bash script to pull in a website template if you want to show your friends.
#!/bin/bash
sudo yum update -y
sudo yum upgrade -y
sudo yum install httpd -y
sudo yum install unzip -y
sudo wget --no-check-certificate 'https://drive.google.com/uc?export=download&id=1wO2DwQ5KgiBeP9dg51H6hw95et89WlUo' -O tempsite.zip
sudo unzip tempsite.zip -d /var/www/html
sudo mv /var/www/html/tempsite/* /var/www/html/
sudo systemctl enable httpd
sudo systemctl start httpd
courtesy of: https://syang.substack.com/p/think-of-aws-vpc-like-a-parking-lot
OFC There’s a faster way to launch VPC and Ec2 but this is breaking down each step and it’s important to know what subnets are doing (10.0.0.0/16 (~65k IPs, -5 for amazon), internet gateway, Routes, Ec2 runs on VPC so if you know Ec2 is having issues, check the routes, subnets, do they have access to Internet gateway (auto resolved hosts or assigned Public IP) – go through the check list in order.
Fascinating stuff. Can’t wait to learn more
This content originally appeared on DEV Community and was authored by zach beecher