Oracle Cloud Infrastructure (OCI) Compute provides scalable, high-performance virtual machines and bare metal servers. In this tutorial, we'll walk through the process of launching your first compute instance.

Prerequisites

Before you begin, make sure you have:

  • An active OCI account
  • Appropriate IAM permissions to create compute instances

  • A VCN (Virtual Cloud Network) configured

  • SSH key s generated for secure access

Step 1: Navigate to Compute Instances

From the OCI Console, navigate to Compute > Instances and click Create Instance.

Step 2: Configure Basic Settings

Configure the following settings for your instance:

Name: my-first-instance Availability Domain: AD-1 Fault Domain: Let Oracle choose the best fault domain

Choose Instance Shape

OCI offers various shapes optimized for different workloads:

  • VM.Standard.E4.Flex: Flexible AMD EPYC processor-based instance
  • VM.Standard.A1.Flex: Arm-based Ampere Altra instances
  • BM.Standard.E4.128: Bare metal for maximum performance

For this tutorial, we'll use VM.Standard.E4.Flex with 2 OCPUs and 16GB RAM.

Step 3: Configure Networking

Ensure your instance is placed in a subnet with proper security list rules:

# Example security list rules (using OCI Python SDK) from oci.core import VirtualNetworkClient security_list_rules = { "ingress_security_rules": [ { "protocol": "6", # TCP "source": "0.0.0.0/0", "tcp_options": { "destination_port_range": { "min": 22, "max": 22 } } } ] }

Step 4: Add SSH Keys

Critical Security Step: Always use SSH key authentication, never password authentication.

# Generate SSH key pair (if you haven't already) ssh-keygen -t rsa -b 4096 -f ~/.ssh/oci_instance_key # The public key (~/.ssh/oci_instance_key.pub) will be added to the instance

Step 5: Launch the Instance

Review your configuration and click Create. The instance will take a few minutes to provision.

Connecting to Your Instance

Once the instance is running, connect using SSH:

# Get the public IP from the OCI Console ssh -i ~/.ssh/oci_instance_key opc@<PUBLIC_IP>

Best Practices

  1. Use Instance Principals: Configure instance principals for secure API access without hardcoded credentials

  2. Enable Monitoring: Use OCI Monitoring service to track instance metrics

  3. Regular Backups: Create boot volume backups or custom images

  4. Security Updates: Keep your OS and packages up to date

# Update packages on Oracle Linux sudo yum update -y # Enable automatic security updates sudo yum install yum-cron -y sudo systemctl enable yum-cron sudo systemctl start yum-cron

Cost Optimization Tips

  • UseAlways Freetier instance**s for testing (VM.Standard.E2.1.Micro)
  • Stop instances when not in use

  • UsePreemptible Instancesfor fault-tolerant workloads (up to 50% cost savings)

  • Right-sizeyour instances based on actual usage

Conclusion

You've successfully launched your first OCIcompute instance! This is just the beginning of what you can do with OCI. In future articles, we'll cover advanced topics like load balancing, autoscaling, and multi-region deployments.

Next Steps