Site icon Radu Pârvu

Creating a free Linux OS lab environment on Oracle’s OCI

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:

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
  1. Click Create VCN
  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
  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

Example config:

SettingValue
Namepublic-subnet
CIDR10.0.1.0/24
Subnet TypeRegional
Route TableDefault
Public SubnetYes

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.

Configure Security Rules

Open the Security List for the subnet/vcn.

Add Ingress rule:

TypeSourcePort
SSH0.0.0.0/022

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.

Advanced options:

Step 5: Choose a Free Shape

Image and shape

Click Change Shape and select an Always Free eligible shape:

This gives significantly more resources than most free tiers.

Alternative Option

Make sure the shape says Always Free eligible.

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.

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:

Add SSH Keys

download and save the keys

Storage

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

Create: click CREATE

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.

Exit mobile version