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    477 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
About the Author
Mariusz Antonik

Oracle Cloud Infrastructure expert and consultant specializing in database management and automation.

All Tags
#Advanced #alerts #Bash #bash cpu monitoring script #bash monitoring #bash scripting #Beginner #Best Practices #block volume backup #Capacity Planning #cloud backup strategy #cpu bottleneck #CPU Monitoring #cpu monitoring linux #cpu monitoring script linux #cpu trends #cpu usage trends #cpu usage trends linux #create oracle db system in oci #cron cpu monitoring #cron cpu monitoring linux #cron jobs #database monitoring #database performance #detect slow queries mysql #devops #disk capacity planning server #disk forecasting linux #Disk Monitoring #disk usage #disk usage script linux #disk usage trends #Early Detection #easy infrastructure monitoring #free-tier #Guide #health dashboards #Health Reporting #historical server monitoring #how to monitor cpu usage linux #infrastructure #infrastructure health #infrastructure health dashboard #infrastructure health reporting #infrastructure monitoring #infrastructure monitoring report #infrastructure trends monitoring #Infrastructure Visibility #lightweight linux monitoring #lightweight monitoring #linux #linux administration #linux cpu monitoring #linux cpu usage #linux disk capacity planning #linux disk usage #Linux monitoring #linux monitoring setup #linux monitoring tools #linux performance #linux performance monitoring #linux server #linux server monitoring #linux servers #linux storage #linux tools #low maintenance monitoring #monitor cpu usage over time linux #monitor linux server health #monitor server trends #monitor small production server #monitoring without complexity #MySQL #mysql health reporting #MySQL monitoring #mysql optimization #MySQL Performance #mysql performance degradation #mysql performance monitoring #mysql performance trends #mysql query performance issues #mysql server monitoring #mysql slow queries #mysql slow query analysis #mysql slow query monitoring #mysql trends #mysql-health #networking #nsg #OCI #oci backup #oci bastion tutorial #oci block volume #oci infrastructure as code #OCI monitoring #oci networking #oci oracle database private subnet setup #oci oracle database tutorial #oci security #oci setup guide #oci terraform tutorial #oci tutorial for beginners #oci vcn terraform #oci virtual machine db system guide #oracle base database service tutorial #oracle cloud bastion #oracle cloud free tier tutorial #oracle cloud infrastructure step by step #oracle cloud infrastructure tutorial #oracle cloud storage #oracle database on oci setup #oracle-cloud #Performance #Performance Degradation #performance monitoring #performance trend monitoring #performance trends #plan disk growth server #practical server monitoring #predict disk usage growth #private instance access #query optimization #Security #security lists #server health #server health reporting #server health weekly report #server monitoring #Server Performance #server trend analysis #server-trends #simple cpu monitoring linux #simple linux monitoring #simple monitoring small business #simple monitoring system #simple ops monitoring #slow queries #slow query reporting mysql #small business infrastructure #small business IT #small business servers #small infrastructure monitoring #small server monitoring #ssh bastion #storage capacity planning linux #storage monitoring #subnets #system health reporting #terraform oci compute #terraform oracle cloud infrastructure #Trend Monitoring #trends #Tutorial #vcn