19 April 2026

Running your own AI agents on a VPS

A weekend with OpenClaw, a trading bot, and a personal assistant.

I’ve spent the last few months building two AI agents. One trades stocks, one does the boring admin I don’t want to do, and they both live on a £20-a-month box in a Frankfurt data centre. No SaaS subscriptions, no usage caps, no UI getting in the way. Just a Linux server, some Python, and a system prompt.

Here’s how I set it up, what works, and what I’d do differently.

Why bother

The big AI products are great, but they all live inside someone else’s product surface. You get the chat box, the buttons they decided you should have, and the integrations they’ve shipped. Useful, but limiting if you want an agent that runs on its own. One that checks something every fifteen minutes, fires off a report at 9am, watches a market and acts without you opening an app.

For that you need three things: a model on tap, somewhere persistent for it to live, and a way to give it tools. OpenClaw on a VPS is the cheapest, most flexible way I’ve found to put those three things together.

The stack

That’s it. No Docker, no Kubernetes, no orchestration layer. If you can SSH and edit a file, you can run this.

Setting up the VPS

Spin up a Hetzner box, point a domain at it if you fancy, and run the basics. Unattended-upgrades, ufw with port 22 only, fail2ban, an SSH key. You know the drill. Five minutes if you’ve done it before, fifteen if you haven’t.

Install OpenClaw, drop your Anthropic API key into an env file:

# /root/.openclaw_env
export ANTHROPIC_API_KEY="sk-ant-..."
chmod 600 /root/.openclaw_env
echo "source /root/.openclaw_env" >> ~/.bashrc

That’s the foundation. Everything from here is just adding skills and pointing cron at them.

Bot one: the trading bot

I called him Gordon Gekko, which felt funny at the time and now feels like I’m tempting fate.

Gordon runs a short-only momentum strategy against a watchlist of around 65 US stocks and ETFs, on an Alpaca paper trading account. He fires every 15 minutes during US market hours and weighs seven different signals (price momentum, relative strength versus SPY, volume, news sentiment, sector contagion, time-of-day, and gap detection) before deciding whether to open or close anything.

A few things worth flagging if you’re going to try this:

Pick the right broker. I started on Trading 212 and got rejected within an hour because algorithmic trading is explicitly against their terms of service. Alpaca is built for this. Paper accounts are free, no ID check, and the API is identical to live. If you don’t read the ToS first you’ll waste an evening.

Keep the skill file disciplined. OpenClaw skills are just markdown with instructions. Mine tells Gordon exactly which endpoints to hit, what the rate limits are, how to size positions, and, critically, to check his existing positions before placing any order. Models will happily duplicate trades if you don’t make this explicit.

Log everything. Every decision, every signal score, every API response. /var/log/gordon_gekko.log is the first place I look every morning. When something looks weird, you want the receipts.

Paper trade for a long time. I’m months in and I still wouldn’t put real money on it. The point of paper trading isn’t proving the strategy works. It’s proving the plumbing works. The number of edge cases you only discover when a real-looking order fills at 3:47pm is genuinely surprising.

The cron entry is unglamorous and exactly as boring as it should be:

*/15 13-20 * * 1-5 /root/.openclaw/run_skill.sh gordon_gekko >> /var/log/gordon_gekko.log 2>&1

That runs every 15 minutes between 1pm and 8pm UTC, Monday to Friday. US market hours, give or take.

Bot two: the personal assistant

Originally I was going to use a single bot for everything, then I realised I was asking one agent to be both Goldman Sachs and my PA. Bad idea. Different system prompts, different skills, different risk profiles.

The assistant is more pedestrian and arguably more useful. It does morning briefings: calendar, weather, anything in my inbox flagged as important, the overnight price movement on a few things I care about. It pings me on Telegram so I get it on my phone with my coffee. No app to open.

The skill file for this one is just a recipe. Fetch X, fetch Y, summarise into a single message under 200 words, send to chat ID Z. The model doesn’t have to be clever. It has to be reliable.

Two things I’d recommend if you build something similar:

Telegram bots are the cheat code for output. Free, no auth pain, instant push notifications. Five minutes to set up via @BotFather and you’ve got a delivery channel for every agent you ever build.

Be ruthless about scope. I had to actively stop myself adding “and also do my email” and “and also book restaurants.” A reliable agent that does three things well beats a flaky one that tries to do twelve. Build the second agent for the second job.

What surprised me

A few honest observations after running this for a while:

Haiku is more capable than I expected. I assumed I’d need Sonnet for the trading work and was wrong. Haiku 4.5 handles the signal weighting fine, costs almost nothing, and is fast enough that the bot finishes its analysis well within the 15-minute cron window with room to spare.

The hard bit isn’t the model, it’s the skill design. Most of my time has gone into refining instructions, not tweaking prompts. Things like “always check positions first” and “never place more than one order at a time” sound trivial but they’re the difference between a bot that works and a bot that gets you margin called.

Cost has been a non-issue. Between Hetzner, the Anthropic API, and Alpaca paper trading, the whole setup runs for less than a Netflix subscription. The trading bot has cost me more in coffee while debugging it than in compute.

Persistent agents change how you think. Once you have something running 24/7 that you can give jobs to, you start spotting jobs everywhere. The trick is restraint. Not every problem needs an agent, and a flaky agent is worse than no agent.

Would I recommend it?

If you can SSH, yes. The barrier to running your own agents has collapsed in the last year. You don’t need a platform, you don’t need a startup, you don’t need a team. You need a £20 server, a couple of hours, and the discipline not to ship a bot to a live brokerage account on day one.

I’ll write up the trading strategy properly once it’s got enough paper history to be worth writing about. For now I’m just enjoying having robots that work for me while I sleep, even if one of them is, technically, dangerous.

More notes · Andy Bridson