Setting Up a Free VM on Google Cloud Platform (GCP)
Prerequisites
- A Google account (Gmail)
- A credit card or other payment method for identity and payment verification (a $0 to $1 authorization hold may appear: it is not a charge)
How the Google Cloud free offers work (check this first)
There are two different things, and Google's page explains both at cloud.google.com/free. Confirm the current terms before you start.
- Free Trial: $300 of credit, valid for 90 days, for new customers only. It does not charge you when it ends. If you do not upgrade, the billing account closes and your resources stop after 90 days or when the $300 is spent, and a 30-day grace period begins in which you can upgrade to recover them. After that the data is permanently deleted.
- Free Tier (Always Free): ongoing monthly limits on selected products, with no end date, for trial and paid accounts alike. The one this guide uses: 1 non-preemptible e2-micro VM per month in us-west1, us-central1 or us-east1 (usage is added up across the three), 30 GB-months of standard persistent disk and 1 GB of outbound data.
- Once you upgrade to a paid account, anything beyond the free limits is billed to your card. Set a budget alert first. A full walkthrough of accounts, projects and budgets is in the Google Cloud account tutorial.
Step 1: Create a GCP Account
1. Go to console.cloud.google.com
2. Click "Select a project" → "New Project" → give it a name → Create
3. You'll be prompted to enable billing — use your credit card (GCP requires this to access the free tier, but won't charge if you stay within limits)
Step 2: Enable the Free Tier VM
1. In the left menu, go to Compute Engine → VM instances
2. Click "Create Instance"
3. Name your VM (e.g., free-vm)
4. Critical settings for free tier:
- Region: us-west1 (Oregon), us-central1 (Iowa), or us-east1 (South Carolina) — only these regions have the always-free VM
- Machine type: e2-micro (Google's current free tier page names only the e2-micro: older guides also mention f1-micro)
- Boot disk: Debian 12 or Ubuntu 22.04 (free tier eligible)
- Leave "Allow HTTP/HTTPS traffic" unchecked for now (we'll configure firewall rules in Step 4)
5. Click Create
Step 3: Connect to Your VM
- In the VM instances list, click the SSH button (opens browser-based terminal)
- Or use gcloud CLI:
gcloud compute ssh free-vm --zone=us-west1-a
Step 4: Basic Setup
Once in the VM:
sudo apt update && sudo apt upgrade -y
sudo apt install -y nginx # example
sudo ufw allow 22 # SSH
sudo ufw allow 80 # HTTP
sudo ufw allow 443 # HTTPS
Important Limits & Warnings
- Free tier: 1 non-preemptible e2-micro VM running 744 hours/month (always-on)
- Egress: First 1 GB/month free; after that charges apply
- Storage: 30 GB standard persistent disk free
- Danger zones that cost money:
- Custom machine types or higher-tier VMs
- Premium tier networking (use "standard" in networking settings)
- Static external IPs left idle or attached to a stopped VM (they are billed by the hour: check the current rate on Google's pricing page)
- Cloud SQL, Cloud Storage, etc.
To Stay Free
1. Stop the VM when not in use (stopped VMs don't use compute hours, but the disk and any static IP still cost money)
2. Delete the external IP if you don't need it (VM → Networking → edit → remove external IP)
3. Set a budget alert in Billing → Budgets & alerts → create budget at $1
Cleanup When Done
1. VM instances → delete
2. Compute Engine → Disks → delete
3. VPC network → External IP addresses → release
Quick Verification
Check your billing to confirm no charges:
gcloud billing accounts list
The $300 free credit (lasts 90 days) covers accidental spend while the trial lasts, but the true always-free tier can cost nothing at all if you stay disciplined. Free offers change: verify at cloud.google.com/free before relying on any number in this guide.
Biggest gotcha: leaving a static IP attached to a stopped VM — it keeps billing by the hour. Check the "External IP" column in the VM list and set to "Ephemeral" or release it.
Need help with a specific use case (web server, VPN, bot, etc.)?