Introduction

Creating a free Linux virtual machine on Oracle Cloud Infrastructure (OCI) is one of the best ways to experiment with cloud computing without spending [a lot of] money. Oracle offers an Always Free tier that includes ARM and AMD-based virtual machines, storage, and networking resources at no cost.
This step-by-step guide walks you through the entire process.

Why Use OCI Free Tier?

Oracle’s Free Tier includes:

  • Up to 2 AMD-based VM instances
  • Up to 4 ARM Ampere A1 cores and 24 GB RAM (flexible)
  • 200 GB block storage
  • Always Free resources that don’t expire

This makes OCI especially attractive compared to other providers when you need more RAM or CPU for free.

Create an OCI Account

  1. Go to the official Oracle Cloud website.
  2. Click Start for free.
  3. Create an account using your email.
  4. Add payment verification (credit card required, but you won’t be charged for Always Free resources).
  5. Verify your identity and log in. Once your account is created, you’ll land in the OCI Console dashboard.

Prerequisites

Networking prerequisites

Steps that I should follow to create and setup the network for an always free linux image that can be accessed via public IP.

To run an Always Free Linux VM with a public IP in Oracle Cloud Infrastructure, you need a minimal VCN + subnet + internet gateway + routing + security rules. Below is the typical setup flow.

Create a VCN

  1. Go to Networking → Virtual Cloud Networks
Screenshot of a cloud networking interface showing a sidebar menu with options like Home, Compute, Storage, and Networking, highlighting the 'Virtual cloud networks' section.
  1. Click Create VCN
Interface for creating a Virtual Cloud Network, including fields for 'Name', 'Create In Compartment', and 'IPv4 CIDR Blocks' with examples and instructions.
  1. Choose VCN Only
  2. Example configuration:
SettingValue
Namevcn-adan
CIDR block10.0.0.0/16

Create an Internet Gateway

Inside the VCN:

  1. Gateways Internet Gateways
  2. Click Create Internet Gateway
  3. Name: free-igw
Screenshot of the 'Create Internet Gateway' page in a cloud service, showing fields for naming the gateway and selecting a compartment.
  1. Enable it.

This allows the subnet to reach the internet.

Create a Public Subnet

Inside the VCN:

  1. Go to Subnets
  2. Click Create Subnet

User interface for creating a subnet in a cloud platform, displaying fields for subnet name, type, and IP address blocks.

Example config:

SettingValue
Namepublic-subnet
CIDR10.0.1.0/24
Subnet TypeRegional
Route TableDefault
Public SubnetYes
Screenshot of a 'Create Subnet' form displaying options for IPv4 CIDR Block, IPv6 Prefixes, subnet access types (Private and Public Subnet), and DNS resolution settings.

Configure the Route Table

Edit the route table attached to the subnet.

Add route rule:

DestinationTarget
0.0.0.0/0Internet Gateway

Target = free-igw

This allows outbound internet access.

A screenshot of a user interface for adding route rules, featuring sections for target type, destination CIDR block, target internet gateway compartment, and a description field.

Configure Security Rules

Open the Security List for the subnet/vcn.

Add Ingress rule:

TypeSourcePort
SSH0.0.0.0/022
Network configuration display showing TCP traffic settings for ports, specifically noting port 22 for SSH remote login protocol.

Optional rules:

PurposePort
HTTP80
HTTPS443

Step 3: Navigate to Compute Instances

  1. Open the navigation menu (☰ in the top-left).
  2. Go to Compute → Instances.
  3. Click Create Instance.

Now you’re ready to configure your VM.

Step 4: Configure Your Linux VM

Name Your Instance
raphael
2. Choose Placement

Select the default compartment unless you’ve created a custom one.

Screenshot of a cloud service interface displaying availability domain options for Ampere A1 compute instances, including a warning message and details for availability domains AD 1, AD 2, and AD 3.
Advanced options:
User interface displaying options for different capacity types in a cloud computing platform, including On-demand capacity, Preemptible capacity, Compute cluster, Capacity reservation, and Dedicated host.

Step 5: Choose a Free Shape

Image and shape

User interface displaying information about image and shape configurations, including operating system Oracle Linux 9, image build date, and security features.

Click Change Shape and select an Always Free eligible shape:

  • VM.Standard.A1.Flex (ARM-based)
    • Up to 4 cores
    • Up to 24 GB RAM

This gives significantly more resources than most free tiers.

Screenshot of the Oracle Cloud interface displaying various VM shapes, highlighting 'VM.Standard.E2.1.Micro' as 'Always Free-eligible' with details on OCPU count and memory.

Alternative Option

  • VM.Standard.E2.1.Micro (AMD-based)
    • 1 OCPU
    • 1 GB RAM

Make sure the shape says Always Free eligible.

A table displaying various virtual machine shapes on Oracle Linux 9, highlighting the 'VM.Standard.E2.1.Micro' shape as 'Always Free-eligible' along with details on OCPU, Memory, and Security for each option.

Note: even now the estimated OCI cost is non zero! If you choose the shape and option as in the article, there will be no extra charge so the environment usage is free.

Screenshot of an estimated cost for a compute instance, displaying boot volume and estimated total monthly costs.

Proceed through the next screens: Security, Networking etc.

/Networking

Here I chose to create a new Virtual cloud network and consistently updated the names with the instance name I chose:

Form for setting up networking in a cloud environment, including fields for new virtual cloud network name, compartment creation, and public subnet details.

Add SSH Keys

download and save the keys

Screenshot of an interface section titled 'Add SSH keys' with options to generate a key pair, upload a public key file, paste a public key, or select 'No SSH keys'. Includes buttons to download the private key and public key.

Storage

Here I also use lowest performance possible to minis resource usage:

User interface displaying settings for boot volume configuration including size and performance parameters.

Create: click CREATE

Screenshot of an interface showing instance details for 'raphael' with tabs for Details, Networking, Storage, Security, Management, OS Management, Monitoring, Work requests, and Tags. The Work requests section includes a description of what a work request is and a search bar for filtering.

Connectivity

The first step to test the connectivity I used a simple ssh client installed on may macbook, it is important to note the following steps:

I used the command in the format: ssh -i in order to specify the the path to the private key file which I created and downloaded as part of the process outlines before.

Also, it is important to note that the connectivity onwards the public IP address did not work immediately after creating the instance even if everything was showing to be in good order on the OCI interface. But after 2 days the connectivity worked OK. Most likely after 2 days of week end, certain updates on the OCI side were completed so everything resumed to normal operation.

Next, I will write an article describing how to setup the connection to the new created Oracle Linux instance.


Discover more from Radu Pârvu

Subscribe to get the latest posts sent to your email.

, , ,

Leave a Reply

Discover more from Radu Pârvu

Subscribe now to keep reading and get access to the full archive.

Continue reading

Discover more from Radu Pârvu

Subscribe now to keep reading and get access to the full archive.

Continue reading