Setting Up a Free VM on Oracle Cloud Infrastructure (OCI)
Prerequisites
- An email address and a phone number (for SMS verification)
- Credit card for identity verification (a small temporary verification charge is removed automatically, and you are not charged unless you upgrade)
How the Oracle Cloud free offers work (check this first)
There are two parts, described in Oracle's documentation (Free Tier, "Always Free Resources"). Confirm the current terms before you start.
- Free Trial: $300 in credits, valid for up to 30 days. When it ends the account stays active and the Always Free resources continue. Paid resources you created during the trial are reclaimed unless you upgrade.
- Always Free: a fixed set of resources with no time limit (listed in Step 2). Your Home Region decides where they can be created.
Step 1: Create an Oracle Cloud Account
1. Go to cloud.oracle.com and click "Start for free"
2. Fill in your email, verify it, then complete the signup form (name, address, phone)
3. Verify your phone number by SMS
4. Enter credit card details for identity verification
5. Pick a Home Region carefully — this CANNOT be changed later and determines where your free resources live
Step 2: Understand the Always Free Tier (better than most clouds)
Oracle's Always Free tier does not expire after 12 months like AWS/GCP/Azure trials — it is free forever:
- 2 AMD-based VMs: VM.Standard.E2.1.Micro (1/8 OCPU, 1 GB RAM each)
- AND/OR Arm-based VMs (Ampere A1, VM.Standard.A1.Flex): Oracle's current allowance is 1,500 OCPU hours and 9,000 GB hours per month, which for an Always Free tenancy is the equivalent of 2 OCPUs and 12 GB of memory, split over one or two instances
(e.g., 1 VM with 2 OCPU/12 GB, or 2 VMs with 1 OCPU/6 GB each). Older guides (and an earlier version of this one) say 4 OCPUs and 24 GB: Oracle's page today says 2 and 12, so trust Oracle's page.
- 200 GB total block storage
- 10 TB/month outbound data transfer
- 2 free Autonomous Databases, and a few other always-free services
The Ampere A1 (Arm) option is the biggest part of the always-free offer: 2 OCPUs and 12 GB of RAM, always free.
Availability of A1 capacity varies by region — if you get a "capacity unavailable" error, try again later or try another region/AD.
Step 3: Create a Compute Instance
1. In the Console, open the hamburger menu → Compute → Instances
2. Click "Create Instance"
3. Name your instance (e.g., free-vm)
4. Placement: pick an Availability Domain (AD) — if one AD is out of A1 capacity, try another
5. Image and shape:
- Click "Edit" next to Image and shape
- Image: Ubuntu 22.04 or Oracle Linux 8/9 (both free-tier eligible)
- Shape: click "Change shape" → Ampere → VM.Standard.A1.Flex → set OCPUs (up to 2 in total) and memory (up to 12 GB in total)
(or choose VM.Standard.E2.1.Micro under AMD for the older always-free x86 shape)
6. Networking: use the default VCN, or create a new one — either way, make sure "Assign a public IPv4 address" is checked
If you don't have a VCN yet, create one BEFORE launching the instance (this is the step people miss, and skipping it
is the easiest way to end up with a VM you can't reach):
a. Console → Networking → Virtual Cloud Networks → Start VCN Wizard
b. Choose "Create VCN with Internet Connectivity" (NOT the plain "Create VCN" option)
c. Accept the defaults and click Create
This one wizard sets up both a public subnet and a private subnet, plus the internet gateway, NAT gateway, and
route tables needed for each — so you get public AND private networking in one step, instead of wiring each
piece together by hand. When you get to the instance's Networking section, pick this VCN and its public subnet.
7. Add SSH keys: paste your public key, or let Oracle generate a key pair for you to download (keep the .key file safe)
8. Boot volume: default (up to 200 GB total is free across all instances) — you can raise this later
9. Click "Create"
Step 4: Open the Firewall (the most common gotcha)
Oracle Cloud has TWO firewalls you must open for any traffic — missing either one blocks the connection:
1. Security List / Network Security Group (cloud-level):
Networking → Virtual Cloud Networks → your VCN → Security Lists → Default Security List
Add an Ingress Rule: Source CIDR 0.0.0.0/0 (or your IP for SSH), Destination Port 22 (SSH), or 80/443 for a web server
2. iptables on the instance itself (OS-level):
Oracle's stock images ship with iptables rules that block everything except SSH by default
sudo iptables -I INPUT 6 -m state --state NEW -p tcp --dport 80 -j ACCEPT # example: allow HTTP
sudo netfilter-persistent save # Ubuntu: persist the rule
# Oracle Linux uses firewalld instead: sudo firewall-cmd --permanent --add-port=80/tcp && sudo firewall-cmd --reload
Step 5: Connect to Your VM
ssh -i ~/.ssh/oracle-key.key ubuntu@VM_PUBLIC_IP # user is "ubuntu" on Ubuntu images, "opc" on Oracle Linux
Step 6: Basic Setup
sudo apt update && sudo apt upgrade -y # Ubuntu
sudo dnf update -y # Oracle Linux
sudo apt install -y nginx # example web server
Important Limits & Warnings
- Always Free is a hard resource cap, not a 12-month trial credit — as long as you stay within it, it never expires and never bills
- Exceeding the free shapes, storage or bandwidth on a resource marked "Always Free" simply isn't possible for that resource — Oracle blocks the request
- BUT: creating anything NOT marked "Always Free" (reserved IPs beyond the free allotment, load balancers beyond the free one, extra block storage past 200 GB) does bill your card
- A1 (Arm) capacity is genuinely scarce in popular regions — if signup or instance creation keeps failing with "Out of capacity," that is normal, not an error on your end
- Idle Always Free compute instances can be reclaimed: Oracle says an instance is reclaimed if, during any 7-day period, its CPU (95th percentile) and network use are both under 20% (and, for A1 shapes, memory use under 20%). An instance that just sits there may be taken back, so use it or terminate it
To Stay Free
1. Only use shapes labeled "Always Free Eligible" in the console (it's marked directly on the shape)
2. Keep total block storage across all volumes under 200 GB
3. Set a budget alert: Billing & Cost Management → Budgets → create a budget at a low amount (e.g. $1)
4. Don't attach extra reserved public IPs beyond the one that comes with your instance
Cleanup When Done
1. Compute → Instances → select instance → Terminate (also deletes the attached boot volume if you check that box)
2. Block Storage → Block Volumes → delete any leftover volumes
3. Networking → Virtual Cloud Networks → delete the VCN if you created one just for this
4. Check Billing & Cost Management → Cost Analysis the next day to confirm $0
Common Problems
"Out of host capacity" when creating an A1 instance Try a different Availability Domain, or try again later — A1 demand is high
Can't SSH in at all Check the Security List ingress rule for port 22, then check iptables/firewalld on the instance
SSH works but a web server doesn't answer You opened the Security List but forgot the instance's local firewall (iptables/firewalld) — see Step 4
Wrong SSH username Ubuntu image = "ubuntu", Oracle Linux image = "opc", not "root"
Chose a Home Region you regret Cannot be changed on an existing account — you'd need a new Oracle Cloud account
Oracle's free tier is the most generous of the major clouds and it truly never expires, but the console has a steeper
learning curve than AWS/GCP/Azure and the two-firewall gotcha catches almost everyone the first time.