Skip to content

Solutions · Coding agents

A VPS for OpenHands

OpenHands is an autonomous coding agent: give it a repository and a task and it edits, runs, tests and opens pull requests on its own, with the model of your choice behind an API key. Its own README says the most powerful way to run it is on a server in the cloud, and its own warning says the agent has full access to the machine it runs on. Both point at the same answer: a machine that is nobody's laptop. The project's server guide calls 2 vCPU and 4 GB plenty for one user; BD-8 at $12.90 a month gives it twice that for less than the 4 GB machines elsewhere.

What it needs

Software from the docs, sizes labelled by source

The software and the security posture come from the project's own documentation. Where the project publishes no hardware figure, the sizes say whose they are.

From the OpenHands README, SELF_HOSTING.md and docs

  • “2 vCPU / 4 GB RAM is plenty for a single user” (the project's VM guide). The docs ask for “a modern processor and a minimum of 4GB RAM”.
  • Install: Node.js 24 or later and uv, then npx @openhands/agent-canvas --public. One command starts the agent server, the automation backend and the web app behind an ingress on 127.0.0.1:8000.
  • Set LOCAL_BACKEND_API_KEY before the first start: in public mode every API call must carry it and the web app asks for it before anything else. Firewall everything but SSH first; the guide says to do that before the agent ever runs.
  • An API key from a model provider: the docs say OpenHands needs one for most models. Docker is optional and only needed if you want each conversation sandboxed in its own container. No GPU unless you host the model yourself.

Sizes (the project's figure, then ours)

Sizing by workload
WorkloadvCPURAM
One user, hosted models, agent on the host (official)The guide's own figure. The agent server runs directly on the machine, so the machine is the sandbox.24 GB
One or two users, a Docker sandbox per conversationOurs. Each conversation gets a container; dependency installs, builds and test suites run inside them.48 GB
A team's shared agent server, several agents at onceOurs. Parallel agents on parallel repositories, each compiling something.824 GB

The plans that fit

5 machines, priced live

Cheapest fitting machine first. Prices are today's, per month, read from the catalogue.

  • BD-8$12.90/mo

    4 vCPU · 8 GB · 100 GB disk · 32 TB

    Cheapest with room to build and test. 4 vCPU, 8 GB, 100 GB and 32 TB of transfer, for less than the 4 GB machines elsewhere. Twice the guide's figure; test suites notice the cores.

  • U2-4-40$14.90/mo

    2 vCPU · 4 GB · 40 GB disk · Unmetered

    Exactly the guide's figure, unmetered, Istanbul. 2 vCPU / 4 GB / 40 GB. One user, hosted models, the agent on the host. Unmetered traffic for clones and package installs.

  • BD-24$31.90/mo

    8 vCPU · 24 GB · 300 GB disk · 32 TB

    8 vCPU / 24 GB for a team's agent server. Several agents at once, Docker sandboxes, the automation backend on a schedule.

  • C2-4-80$37.90/mo

    2 vCPU · 4 GB · 80 GB disk · 3 TB

    The guide's figure, in dozens of cities. 2 vCPU / 4 GB / 80 GB. Pick it for the city; keep one conversation at a time.

  • C4-8-160$75.90/mo

    4 vCPU · 8 GB · 160 GB disk · 3 TB

    4 vCPU / 8 GB / 160 GB, in dozens of cities. The comfortable size with disk for many checkouts and Docker images.

There is no start-up preset for OpenHands yet: the install is the five steps below, typed by you, in the order the project's own guide gives them. Firewall first, key second, agent third.

The install

Five steps, in the order OpenHands' own guide gives them

The guide is explicit that the firewall comes before the first start, because the agent server has the run of the machine and only the firewall and the key stand between it and a stranger.

  1. Firewall first. ufw allow OpenSSH && ufw --force enable Nothing inbound but SSH. The ingress (8000), the agent server (18000), the automation backend (18001) and the static server (3001) must not be reachable from outside; the guide says so in those words.
  2. Node.js 24 and uv. apt-get install -y curl git curl -fsSL https://deb.nodesource.com/setup_24.x | bash - && apt-get install -y nodejs curl -LsSf https://astral.sh/uv/install.sh | sh uv runs the agent server; the guide installs it with the one-line installer from astral.sh.
  3. Generate the key, start in public mode. export LOCAL_BACKEND_API_KEY=$(openssl rand -base64 32); echo $LOCAL_BACKEND_API_KEY npx @openhands/agent-canvas --public Copy the key somewhere safe before you go on; public mode means the web app will ask you for it. For a long-term run, the guide's systemd unit at /etc/systemd/system/agent-canvas.service with Environment=LOCAL_BACKEND_API_KEY=… in it, then systemctl enable --now agent-canvas.
  4. Reach it over SSH, add the model. ssh -N -L 8000:127.0.0.1:8000 root@your-server then http://127.0.0.1:8000, paste the key, then Settings: choose the LLM provider and model and paste that provider's API key. Start a conversation on a repository.
  5. Optionally, a domain. Point an A record at the server, open 80 and 443, apt-get install -y nginx certbot python3-certbot-nginx, and the guide's nginx block that proxies to 127.0.0.1:8000 with WebSocket headers; certbot --nginx -d canvas.example.com --redirect gets the certificate. If 443 must be open to the world, the guide says the key is your primary defence, so keep it long and keep it secret.

Honestly

What we would actually buy

The guide says 2 vCPU and 4 GB is plenty for one user. Buy the 8 GB machine that costs less than the 4 GB ones and let the agent compile things.

For one person's coding agent

BD-8 · $12.90/mo

4 vCPU, 8 GB and 100 GB at $12.90: the agent server, a few checked-out repositories, their dependency trees, and a test suite running while you watch, with memory left if you turn on Docker sandboxes. The model is elsewhere, behind an API key, so this machine never needs a GPU and the bill that matters is the provider's. C2-4-80 at $37.90 is the guide's exact figure in dozens of cities, if the city matters more than the cores.

Questions

What people ask before they buy one.

How much RAM does OpenHands need?
The project's own VM guide says 2 vCPU and 4 GB of RAM is plenty for a single user, and its docs recommend a modern processor and a minimum of 4 GB. That covers the agent server, the automation backend and the web app with hosted models. What the agent then does, cloning repositories, installing dependencies, running builds and tests, is ordinary developer work and wants ordinary developer resources, which is why the cheapest machine on this page has 4 cores and 8 GB rather than the exact floor.
Why run it on a server instead of my laptop?
Two reasons from the README itself. It says the most powerful way to run OpenHands is on a server in the cloud, so agents keep running when your laptop is shut and can be triggered from Slack, GitHub or a webhook. And it warns that the agent server runs directly on the machine with full access to the filesystem, shell and network. A machine that holds nothing but the agent and the repositories it works on is the honest way to give it that access.
Does it need an API key, or can it use a local model?
Its docs say OpenHands requires an API key to access most language models, and list the hosted providers it recommends. A local model through Ollama or a similar server is supported, but the docs add that effective agent work on local models needs capable hardware and models tuned for instruction following. In practice: a hosted model and an API key on this machine, and if you want a local model, a separate model server sized on the Ollama page or the GPU line.
What does --public and LOCAL_BACKEND_API_KEY do?
Without --public, the app injects its session key into the web page for convenience, which the README calls unsafe for a publicly reachable deployment. With --public, the key is not in the page: everyone who opens the web app must paste LOCAL_BACKEND_API_KEY first, and every call to the API must carry it. The guide's order is firewall, then key, then start, and it generates the key with openssl rand -base64 32.
Do I need Docker?
Not for the default install, which runs the agent server on the host with Node 24 and uv. Docker is for the sandboxed modes: running the whole stack from the project's image, or giving each conversation its own container so several agents can work at once without sharing a filesystem. The README notes that the sandbox isolates conversation execution, not the whole app. If you want it, install Docker and budget the 8 GB row or more.
Which ports are involved?
Everything binds to loopback: the ingress proxy on 127.0.0.1:8000 routes to the static server on 3001, the agent server on 18000 and the automation backend on 18001. You reach 8000 over an SSH tunnel, or through nginx on 443 if you add a domain. None of those four ports should be open on the firewall; the guide lists them by number as the ones that must not be reachable from outside.