How to Set Up a Robinhood Trading Bot From Scratch (Step by Step for Beginners)

by Steve

Last Updated 07/02/26

No coding experience required — if you can follow instructions, you can do this


Building a Robinhood trading bot from scratch is more approachable than most beginners expect. In my last post I explained what my trading bot does and why I built it. The response was incredible — the most common question I got was simple: how do I actually set this up?

So here it is. The complete step by step guide. I’m going to walk you through every single step from zero to a fully running bot. No experience required. By the end, your Robinhood trading bot will be running on its own.

This will take about an hour to set up. After that it runs on its own 24 hours a day, 7 days a week.

Ready? Let’s go.


Robinhood trading bot running live on a cloud VPS

What You Need to Build Your Robinhood Trading Bot

  • A Robinhood account — free, link at the bottom if you don’t have one yet 🎁
  • A credit or debit card for the VPS ($6/month)
  • Your phone or computer
  • About an hour of time

That’s it. No prior coding experience needed.


Step 1 — Create Your Robinhood Account

If you already have Robinhood skip this step.

If not, go to robinhood.com or download the Robinhood app and sign up. The process takes about 5 minutes. You’ll need to provide your Social Security Number for identity verification — that’s standard for any brokerage account.

Once your account is open, fund it with however much you want to trade with. The bot uses a small, fixed amount per position and a cap on how many positions it holds, so you’ll want enough available to work with comfortably.


Step 2 — Set Up Your VPS (Virtual Private Server)

This is the computer in the cloud that runs your bot 24/7. Think of it as a tiny server that never turns off, even when your phone is in your pocket.

I use DigitalOcean for this. It costs just a few dollars a month and takes about 5 minutes to set up.

  1. Go to digitalocean.com
  2. Create a free account
  3. Click Create then Droplets
  4. Choose Ubuntu 24.04 as your operating system
  5. Select the Basic plan — the $6/month option (1GB RAM) is all you need
  6. Choose a datacenter region close to you
  7. Under Authentication select Password and create a strong password
  8. Click Create Droplet

DigitalOcean will give you an IP address — something like 999.999.999.99. Save this, you’ll need it in the next step. A well-built Robinhood trading bot rewards patience over tinkering.


Step 3 — Download Termius

Termius is a free app that lets you connect to your VPS from your phone or computer. It’s basically a remote control for your server.

  1. Download Termius from the App Store or Google Play (it’s free)
  2. Open it and tap the + button to add a new host
  3. Enter your VPS IP address from Step 2
  4. Username: root
  5. Password: the password you created in Step 2
  6. Tap Save then connect

You should see a black screen with a command prompt. That means you’re connected to your server. Small habits like these keep a Robinhood trading bot dependable.


Step 4 — Install Python and Required Libraries

Now we need to install the tools the bot needs to run. Copy and paste each of these commands one at a time into Termius and press Enter after each one.

First update your server:

apt update && apt upgrade -y

Install Python:

apt install python3 python3-pip -y

Install the required libraries:

pip install robin-stocks yfinance pandas --break-system-packages

This will take a minute or two. You’ll see a lot of text scrolling by — that’s normal.


Step 5 — Create Your Credentials File

The bot needs your Robinhood username and password to log in and place trades. We store these in a secure file on your server. Your Robinhood trading bot will handle the rest automatically.

Run this command:

nano ~/.momentum_bot.env

A text editor will open. Type the following, replacing the example details with your real ones:

RH_USERNAME=your@email.com
RH_PASSWORD=yourpassword
EXTENDED_HOURS=true
DRY_RUN=false

Press Ctrl+O then Enter to save, then Ctrl+X to exit.

Important: Keep DRY_RUN=false when you’re ready to trade for real. If you want to test first without placing real orders, set it to true.


Step 6 — Upload the Bot Files

The bot consists of two Python files:

momentum_bot.py — the main bot that logs in, reads signals, and places orders Every step here compounds into a more dependable Robinhood trading bot.

momentum_signals.py — the signals calculator that decides what to buy and sell based on MA20, MA50, and RSI

In upcoming posts I’ll walk through exactly how each file works and the logic behind every decision the bot makes. Building a solid understanding of the signals first will make the code side much easier to follow when we get there. In the end, a Robinhood trading bot is only as good as its setup.


Step 7 — Set Up the Automatic Schedule (Cron Job)

The bot needs to run automatically every 30 minutes. We do this with a cron job — a built in scheduler on Linux servers. That reliability is what separates a solid Robinhood trading bot from a fragile one.

Run this command:

crontab -e

If it asks which editor to use, type 1 and press Enter to select nano.

Add this line at the bottom of the file:

*/30 * * * * PATH=$HOME/.local/bin:$PATH python3 /root/momentum_bot.py >> /root/momentum_bot.log 2>&1

Press Ctrl+O, Enter, then Ctrl+X to save and exit.

The bot will now run automatically every 30 minutes around the clock.


Step 8 — Test the Bot

Before leaving it to run on its own, let’s do a manual test to make sure everything is working.

Run this command:

python3 momentum_bot.py

You should see output like:

login OK
fetching signals...
session=regular  active=True
buying_power=$XXX  positions=0/5
bot end

If you see login OK the bot is connected to Robinhood and working. If you see any errors, double check your credentials file from Step 5. Getting this right early saves your Robinhood trading bot headaches later.


Step 9 — Monitor Your Bot

The bot keeps a log of everything it does. To see what it’s been up to run:

tail -50 momentum_bot.log

This shows the last 50 lines of activity. You’ll see every buy, sell, and signal the bot evaluates.

To watch it live in real time:

tail -f momentum_bot.log

Press Ctrl+C to stop watching.


What Happens Next

Once everything is set up the bot runs completely on its own. Every 30 minutes it will:

  • Check prices on all your watchlist stocks and crypto
  • Look for momentum buy signals
  • Place buy orders when conditions are met
  • Monitor open positions for stop loss and sell signals
  • Exit positions automatically when momentum weakens

You don’t need to do anything. Just check the log occasionally to see how it’s performing.


Common Questions

What if I want to stop the bot?
Run crontab -e and delete the line you added in Step 7. The bot will stop running.

What if I want to change the position size?
Open your bot’s configuration file and change the position size value. Start with a small, fixed amount and only size up once the system has proven itself. Treat your Robinhood trading bot like infrastructure, not a set-and-forget gadget.

What if I want to add or remove stocks from the watchlist?
Open momentum_signals.py and edit the WATCHLIST section.

Is my password safe?
Your credentials are stored in a hidden file on your private server. Nobody else has access to your server unless they know your DigitalOcean password.


Up Next

In my next post I’ll cover how I added cryptocurrency trading to the bot — so it now trades BTC, ETH, DOGE, SOL and more automatically alongside stocks, 24 hours a day. This is where your Robinhood trading bot really starts to earn its keep.

If you have questions about the setup drop them in the comments and I’ll answer every one.

I built this bot on Robinhood and it’s where all my trades run. If you haven’t already, sign up with my link and we’ll both get a free stock 🎁


Steve is the founder of Bot and Bull. He personally uses every app reviewed on this site and only recommends what he genuinely believes in — no press releases, no paid placements.

Some links in this post are referral links, which means we both benefit when you sign up through them — at no extra cost to you. Bonus amounts, terms, and availability are set by each app and can change at any time. Always confirm the current offer before signing up. Terms apply.

Your Robinhood Trading Bot, From Here

Once your Robinhood trading bot is live, the real work is monitoring and refining it — watch the logs, manage your risk, and let the system prove itself over time. If you want to see where this Robinhood trading bot journey led next, read how I expanded the bot to over 1,000 stocks.

Leave a Comment