Step‑by‑step guide to launch, configure, and secure a Linux server on Oracle Cloud’s free tier
Before We Start: What You'll Walk Away With
By the end of this guide you’ll be running a live Linux VM on Oracle Cloud’s free tier without spending a dime.
Think of the process like ordering a pizza: you pick the crust (the VM), add the toppings (SSH access and web stack), then make sure it arrives hot and safe (firewall and TLS).
First you’ll spin up a free Oracle Cloud VM and lock down a secure ssh connection, just like getting a key to your new apartment.
Next you’ll set up a web server—Apache or Nginx—so you can drop a simple HTML file and see it show up, similar to placing a flyer on a billboard.
Finally you’ll tighten security with basic firewall rules and a free TLS certificate, giving your site the same protection a hotel safe provides for valuables.
Launch the free tier instance and note its public IP.
Configure
sshkeys and connect from your terminal.Install Apache or Nginx, start the service, and serve a test page.
Open only needed ports with
iptablesorufw.Obtain a Let’s Encrypt certificate and enable HTTPS.
Tools: Oracle Cloud Console,
ssh,apt/yum,certbot.Tip: Keep the VM in the free tier by staying under the 2 CPU/200 GB storage limit.
Cheat sheet: ssh -i ~/.ssh/oracle_key ubuntu@your_ip to connect.
Now you have a production‑ready server you can actually use, not just a virtual box that sits idle.
What a Self‑Hosted Server on Oracle Cloud Actually Is (No Jargon)
Imagine you’ve just booked a tiny, fully furnished studio on a short‑term lease. The walls are already there, the electricity works, and you get the keys without signing a long contract. That studio is your virtual machine on Oracle Cloud’s free tier.
Just like you can paint the walls, hang pictures, or bring in a couch, you can install any Linux distro, add a web server, or deploy a database. Nothing stops you from rearranging the furniture (changing configurations) or even kicking out a roommate (removing software) whenever you want.
The big difference from a traditional rental is the landlord never asks for rent as long as you stay within the free limits. Oracle provides the underlying hardware, power, and network, but the VM’s interior belongs entirely to you.
Think of the setup process like moving into that studio:
Pick a floor plan (choose an instance shape).
Get the keys (create the VM).
Turn on the lights and plug in your laptop (connect via SSH).
Once you’re inside, you control every switch. Want to run a Node.js API? Install Node. Need a MySQL database? Spin it up. All of that happens on your oracle cloud free tier server, and you won’t see a surprise bill if you keep an eye on usage.
In short, a self‑hosted server on Oracle Cloud is just a personal, no‑rent apartment in the cloud, ready for you to furnish however you like.
The 4 Mistakes Everyone Makes With Oracle Cloud Free Tier
Most people hit a wall on the free tier because they skip the little details that keep the service truly free.
Forgetting to set the correct shape limits – It’s like ordering a pizza without checking the slice count; you think you’re getting a small, but the system hands you a larger, billable size. In the console, lock the VM shape to
VM.Standard.E2.1.Microand verify theMonthly Free Usage Limitunder “Limits & Quotas”.Using the default “oraclecloud” SSH key – Handing out a master key to every guest is a security nightmare. Generate a fresh key pair (
ssh-keygen -t rsa -b 4096 -f mykey), upload the public part, and delete the default key from the instance’s Metadata page.Skipping VCN/subnet firewall rules – Imagine a house with all doors locked; no one can get in, even you. Open ports 22 (SSH) and 80/443 (web) in the VCN security list, or create a custom security group that mirrors the traffic your app needs.
Ignoring the automatic shutdown policy – Leaving a car idling wastes fuel; leaving a VM running wastes free hours. Enable
Auto‑Terminateafter 24 hours of inactivity or set a cron job that runsoci compute instance-action --action STOPon a schedule.Cheat sheet: shape =
VM.Standard.E2.1.Micro, SSH key = personal, firewall = ports 22 / 80 / 443, shutdown = auto‑terminate or cron.
Keep these four checkpoints in mind and the Oracle cloud free tier server stays free.
How to Set Up a Self‑Hosted Server on Oracle Cloud: Step‑by‑Step
Grab your laptop, fire up a browser, and follow these actions one after another.
Sign up for the Oracle Cloud Free Tier and verify the email and phone you provided. Think of it like registering for a loyalty card before you can collect points.
In the OCI Console, click Create a Compute Instance. Choose the ‘Always Free’ VM.Standard.E2.1.Micro shape – it’s the free‑tier version of a small rental car.
Set up networking: create a VCN, add a public subnet, then open ports 22, 80, 443. This is like drawing a map, marking the road (subnet) and opening the gates (ports) you’ll need.
On your workstation generate an SSH key pair:
ssh-keygen -t rsa -b 4096 -f ~/.ssh/oracle_key -N ""
Copy the contents of ~/.ssh/oracle_key.pub into the instance’s SSH key field. It’s the digital equivalent of handing over a house key before you move in.
Launch the instance and note the public IP address that appears. Treat that IP like the street address of your new place.
Open a terminal and connect:
ssh -i ~/.ssh/oracle_key opc@
- Update the OS packages:
sudo dnf update -y # for Oracle Linux
# or
sudo apt update -y # for Ubuntu
- Install Nginx:
sudo dnf install nginx -y # Oracle Linux
# or
sudo apt install nginx -y # Ubuntu
- Enable and start the web server so it survives reboots:
sudo systemctl enable --now nginx
Harden the box:
Configure a firewall (
firewalldon Oracle Linux orufwon Ubuntu) to allow only 22, 80, 443.Disable root SSH login by setting
PermitRootLogin noin/etc/ssh/sshd_configand restarting SSH.Install Certbot for a free HTTPS certificate:
sudo dnf install certbot python3-certbot-nginx -y # Oracle Linux
# or
sudo apt install certbot python3-certbot-nginx -y # Ubuntu
Run sudo certbot --nginx and follow the prompts – it’s like ordering a locked door for your website.
Now your oracle cloud free tier server is up, secure, and ready to host.
A Real Example: Deploying a Portfolio Site for Maya the Designer
Maya signs up for a free Oracle account, picks the same VM shape, and names the instance maya‑portfolio.
She connects via SSH using the steps 1‑6, then runs:
sudo dnf install nginx
Next, she copies her index.html to the web root with:
scp index.html user@public_ip:/usr/share/nginx/html/
To secure the site, Maya runs:
sudo certbot --nginx -d portfolio.maya.com
Think of the process like ordering a meal: you pick the dish (VM), add the sauce (nginx), place the garnish (HTML), and finish with a sweet dessert (HTTPS certificate).
Tip: Verify the firewall allows ports 80 and 443; Oracle Cloud’s default security list blocks them.
Tip: After the certbot step, reload Nginx with
sudo systemctl reload nginxto apply the new cert.Tip: Test the site with
curl -I https://portfolio.maya.comto confirm a 200 response.
Now Maya’s portfolio is live at https://portfolio.maya.com, fully HTTPS‑secured, all thanks to an oracle cloud free tier server.
The Tools That Make This Easier
Grab the tools that turn a raw VM into a ready‑to‑run server, just like picking the right kitchen gadgets makes a dinner prep painless.
Oracle Cloud Console (2025 UI) – The control panel where you spin up instances, attach VNICs, and set security lists. Think of it as Google Maps for your cloud: you plot the route, then follow the directions without getting lost.
PuTTY / Termius – Cross‑platform SSH clients that give you a terminal window into the VM. It’s like ordering a meal and having the server bring it straight to your table, no matter which restaurant (Windows, macOS, Linux) you’re at.
Visual Studio Code + Remote‑SSH – Open the VM’s filesystem in your favorite editor and save changes instantly. Imagine packing a suitcase: you load items directly into the bag without having to unpack and repack later.
Certbot 2.7 – The official Let’s Encrypt client that fetches and renews SSL certificates with a single command. It works like a vending machine that dispenses a fresh, valid certificate every 90 days without you pressing any extra buttons.
UFW (Ubuntu) or firewalld (Oracle Linux) – Simple firewall front‑ends for opening only the ports you need. They act like a doorman who checks IDs before letting anyone into the building.
Cheat sheet:
Connect: ssh -i mykey.pem opc@public_ip
Install Certbot:
sudo snap install --classic certbotOpen HTTP/HTTPS:
sudo ufw allow 80,443/tcp
With these five tools in hand, the rest of the setup is just a matter of following the steps.
Quick Reference: Oracle Cloud Free Tier Server Cheat Sheet
Grab this cheat sheet when you need a quick refresher—no fluff, just the moves.
Sign up, verify email, and open the Oracle Cloud Console. Think of it like ordering a coffee: you create an account, confirm your payment method, then you’re ready to pick a drink.
Create a VM: choose Always Free → VM.Standard.E2.1.Micro. It’s the “basic espresso” of cloud instances—nothing fancy, but it gets the job done.
Set up networking: add a VCN, attach a public subnet, and open ports
22,80,443. Imagine drawing a route on Google Maps; you need the right roads open to reach your destination.Generate an SSH key pair, paste the public key into the console, then launch. This is like packing a suitcase with a lock: the key lets you open it later.
SSH into the instance and run the initial setup. For example, Alex, a freelance developer, types:
sudo dnf update -y
sudo dnf install -y nginx
Then starts Nginx, adjusts the firewall, and adds Certbot for HTTPS.
- Enable the services, configure the firewall, and obtain a free TLS cert. It’s the same as setting up a home security system after you’ve moved in.
Test the deployment:
curl -I http://
curl -I https://
If you see 200 OK, you’re live.
Sign‑up & Console: Register, verify, open console.
VM Selection: Always Free → VM.Standard.E2.1.Micro.
Networking: VCN + Public Subnet, open 22/80/443.
SSH Keys: Create, paste public key, launch.
Initial Setup:
sudo dnf update, install Nginx, enable service.Security: Firewall rules, Certbot HTTPS.
Verification:
curl -Ion IP and domain.
Stick this on your desktop and spin up an oracle cloud free tier server in minutes.
What to Do Next
Pick a path and keep the momentum going.
-
Easy: Deploy a second static site on the same VM. Think of it like ordering a side dish at a restaurant—you already have the table, just add another plate. Create a new directory, drop an
index.htmlin there, and add a virtual host entry in/etc/apache2/sites-available. Reload Apache and you’ll see two distinct sites sharing one IP.
Medium: Install Docker Engine and spin up a containerized app. It’s similar to using Google Maps: the VM is the base map, Docker adds layers you can toggle on and off. Run
sudo apt-get update && sudo apt-get install -y docker.io
then pull your image with docker run -d -p 8080:80 myimage. Your app now lives in an isolated sandbox.
Hard: Wire a CI/CD pipeline with GitHub Actions that pushes directly to OCI. Picture packing a suitcase: every item (code) gets placed in the right compartment (container) automatically. In your repo, add a
.github/workflows/deploy.ymlthat authenticates using an OCI token, builds the Docker image, and updates the instance. Once the workflow runs, new commits appear live without manual steps.Tip: Keep an eye on the free‑tier limits; a stray large image can tip the budget.
Tool: Use
ociCLI for quick checks:oci compute instance list.
Cheat sheet:
- VM IP → ssh -i mykey opc@IP
- Docker start →
docker compose up -d - Deploy action →
gh secret set OCI_TOKEN
Got stuck or have a cool use case? Drop a comment below – I’d love to hear how you’re using Oracle’s free tier!
About the Author
Abdullah Sheikh is the Founder & CEO at Exteed, where he leads a team of skilled developers specializing in Web2 and Web3 applications, Custom Smart Contracts, and Blockchain solutions.
With 6+ years of experience, Abdullah has built CRMs, Crypto Wallets, DeFi Exchanges, E-Commerce Stores, HIPAA Compliant EMR Systems, and AI-powered systems that drive business efficiency and innovation.
His expertise spans Blockchain, Crypto & Tokenomics, Artificial Intelligence, and Web Applications; building reliable and smooth web apps that fit the client’s goals and requirements.
📧 info@abdullah-sheikh.com · 🔗 LinkedIn · 🌐 abdullah-sheikh.com
Top comments (0)