What the cheapest VPS for AI agents actually costs
If you are shopping for the cheapest VPS for AI agents, you have seen the ads: a virtual server for $2.99 a month with 1 vCPU and 1 GB of RAM, sold as "run anything you want." For a static blog or a nightly cron job, that is a genuinely good deal. For an agent that has to stay up 24/7, calling a model API, holding a conversation, and writing to a vector store, the sticker price hides most of the real cost.
The real cost of hosting an agent is the sum of four things: the monthly bill, the downtime when the box falls over, the maintenance you now own, and the hours you burn debugging infrastructure instead of shipping features. A $2.99 plan can win the first line and lose the other three by a wide margin.
Here is the honest breakdown, option by option, with numbers.
Where a $2.99 VPS breaks under a real agent
A single-core box with 1 GB of RAM sounds like enough until you add up what a modern agent actually runs at the same time:
The agent process itself (a Python or Node runtime, often 200 to 400 MB resident).
A model client or a local embedding model that spikes memory on each request.
A vector store such as a local Chroma or Qdrant instance holding your documents.
The OS, your reverse proxy, and whatever logging you bolted on.
Run those together and 1 GB disappears fast. When it does, the Linux out-of-memory killer picks a process and kills it, usually your agent, usually at the worst possible time. That failure mode is not a one-off. It is the default experience of running a stateful, always-on process on the cheapest tier available:
OOM with no restart. Nothing brings the agent back. It is just down until you happen to notice.
No restart-on-crash by default. A bare
python agent.pyin an SSH session dies the moment your connection drops or the process segfaults.You patch the OS. Security updates, kernel reboots, and dependency upgrades are all your job now.
No backups. If the disk or the droplet dies, your workspace, your vector index, and your logs go with it.
Noisy neighbors and CPU steal. On the cheapest shared tiers, other tenants on the same physical host can eat the CPU you thought you paid for. Your agent's latency doubles and you cannot see why.
IP reputation. Budget hosts recycle IP ranges that once sent spam or ran scrapers. Your outbound API calls and emails can land on blocklists through no fault of your own.
The usual first fix, adding swap, trades a crash for a slowdown: the kernel starts paging the agent's memory to disk, and a request that took 300 ms now takes 8 seconds while the box thrashes. You have not solved the memory problem, you have hidden it behind latency that surfaces as timeouts higher up your stack.
None of these are hypothetical. They are what "cheap" quietly costs once the agent has to run continuously.
The realistic options, side by side
There is no single cheapest VPS for AI agents that wins for everyone, so compare on total cost, not sticker price. Here is how the common choices stack up for a small agent that must run without stopping.
| Option | Monthly $ | Real gotchas | Good for |
|---|---|---|---|
| Budget VPS (1 vCPU, 1 GB) | $2.99 to $5 | OOM kills, CPU steal, you patch and back up everything, shaky IP reputation | Hobby bots, experiments you can afford to lose |
| Small cloud VM (2 vCPU, 2 GB) | $4 to $12 | Still self-managed, but real headroom for a model client plus a vector store | Side projects that need to actually stay up |
| Raspberry Pi at home | ~$3 to $6 in power | Home internet uptime, dynamic IP, SD-card wear, you are the data center | Local tinkering, learning, LAN-only agents |
| Serverless function | pay per call | Cold starts and execution time limits kill long-running or stateful agents | Short, stateless, bursty tasks |
| Managed agent runtime | $10 and up | Higher sticker price, less control over the base OS | Agents you depend on, teams, anything with users |
A few of these deserve a closer look.
The Raspberry Pi at home
A Pi 5 draws a few watts and costs almost nothing to run, so the power math is appealing: call it $3 to $6 a month in electricity. The realities are home internet that drops during the day, an ISP that rotates your IP address, an SD card that wears out after enough writes, and the fact that you are now the on-call engineer for your own house. For a LAN-only agent or a learning project, a Pi is great. For anything the outside world depends on, home uptime is the weak link.
Serverless
Serverless sounds perfect for "cheap and only pay when it runs," and for short stateless jobs it is. Agents break the model. A function platform assumes fast, stateless invocations, so it will cold-start your runtime (adding seconds of latency) and cap how long a single execution can run. A long conversation, a background research loop, or a persistent connection does not fit that shape. You can force it with extra queues and databases, but by then you have rebuilt a server the hard way and paid more for the privilege.
The small cloud VM sweet spot
Bumping to 2 vCPU and 2 GB of RAM for $4 to $12 a month is the upgrade most people should make before reaching for anything fancier. That extra gigabyte is the difference between the OOM killer sleeping and firing, and a second core means your model client and your vector store are not fighting over one. You still own patching, backups, and restart config, but at least the box has room to breathe. For a solo project with a handful of users, a small VM plus a systemd unit and a nightly backup script is a perfectly respectable production setup.
How do you keep a cheap agent alive 24/7?
If you do run on a VPS, the single most valuable thing you can add is automatic restart-on-crash, so a dead process comes back without you. The two standard ways are a systemd unit or a container restart policy.
A minimal systemd unit that restarts the agent whenever it exits:
[Unit]
Description=My AI agent
After=network-online.target
[Service]
WorkingDirectory=/opt/agent
ExecStart=/usr/bin/python3 /opt/agent/main.py
Restart=always
RestartSec=5
EnvironmentFile=/etc/agent.env
[Install]
WantedBy=multi-user.target[Unit]
Description=My AI agent
After=network-online.target
[Service]
WorkingDirectory=/opt/agent
ExecStart=/usr/bin/python3 /opt/agent/main.py
Restart=always
RestartSec=5
EnvironmentFile=/etc/agent.env
[Install]
WantedBy=multi-user.targetSave that as /etc/systemd/system/agent.service, then run systemctl enable --now agent. Now the box can reboot and your agent comes back on its own, and a crash is retried every 5 seconds.
If you package the agent as a container, Docker gives you the same guarantee with one flag:
docker run -d \
--name my-agent \
--restart=always \
--memory=768m \
--env-file /etc/agent.env \
my-agent:latestdocker run -d \
--name my-agent \
--restart=always \
--memory=768m \
--env-file /etc/agent.env \
my-agent:latestThe --restart=always policy brings the container back after a crash or a host reboot, and --memory=768m at least makes the failure predictable: the container is capped instead of dragging the whole box down with it. The exact semantics live in the Docker restart policy docs and the systemd.service manual.
This helps, and you should always do it. It does not fix OOM caused by genuinely too little RAM, and it does not patch your OS or back up your data. Restart-on-crash is a seatbelt, not a chauffeur.
Restart also says nothing when the agent is up but quietly wrong: stuck in a retry loop, or burning tokens on a runaway task. For that you want a heartbeat, a tiny external check that pings the agent every minute and messages you when it goes quiet. A free uptime monitor pointed at a healthcheck endpoint is enough to turn "down since 3am, noticed at 9" into a phone buzz within a minute. On a cheap VPS you are wiring that up yourself.
When is a cheap VPS genuinely the right call?
To be fair, sometimes the budget box is exactly right. If any of these describe you, stop reading buyer's-remorse articles and just buy the $5 plan:
It is a hobby project and downtime costs you nothing but a shrug.
No external users depend on it, so a 3am outage is a tomorrow problem.
The agent is stateless or trivially re-runnable, so losing the box loses nothing important.
You actively want to learn Linux administration, and the babysitting is the point.
For those cases a $4 to $6 small cloud VM with 2 GB of RAM is honestly the sweet spot: enough headroom that the OOM killer stays asleep, cheap enough that you never think about it. Add the systemd unit above and you are done. If you are moving an agent off your laptop for the first time, the walkthrough in From Laptop to Cloud covers the production-readiness steps a bare VPS leaves entirely to you.
What you are really paying for with a managed runtime
The moment real people depend on the agent, the math flips. Add an hour of your time at your own rate, multiply by every OOM debug session, every OS upgrade, and every "why did it stop overnight" morning, and the $2.99 plan quietly becomes the most expensive option on the list. That is the false economy: the cheapest vps for ai agents often costs the most once your hours and your downtime are on the invoice.
Put real numbers on it. Say your agent handles support triage for a small SaaS, and the $2.99 VPS saves you $84 a year against a $10 managed plan. Now add the parts the spreadsheet forgets. Two OOM incidents a month, each costing 45 minutes of diagnosis and a restart, is 18 hours a year. One OS upgrade that breaks a dependency and eats an afternoon is another 4 hours. A weekend outage that lost a trial signup is real revenue gone. Price your own time at even $40 an hour and the "cheap" box has quietly cost you around $880 in labor to save $84 in hosting. The bill was never the expensive part.
A managed runtime moves the boring, load-bearing parts off your plate: restart-on-crash, resource limits, secrets, backups, and observability. This is where Sokko fits. It runs long-lived agents on secure infrastructure we manage, so you get restart policies, memory limits, secure secret storage, and a persistent workspace without becoming a server operator yourself. You sign up and create an agent from the dashboard, and each one gets its own private web terminal (there's a sokko CLI too if you prefer the command line). If you want the deeper argument for when running your own box stops paying off, read self-hosted vs managed AI agents, and for a concrete always-on setup, run any AI agent 24/7 on Sokko.
The honest summary: for a weekend bot, buy the cheap VPS and enjoy it. For an agent that people rely on, price the whole thing, your own time included, and the option that looked expensive is usually the one that actually saves money.