☁️ Free VM on AWS

Setting Up a Free Tier VM on Amazon Web Services (AWS)

Prerequisites

- An email address and a phone number for verification
- A credit or debit card for identity verification (AWS requires one, even for free accounts)
- A terminal with SSH (Linux, macOS, or Windows 10+ PowerShell)

How the AWS free tier works (check this first)

AWS changed its free tier for accounts created on or after July 15, 2025. Which one you get depends on when your account was created, so confirm on the AWS Free Tier page before you start.

- New accounts (July 15, 2025 or later): you choose a "Free plan" for up to 6 months. It comes with about $100 in credits (plus more for completing starter activities). The plan ends when the 6 months pass or the credits run out, whichever is first. Then you must upgrade to a paid plan or the account closes.
- Older accounts (before July 15, 2025): the classic 12-month free tier. It includes 750 hours/month of a t2.micro or t3.micro instance, 30 GB of EBS storage, and 100 GB/month of data transfer out.
- Some services are limited on the Free plan, and only certain instance types are covered. The launch wizard marks eligible ones with a "Free tier eligible" label. Trust that label over anything written here.

Step 1: Create an AWS Account

1. Go to aws.amazon.com and click "Create an AWS Account"
2. Enter your email, choose an account name, and verify the email address
3. Set a strong root password
4. Choose the Free plan when asked (or the account type that matches your goal)
5. Add your card and verify your phone number
6. Finish sign-up and sign in to the AWS Management Console

Step 2: Secure the Account

1. Turn on MFA for the root user: click your account name (top right) → Security credentials → Assign MFA device
2. Do not use the root user for daily work. Create an admin user in IAM (or IAM Identity Center) and sign in as that user instead
3. Set a budget alert before you launch anything (see "To Stay Free" below)

Step 3: Launch the Free Tier VM (EC2)

1. In the console search bar, type EC2 and open it
2. Top right, choose a Region close to you (for example us-east-1 or us-west-2) and stay in that region
3. Click "Launch instance"
4. Name: free-vm
5. Application and OS Images: Ubuntu Server 22.04/24.04 LTS or Amazon Linux 2023 (look for "Free tier eligible")
6. Instance type: t3.micro (or t2.micro if that is what your region shows as free tier eligible)
7. Key pair (login): click "Create new key pair"
   - Name: free-vm-key
   - Type: RSA (or ED25519), format .pem
   - Save the downloaded file. You cannot download it again
8. Network settings: click Edit
   - Allow SSH traffic from: "My IP" (not 0.0.0.0/0)
   - Leave HTTP/HTTPS unchecked for now
9. Configure storage: 8 GB gp3 is fine (up to 30 GB is free on the classic tier)
10. Review the summary on the right (it shows the free tier eligibility) and click "Launch instance"

Step 4: Connect to Your VM

1. Protect your key file:
chmod 400 ~/Downloads/free-vm-key.pem
2. In EC2 → Instances, select your instance and copy the Public IPv4 address
3. Connect (user is ubuntu for Ubuntu, ec2-user for Amazon Linux):
ssh -i ~/Downloads/free-vm-key.pem ubuntu@PUBLIC_IP
4. Or use the browser: select the instance → Connect → EC2 Instance Connect → Connect

Step 5: Basic Setup

Once in the VM (Ubuntu shown; on Amazon Linux use dnf instead of apt):
sudo apt update && sudo apt upgrade -y
sudo apt install -y nginx  # example
sudo systemctl enable --now nginx

To serve web traffic, open the ports in the security group (not just the OS firewall):
1. EC2 → Instances → your instance → Security tab → click the security group
2. Edit inbound rules → Add rule
3. HTTP (port 80) and HTTPS (port 443) from Anywhere (0.0.0.0/0) if the site is public
4. Keep SSH (port 22) limited to your own IP

Important Limits & Warnings

- Instance hours: 750 hours/month covers one instance running 24/7 (classic tier). On the Free plan, credits are used as you go.
- Storage: 30 GB of EBS on the classic tier. Extra volumes and snapshots cost money.
- Data transfer: 100 GB/month out to the internet is free; more is billed.
- Public IPv4 addresses are billed by the hour (about $0.005/hour, roughly $3.60/month each). The classic tier includes 750 hours/month for one address. Extra addresses do not.
- Danger zones that cost money:
  - Larger or non-eligible instance types (for example t3.medium or anything with a GPU)
  - Elastic IPs that are allocated but not attached to a running instance
  - NAT Gateways (about $32/month, easy to create by accident with the VPC wizard)
  - Load balancers, RDS databases, and unattached EBS volumes
  - Running instances in more than one region at the same time
  - Leaving snapshots and old AMIs behind

To Stay Free

1. Set a budget alert first: Billing and Cost Management → Budgets → Create budget → "Zero spend budget" (emails you at any charge) or a $1 monthly cost budget
2. Turn on Free Tier usage alerts: Billing preferences → "Receive Free Tier Usage Alerts"
3. Stop the instance when you are not using it (a stopped instance stops compute charges, but EBS storage and any Elastic IP still bill)
4. Check the Billing dashboard and the Free Tier page weekly (Billing → Free Tier) to see how much you have used
5. Stay in a single region so nothing hides somewhere you forgot about

Cleanup When Done

1. EC2 → Instances → select the instance → Instance state → Terminate instance
2. EC2 → Volumes → delete any volumes left behind (state "available")
3. EC2 → Elastic IPs → release any that are allocated
4. EC2 → Snapshots and AMIs → delete anything you created
5. EC2 → Key pairs and Security groups → delete the ones you made (optional)
6. Confirm the account is at $0 in Billing → Bills the next day

Quick Verification

Check the instance state and IP from the command line (needs the AWS CLI configured with aws configure):
aws ec2 describe-instances --query 'Reservations[].Instances[].[InstanceId,State.Name,PublicIpAddress]' --output table

List anything that could still be billing you:
aws ec2 describe-volumes --query 'Volumes[].[VolumeId,State,Size]' --output table
aws ec2 describe-addresses --query 'Addresses[].[PublicIp,AssociationId]' --output table

Biggest gotchas: a running instance you forgot about, an Elastic IP left allocated, and a NAT Gateway. Also, the free period ends: on new accounts after 6 months or when the credits run out, on older accounts after 12 months. Put the end date in your calendar and terminate everything before it.

Free tier terms change. Verify current limits at aws.amazon.com/free before relying on any number in this guide.

Need help with a specific use case (web server, VPN, bot, etc.)?