📘 Create OCI Instance (Oracle Cloud)

🎯 Goal

Deploy a cloud server (OCI instance) to run: - Website - Telegram Bot 24/7 without keeping local PC ON


🧠 What is OCI?

OCI (Oracle Cloud Infrastructure) = Cloud platform by Oracle

Provides: - Virtual servers (instances) - Storage - Networking - Public internet access

Simple: Local PC ❌ → Limited, needs power
OCI Server ✅ → Always ON, accessible anywhere


🖥️ What is an Instance?

Instance = Virtual Machine (VM)

It is: - Remote Linux computer - Ubuntu server - Has CPU, RAM, Storage

Connection flow: Your Laptop → SSH → OCI Instance → Run Project


🆓 Always Free Tier (IMPORTANT)

OCI gives lifetime free resources:

Includes: - 2 ARM instances (Ampere) - Up to 24 GB RAM (shared) - Public IP - Block storage

Rules: - Use VM.Standard.A1.Flex ONLY - Stay within limits - Avoid long idle usage


🚀 Step-by-Step: Create OCI Instance

1. Login

https://cloud.oracle.com


2. Navigate

Menu → Compute → Instances → Create Instance


3. Basic Config

Name: tutorial-server
Image: Ubuntu 22.04
Shape: VM.Standard.A1.Flex (IMPORTANT)


4. Shape Config

CPU: 1 core
RAM: 6 GB

Enough for: - Website - Telegram bot - Other things


5. SSH Key

Select: Generate SSH Key Pair

Download private key (.key)

IMPORTANT: - Do NOT lose it - Required for login


6. Networking

Enable: Assign Public IPv4 ✅


7. Create

Click: Create
Wait 1–2 minutes


🔐 Connect to Server

Copy Public IP

Example: 123.45.67.89


SSH Login

Linux / Mac: ssh -i yourkey.key ubuntu@your_ip

Windows (PowerShell): ssh -i yourkey.key ubuntu@your_ip


✅ First Output

Welcome to Ubuntu 22.04

Server ready


⚠️ Common Errors & Solutions


❌ Permission denied (publickey)

Error: Permission denied (publickey)

Reason: Wrong SSH key or key permission issue

Solution: chmod 400 yourkey.key
ssh -i yourkey.key ubuntu@your_ip


❌ Connection timed out

Reason: Port 22 blocked in OCI

Solution: Go to: Networking → VCN → Subnet → Security List
Add Ingress Rule: - Port: 22
- Source: 0.0.0.0/0


❌ Instance created but no public IP

Reason: Public IP not assigned

Solution: Edit instance → Attach Public IP


❌ Wrong username

Error: Permission denied

Reason: Using wrong user

Solution: Use: ubuntu (for Ubuntu image)


❌ SSH works but website not opening

Reason: Port 80/443 blocked

Solution: Open ports: - 80 (HTTP) - 443 (HTTPS)


❌ Instance stopped automatically

Reason: Idle or resource misuse

Solution: - Stay within free tier - Restart instance from OCI panel


🔥 Important Notes

  • Always use A1 Flex (free tier)
  • Keep SSH key safe
  • Open ports later (80, 443)
  • This is your production server

🧩 Project Flow

Local Development → GitHub → OCI Server

Website + Bot 24/7


📌 Next Step

  • Install Python
  • Install Git
  • Clone project

✅ Status

OCI Instance Created ✔️
Ready for Deployment ✔️