Crypto Bots

How to Run a Crypto Bot 24/7 for Free (3 Methods)

You do not need to pay for a server to run a crypto bot. Here are 3 working methods to host your bot 24/7 for free โ€” from GitHub Actions cron jobs to free VPS tiers and lightweight cloud functions.

A
AI Agents Hubยท2025-05-03ยท5 min readยท985 words

Builder of AI agents, crypto trading bots, and open-source automation tools. Sharing practical guides on how to build, deploy, and profit from AI and DeFi technology.

Can You Really Run a Bot for Free?

Yes โ€” with important caveats. Free tiers have limitations: CPU throttling, sleep periods, and compute caps. For a learning bot or low-frequency strategy (checking prices every 15+ minutes), free options work well. For high-frequency trading, you need a paid VPS.

Here are the three best free methods.

Method 1: GitHub Actions (Best for Scheduled Tasks)

Free tier: 2,000 minutes/month (public repos), 500 minutes (private) Best for: Bots that run on a schedule (every 15 min, hourly, daily) Not good for: Real-time monitoring or sub-minute execution

GitHub Actions lets you run any code on a cron schedule. Perfect for:

  • Checking prices and placing limit orders every 15 minutes
  • Daily portfolio rebalancing
  • Prediction market analysis and position updates
# .github/workflows/trading-bot.yml
name: Crypto Trading Bot

on:
  schedule:
    - cron: '*/15 * * * *'  # Every 15 minutes
  workflow_dispatch:         # Manual trigger button

jobs:
  run-bot:
    runs-on: ubuntu-latest
    timeout-minutes: 5
    
    steps:
      - name: Checkout code
        uses: actions/checkout@v4
      
      - name: Setup Python
        uses: actions/setup-python@v5
        with:
          python-version: '3.11'
          cache: 'pip'
      
      - name: Install dependencies
        run: pip install -r requirements.txt
      
      - name: Run trading bot
        env:
          BINANCE_API_KEY: ${{ secrets.BINANCE_API_KEY }}
          BINANCE_SECRET: ${{ secrets.BINANCE_SECRET }}
          TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }}
          TELEGRAM_CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }}
        run: python bot.py

Your bot gets called every 15 minutes, checks conditions, places any needed orders, and exits. Zero server cost.

Add your secrets:

  1. GitHub repo โ†’ Settings โ†’ Secrets and variables โ†’ Actions
  2. Add BINANCE_API_KEY, BINANCE_SECRET, etc.

Limit: GitHub Actions minimum schedule is every 5 minutes. It can also be delayed by a few minutes during high GitHub traffic.

Method 2: Render Free Tier (Best for Persistent Bots)

Free tier: 750 hours/month (~31 days), then service sleeps Best for: Python/Node bots that run in a loop Limitation: Service "sleeps" after 15 min of inactivity (web services) โ€” but background workers do not sleep!

Render's "Background Worker" service type runs indefinitely without sleeping:

# render.yaml
services:
  - type: worker        # โ† Key: worker type never sleeps
    name: crypto-bot
    env: python
    buildCommand: pip install -r requirements.txt
    startCommand: python bot.py
    envVars:
      - key: BINANCE_API_KEY
        sync: false
      - key: BINANCE_SECRET
        sync: false
# bot.py โ€” must handle its own loop
import time
import os

def main():
    print("Bot started. Running until stopped.")
    while True:
        try:
            run_strategy_cycle()
            time.sleep(300)  # 5 minutes between cycles
        except Exception as e:
            print(f"Error: {e}")
            time.sleep(60)

if __name__ == '__main__':
    main()

Deploy:

  1. Push code to GitHub
  2. Go to render.com โ†’ New โ†’ Background Worker
  3. Connect GitHub repo
  4. Add environment variables
  5. Deploy

Free tier gives you 750 hours/month โ€” roughly 31 days of continuous running. After that you have used your monthly free allocation, but it resets on the 1st.

Method 3: Oracle Cloud Free Tier (Best Free VPS โ€” Forever)

Free tier: Always Free โ€” 2 AMD micro instances, 1GB RAM, 50GB storage Best for: Everything โ€” runs any language, any bot, 24/7 forever Limitation: Requires a credit card to verify (but you are NOT charged)

Oracle's Always Free tier is legitimately the best free cloud option. You get real VMs with no time limits.

# 1. Sign up at cloud.oracle.com/free
# 2. Create an Always Free VM (AMD or ARM Ampere)
# 3. SSH in and set up your bot:

# Update system
sudo apt update && sudo apt upgrade -y

# Install Python + Node.js
sudo apt install -y python3 python3-pip nodejs npm

# Clone your bot
git clone https://github.com/yourusername/your-bot
cd your-bot
pip3 install -r requirements.txt

# Install PM2 for process management
sudo npm install -g pm2

# Start bot with PM2 (auto-restarts on crash, survives reboots)
pm2 start bot.py --name crypto-bot --interpreter python3
pm2 save
pm2 startup  # โ† Run the command it outputs

Your bot now runs forever on free infrastructure.

Pro tip: Oracle's Ampere ARM instances are even more powerful (4 CPUs, 24GB RAM) and also Always Free.

Comparison Table

| Method | Cost | Uptime | Min Interval | Setup Difficulty | |--------|------|--------|-------------|-----------------| | GitHub Actions | Free | Scheduled | 5 minutes | Easy | | Render Worker | Free (750h/mo) | 24/7 | Any | Easy | | Oracle Cloud | Forever Free | 24/7 | Any | Medium | | Hetzner VPS | โ‚ฌ4/month | 24/7 | Any | Easy |

Which Should You Choose?

Start with GitHub Actions if:

  • Your bot only needs to run every 15+ minutes
  • You do not want to manage servers at all
  • You are just testing

Use Render if:

  • You need a persistent loop but want zero server management
  • Your bot is not high-frequency

Use Oracle Cloud Always Free if:

  • You want a real server forever at zero cost
  • You need more control and flexibility
  • You plan to run multiple bots

Pay for Hetzner (โ‚ฌ4/month) when:

  • You are running real money and uptime guarantees matter
  • You need low-latency proximity to exchange servers
  • Free tier limitations are causing issues

Quick Deploy Script

Here is a bash script to deploy any Python bot to Oracle/any VPS in one command:

#!/bin/bash
# deploy.sh โ€” run on your server after SSH in

set -e

BOT_DIR="$HOME/crypto-bot"
REPO_URL="https://github.com/yourusername/your-bot"

# Clone or update
if [ -d "$BOT_DIR" ]; then
    cd "$BOT_DIR" && git pull
else
    git clone "$REPO_URL" "$BOT_DIR" && cd "$BOT_DIR"
fi

# Install deps
pip3 install -r requirements.txt

# Create .env if it does not exist
if [ ! -f ".env" ]; then
    cat > .env << EOF
BINANCE_API_KEY=your_key_here
BINANCE_SECRET=your_secret_here
TELEGRAM_TOKEN=your_token_here
TELEGRAM_CHAT_ID=your_chat_id_here
EOF
    echo "โš ๏ธ  Edit .env with your API keys: nano .env"
fi

# Start/restart with PM2
pm2 delete crypto-bot 2>/dev/null || true
pm2 start bot.py --name crypto-bot --interpreter python3
pm2 save

echo "โœ… Bot deployed and running!"
pm2 status

All the pre-built bots on our Tools page include this deploy script.

Related Articles