Intermediate 3 min read

๐Ÿ“˜ 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 โœ”๏ธ