Back to Blog
How to Deploy Compute Servers in OCI: A Practical Deep-Dive Guide

How to Deploy Compute Servers in OCI: A Practical Deep-Dive Guide

   Mariusz Antonik    Oracle Cloud (OCI)    3 min read    5 views

1. Introduction

In this tutorial, I’ll walk you through the correct, repeatable, and secure way to deploy compute instances in Oracle Cloud Infrastructure. Whether you're building your first Always Free VM or deploying production Linux servers, getting the fundamentals right saves you hours of troubleshooting later.

Compute instances are the backbone of your workloads—web servers, application services, database clients, automation nodes, and more. A wrong setup creates security gaps, performance issues, or unnecessary exposure to the public internet.


2. What Problem This Solves

Most failures in compute deployments come from:

  • Exposing servers publicly when they should be private

  • Incorrect SSH key management

  • Not configuring ephemeral boot volumes properly

  • Placing servers in the wrong subnet

  • No route to NAT → no outbound traffic

  • Default OS images left unpatched

This guide solves those issues by walking you through the exact steps I use for production deployments in OCI.


3. Step-by-Step Guide

Step 1 — Choose the Right Shape

For Always Free:

  • VM.Standard.E2.1.Micro (AMD) — stable, general purpose

  • VM.Standard.A1.Flex — ARM-based, very powerful for free tier

For production workloads:

  • Flexible shapes with reserved OCPUs

  • Ensure burstable vs non-burstable differences are understood


Step 2 — Create Instance

OCI Console → Compute → Instances → Create Instance

Recommended settings:

  • OS: Oracle Linux 9 or Ubuntu 24.04 LTS

  • Network: private subnet for everything except public-facing services

  • Boot volume size: minimum 50 GB for production/Linux package installs


Step 3 — Generate SSH Keys (Local Machine)

On Linux/macOS:

 
ssh-keygen -t rsa -b 4096 -C "oci-server"

On Windows (PowerShell):

 
ssh-keygen -t rsa -b 4096 -C "oci-server"

Upload public key only (.pub) to OCI.


Step 4 — Secure Your Server Immediately

Update OS

 
sudo dnf update -y

or

 
sudo apt update && sudo apt upgrade -y

Disable password authentication in SSH

Edit:

 
/etc/ssh/sshd_config

Set:

 
PasswordAuthentication no PermitRootLogin no

Reload:

 
sudo systemctl restart sshd

Step 5 — Optional: Add Cloud-Init Configuration

Add startup automation when creating compute:

 
#cloud-config packages: - nginx runcmd: - systemctl enable nginx - systemctl start nginx

Step 6 — Create Backup Policy

From Compute → Boot Volume → Assign Backup Policy
Use:

  • Silver for general workloads

  • Gold for production critical workloads


4. Architecture Diagram

 
Internet │ Public Subnet (Web) │ ┌───────────────────┐ │ Web Server VM │ └───────────────────┘ │ ┌──────────┴───────────┐ │ │ Private Subnet (App) │ │ │ └───────┐ NAT Gateway │ │ ┌───────────────────┐ │ │ App Server VM │─┘ └───────────────────┘ │ Private Subnet (DB) │ ┌───────────────────┐ │ MySQL / ATP DB │ └───────────────────┘

5. Best Practices

  • Use private IPs for all internal servers

  • Only assign public IPs to load balancers or jump hosts

  • Rotate SSH keys every 90 days

  • Assign NSGs (Network Security Groups) per-tier rather than global security lists

  • Scale using flexible shapes—start small, grow OCPU only when needed

  • Always enable monitoring and alarms for CPU, memory, disk usage


6. Common Errors / Troubleshooting

Error Cause Fix
Can't SSH Wrong subnet or no public IP Move instance or assign floating IP
No outbound internet Missing NAT route Update route table
Yum/DNF cannot install packages Blocked outbound ports Enable port 443 via NAT
Server slow Using burstable shape Increase OCPU baseline
SSH refused Password login disabled before key added Add authorized keys via serial console

7. Summary

You now have the blueprint for secure, maintainable, scalable compute deployments in OCI. These practices work whether you're setting up Always Free instances or building large enterprise clusters.


👉 Download your free guide:
7 OCI Networking Mistakes to Avoid

https://dmcloudarchitect.com/c/7_oci_mistakes_to_avoid.html

Tags: #OCI