Create and Setup Virtual Machine on Oracle Cloud

Published on — Nov. 29, 2022
#vps #oracle-cloud

Why not take advantage of Oracle Cloud’s free meal?


Note: Unfortunately, I do NOT get paid from the Oracle Cloud, sad 🥲

Prerequisites

  • An Oracle Cloud account
  • A SSH Key
  • Command Line Basics

Create a VM Instance

Scroll down to find Launch Resources and click Create a VM instance

Create a VM instance, method 1

Alternatively, click the top-left navigation menu button, then Compute -> Instances

Create a VM instance, method 2 step 1

After that, find Create instance

Create a VM instance, method 2 step 2

Find the best image and shape for you, and then decide whether or not to create a new virtual cloud network.

Create and import your SSH keys. If you are unfamiliar with it, you can follow this documentation:

  • Generating a new SSH key and adding it to the ssh-agent, from GitHub Docs

Remember that using a password to connect to your server is extremely discouraged. Please use SSH Key to protect your data.

Finally, OC begins to build your VM.

Edit Virtual Cloud Network

You may need to configure some network settings if you want to host some apps.

Here’s an example of how to add an ingress rule that allows https. (Port 443)

Click Menu -> Networking -> Virtual Cloud Networks

Find Virtual Cloud Networks

Locate the VCN you want to edit

Locate your VCN

Choose the proper subnet -> security list -> Add Ingress Rules

Locate your subnet

LOcate the security list

Add ingress rules

Then fill the table like this:

Fill the table

Key Value
Source CIDR 0.0.0.0/0
IP Protocol TCP
Destination Port Range 443

Save changes and exit.

Setup The Instance

After about one or two minutes, you can connect to your server and perform some basic configurations.

Here’s an example: Setup Your Server

Alternatively, DigitalOcean has a ton of great tutorials for setting up your server, covering the majority of the main Linux distros:

*: If you are using REHL, Oracle Linux, etc. you can also refer to this

**: In December 2020, Red Hat terminated CentOS development.