--- Step-by-Step Guide: How to Host a Trading Bot on Oracle Cloud Free Tier for $0/Month | CurvedTrading

Step-by-Step Guide: How to Host a Trading Bot on Oracle Cloud Free Tier for $0/Month

A complete walkthrough for hosting a trading bot or alert system on Oracle Cloud's Always Free tier. Covers server setup, Python environment, cron jobs, and monitoring: all without spending a cent on hosting.

Step-by-Step Guide: How to Host a Trading Bot on Oracle Cloud Free Tier for $0/Month

Why Oracle Cloud’s Free Tier Is a Trader’s Secret Weapon

Most cloud hosting articles are written for web developers. They’ll tell you about deploying Node.js apps, setting up databases, and scaling microservices. None of that matters to you as a trader. What matters is this: Oracle Cloud gives you a server that runs 24/7 for free, forever, and that server can run your trading bot, alert pipeline, or data scraper without you paying a single dollar per month.

Not a free trial. Not “free for 30 days.” Actually free, permanently, as part of Oracle’s “Always Free” tier.

Think about that. AWS charges you $5-15/month for the cheapest VPS. DigitalOcean starts at $6/month. Azure’s cheapest option is $13/month. Oracle gives you a comparable machine for $0. It’s like finding a rent-free garage to park your car in. The building owner uses it to attract tenants to the paid floors, but you get real shelter for nothing.

Here’s how to set it up for a trading bot.

What You Get for Free

Oracle’s Always Free tier includes:

  • 2 AMD VMs with 1 GB RAM each, or 1 ARM VM with up to 4 CPUs and 24 GB RAM
  • 200 GB total block storage
  • 10 TB outbound data transfer per month
  • Always Free. No credit card charges, no expiration

For a trading bot that checks prices, sends alerts to Telegram via webhooks or Discord via Make.com, and logs data to a file, this is massively overkill. A basic alert bot uses maybe 100 MB of RAM and negligible bandwidth.

Step 1: Create Your Oracle Cloud Account

  1. Go to cloud.oracle.com → click Sign Up
  2. Enter your email, name, and country
  3. Important: You’ll need to add a credit card for verification, but Oracle explicitly states they will NOT charge you for Always Free resources. The card is only for identity verification.
  4. Choose your Home Region, pick the one closest to your broker’s servers. For US traders, US East (Ashburn) is usually best since most broker data centers are in New Jersey/Virginia.
  5. Complete the signup. Account provisioning takes 5-15 minutes.

Step 2: Create a Free VM Instance

  1. Log into Oracle Cloud Console → click Create a VM instance
  2. Configure:
    • Name: trading-bot (or whatever you prefer)
    • Image: Oracle Linux 8 (default) or Ubuntu 22.04 (click Change Image → choose Ubuntu if you prefer it)
    • Shape: Click Change ShapeAmpereVM.Standard.A1.Flex → set to 1 OCPU and 6 GB RAM (this is within the free tier)
    • Networking: Accept defaults (creates a VCN automatically)
    • SSH Key: Click Generate a key pair → download BOTH the private and public key files. Save these somewhere safe. You cannot recover them later.
  3. Click Create

Your VM will be running within 2-3 minutes. Note the Public IP Address displayed on the instance page.

Step 3: Connect to Your Server

On Windows: Open PowerShell and run:

ssh -i C:\Users\YourName\Downloads\ssh-key-private.key ubuntu@YOUR_PUBLIC_IP

Replace the key path and IP address with your actual values.

On Mac/Linux: Open Terminal:

chmod 400 ~/Downloads/ssh-key-private.key
ssh -i ~/Downloads/ssh-key-private.key ubuntu@YOUR_PUBLIC_IP

If it asks “Are you sure you want to continue connecting?” type yes.

You’re now logged into your cloud server. It’s like walking into your new office, empty right now, but you’re about to set it up.

Step 4: Install Python and Dependencies

Once connected to the server, run these commands:

sudo apt update && sudo apt upgrade -y
sudo apt install python3 python3-pip python3-venv -y

Create a project folder and virtual environment:

mkdir ~/trading-bot && cd ~/trading-bot
python3 -m venv venv
source venv/bin/activate
pip install requests schedule python-telegram-bot

The requests library handles API calls. schedule runs your bot on a timer. python-telegram-bot sends alerts to your phone.

Step 5: Create a Simple Alert Bot

Here’s a minimal trading alert bot that checks a stock price and sends a Telegram alert:

# ~/trading-bot/bot.py
import requests
import schedule
import time
from datetime import datetime

TELEGRAM_BOT_TOKEN = "YOUR_BOT_TOKEN"
TELEGRAM_CHAT_ID = "YOUR_CHAT_ID"

def send_telegram(message):
    url = f"https://api.telegram.org/bot{TELEGRAM_BOT_TOKEN}/sendMessage"
    requests.post(url, json={"chat_id": TELEGRAM_CHAT_ID, "text": message})

def check_market():
    # Example: Check SPY price via a free API
    try:
        # Replace with your preferred data source
        response = requests.get("https://query1.finance.yahoo.com/v8/finance/chart/SPY?interval=1m&range=1d")
        data = response.json()
        price = data["chart"]["result"][0]["meta"]["regularMarketPrice"]
        
        # Example alert: SPY drops below a level
        if price < 400:
            send_telegram(f"⚠️ SPY Alert: ${price:.2f}, Below $400 support!")
        
        print(f"[{datetime.now()}] SPY: ${price:.2f}")
    except Exception as e:
        print(f"Error: {e}")

# Run every 60 seconds during market hours
schedule.every(60).seconds.do(check_market)

print("Trading bot started...")
while True:
    schedule.run_pending()
    time.sleep(1)

Upload this file or create it directly on the server:

nano ~/trading-bot/bot.py

Paste the code, edit your Telegram credentials, press Ctrl+XYEnter to save.

Step 6: Run the Bot in the Background

You need the bot to keep running even after you close your terminal. Use screen:

sudo apt install screen -y
screen -S trading-bot
cd ~/trading-bot
source venv/bin/activate
python3 bot.py

Press Ctrl+A then D to detach from the screen session. The bot keeps running.

To check on it later: screen -r trading-bot

For a more production-grade setup, use systemd to run the bot as a service that auto-restarts on crashes and starts on server reboot:

sudo nano /etc/systemd/system/trading-bot.service
[Unit]
Description=Trading Alert Bot
After=network.target

[Service]
Type=simple
User=ubuntu
WorkingDirectory=/home/ubuntu/trading-bot
ExecStart=/home/ubuntu/trading-bot/venv/bin/python3 /home/ubuntu/trading-bot/bot.py
Restart=always
RestartSec=10

[Install]
WantedBy=multi-user.target

Then enable it:

sudo systemctl enable trading-bot
sudo systemctl start trading-bot
sudo systemctl status trading-bot

Now your bot survives reboots, crashes, and network hiccups automatically. Like setting a trailing stop loss. It protects you even when you’re not watching.

Step 7: Keep It Free, The Rules

Oracle’s Always Free tier has one catch: if your account is marked as “inactive” (no login for 7+ days and low usage), Oracle can reclaim your resources. To prevent this:

  • Log into the Oracle Cloud Console at least once a week
  • Make sure your VM has some CPU/network activity (your bot running counts)
  • Don’t exceed the free limits (1 OCPU, 6 GB RAM for ARM or 2x 1 GB for AMD)

As long as your bot is running, Oracle considers your account active. No surprises.

What You Can Build With This

This same free server can run:

  • Price alert bots, get Telegram notifications when stocks hit key support or resistance levels
  • Scanner bots, scrape free data sources for unusual volume or price movement
  • Data loggers, record Level 2 snapshots for after-hours analysis
  • Webhook relays, receive TradingView webhooks and fan them out to multiple channels
  • Portfolio trackers, pull your broker’s API and send daily P&L summaries

All running 24/7. All for $0/month. The only cost is the time you spend building it, and that time investment pays dividends every single trading day.


Disclaimer: This article is for educational purposes only and does not constitute financial advice. Automated trading systems carry additional risks. Always test thoroughly with paper trading before deploying live. Always consult a qualified financial advisor before making trading decisions.