8i | 9i | 10g | 11g | 12c | 13c | 18c | 19c | Misc | PL/SQL | SQL | RAC | WebLogic | Linux

Home » Articles » Vm » Here

Oracle Cloud Infrastructure (OCI) : Create a Compute VM

This article shows how to create a compute virtual machine under Oracle Cloud Infrastructure (OCI).

Related articles.

Assumptions

This article assumes you've already defined a Virtual Cloud Network (VCN) in the same compartment as the compute VM you are about to create. You can see how to do that here.

Create SSH Key

Before you start, you are going to need a key pair for authentication to your service.

$ ssh-keygen -b 2048 -t rsa -f myOracleCloudKey
$ chmod 600 myOracleCloudKey*

Enter and confirm the passphrase when prompted. You will be asked to upload the public key during the service creation.

If you have any problems, or need instructions for using PuTTYgen on Windows, check out the documentation here.

Create a Compute VM

Log into the Oracle Cloud.

Oracle Cloud Infrastructure : Console

Use the top-left menu to select the "Compute > Instances" option.

Oracle Cloud Infrastructure : Compute Menu

Select the compartment of interest and click the "Create Instance" button on the compute dashboard.

Oracle Cloud Infrastructure : Compute Dashboard

Fill in the instance details, including the instance name and the operating system image. It's worth clicking the "Show Shape, Network, Storage Options", as there may be some things you need to consider. If you are using the Free Tier, make sure you pick the options that include the "Always Free Eligible" markers. If you have a Free Tier account, the defaults should be fine. Pick the networking compartment and VCN and decide if you need a public IP address, which will make the instance accessible from the outside world. You will need to upload the public key you created earlier, as this is needed to make connections to the VM. When you are ready, click the "Create" button.

Oracle Cloud Infrastructure Console

Wait for the instance to be provisioned.

Oracle Cloud Infrastructure Console

After a few minutes you will have a running VM, with the public IP address listed on the detail page.

Oracle Cloud Infrastructure Console

Connecting to the VM using SSH

Connect to the "opc" operating system user by specifying your private key and the public IP address from your DB Systems page.

$ ssh -i ./myOracleCloudKey opc@123.123.123.123

[opc@obvm1 ~]$

Once connected, you can run commands using "sudo", or switch to "root".

[opc@obvm1 ~]$ sudo su -
[root@obvm1 ~]#

Configure HTTPS Access

If the VM is publicly accessible and you need HTTPS access configured, you can get certificates for free using Let's Encrypt and CertBot, as described here.

For more information see:

Hope this helps. Regards Tim...

Back to the Top.