A trading bot on your laptop is a bad idea for one boring reason: your laptop isn't online 24/7, and markets are. Close the lid mid-trade and the bot stops managing an open position. Freqtrade — the popular open-source Python trading bot — is built to run unattended, which is exactly what a small VPS is for. Here's what it actually needs, how to set it up with Docker, and the honest limits nobody mentions until you hit them.
Why a server, not your machine
Two reasons, both practical:
- Uptime. The bot has to watch the market and manage positions around the clock. Every time your laptop sleeps or reboots, the bot is blind — a missed entry, or worse, an open position nobody's watching.
- Latency and stability. A VPS sits on a datacenter connection with a steady route to the exchange. Home wifi jitter and NAT resets don't help a bot that reacts to price.
This is the same logic behind running any trading bot on a VPS — Freqtrade just makes the requirements concrete.
What it actually needs
Freqtrade itself is lightweight, but be realistic about the workload:
- Live / dry-run bot: 2 GB RAM is a comfortable floor. The Docker image, a handful of pairs, indicators, and the SQLite trade DB all want a little headroom. A $5 Micro (2 vCPU / 2 GB / 25 GB) is the right starting point. 1 GB can run a single simple strategy on a few pairs, but you're closer to the edge.
- Many pairs / multiple strategies: step up to a $8 Small (4 vCPU / 4 GB / 35 GB) — more pairs means more concurrent indicator calculation and a bigger dataframe in memory.
- Disk: modest. The image, your
user_data, and the trade DB fit comfortably in 25 GB. Downloaded historical data for backtesting is the only thing that grows — and that mostly lives on your local machine (see below).
Set it up with Docker Compose
Docker is the maintained, least-painful way to run Freqtrade. On a fresh box:
sudo apt update && sudo apt install -y docker.io docker-compose-v2
mkdir ~/ft && cd ~/ft
docker run --rm -v "$(pwd)/user_data:/freqtrade/user_data" \
freqtradeorg/freqtrade:stable create-userdir --userdir user_data
Grab the official compose file and create a config interactively (it'll ask about your exchange, stake, and dry-run):
curl -s https://raw.githubusercontent.com/freqtrade/freqtrade/stable/docker-compose.yml -o docker-compose.yml
docker compose run --rm freqtrade new-config --config user_data/config.json
Dry-run first — always
Never point a fresh strategy at real money. Freqtrade defaults to dry-run (paper trading) and you should leave it there until the strategy has proven itself on live market data for a while. In config.json:
{
"dry_run": true,
"dry_run_wallet": 1000
}
Start it and watch:
docker compose up -d
docker compose logs -f
The restart: unless-stopped policy in the compose file is your systemd-equivalent here — Docker brings the bot back after a crash or a server reboot, no manual step. (If you prefer running it outside Docker, a systemd unit with Restart=always does the same job — same principle as keeping any bot alive.)
Exchange API keys — the part that bites people
This is where a trading setup goes wrong expensively. Two rules, non-negotiable:
- Trade permission only. Never enable withdrawal. If the key leaks, the worst case is unwanted trades — not your funds walking out the door. Freqtrade never needs withdrawal access.
- IP-whitelist the key. Most exchanges let you bind an API key to specific IPs. That's a concrete reason to run on a dedicated-IP plan: the key only works from your server's fixed address. On a NAT plan the bot shares the node's outbound IP, which isn't yours alone — fine for the bot to function, but you can't cleanly whitelist it.
Keep the keys in config.json, make it non-world-readable (chmod 600), and run the container as a non-root user. And lock the box down first — the new-VPS security checklist takes ten minutes and closes the doors that matter.
Back up user_data
Your strategies, config, and trade history all live in user_data. That's the thing you don't want to lose:
tar czf ft-backup-$(date +%F).tar.gz user_data
Pull that off the server periodically (or into object storage). Losing the trade DB means losing your performance history; losing a tuned strategy means redoing the optimization.
The honest limits
- Backtesting and hyperopt are heavy — do them locally. They peg CPU for extended stretches, and a shared, burst-oriented VPS is built for spiky workloads, not hours of sustained 100% load (which also runs against the acceptable-use policy). Optimize on your own machine, deploy the result to run live. The VPS is for the live bot, not the research.
- CPU is shared/burst. Great for a live bot that mostly waits on candles and reacts; wrong for grinding a year of 1-minute data through hyperopt.
- One region, CPU-only. The server is in Germany with no GPU. Fine for Freqtrade (it's CPU/logic, not ML training) — worth knowing if your strategy leans on a heavy ML model, which again is better trained locally.
Bottom line
Freqtrade on a VPS is the right setup for the live bot: a $5 Micro for a focused strategy, a $8 Small if you run many pairs, Docker Compose with restart: unless-stopped for uptime, and a trade-only, IP-whitelisted API key so a leak can't drain you. Keep the heavy backtesting and hyperopt on your laptop, back up user_data, and let the server do the one thing it's good at — staying online while the market moves. Signup is email-only and you pay in USDC or USDT; a dedicated IP is the one upgrade worth it here, purely for the API-key whitelist.