Can an AI agent drive OrbStack?
Claude Code uses OrbStack for throwaway test infrastructure: containers, a Linux machine, Kubernetes. Also how one check started my stack and tunnel.
Yes, and it’s the tool here that Claude Code has used most. OrbStack gives it Docker, Linux machines and a one-node Kubernetes cluster from the command line, so it can stand up a real database for a test and throw it away seconds later. The catch is what happens when OrbStack starts: a plain status check started my stopped stack, including a Cloudflare tunnel.
| Verdict | |
|---|---|
| Run throwaway containers | Works |
| Run a long-lived Compose stack | Works: on a real web app, about seven weeks of active use |
| Create and delete a Linux machine | Works |
| Kubernetes pods | Works, after two wrong turns |
| Report failure through the exit code | Works in what I tried: Docker, orb and kubectl |
| Check its own work | Works: it queries what it started |
| Run a check without side effects | Didn’t work: a status check started everything |
| Run unattended | Works with limits: no prompts locally; start has reported a timeout while OrbStack came up anyway |
The way in
Three commands, all plain CLIs: docker for containers, orb or orbctl for machines and
settings, and kubectl for the cluster. No screen control is involved.
Before you run any of this, check what’s set to restart with OrbStack. If it’s stopped, these commands start it, and those containers with it.
A throwaway database. Bind to 127.0.0.1, let Docker pick the port, and use --rm, so stopping
it removes it:
docker run -d --rm --name zz-spike-pg -e POSTGRES_PASSWORD=spike-only -p 127.0.0.1::5432 postgres:18-alpine
for i in $(seq 1 60); do docker exec zz-spike-pg psql -h 127.0.0.1 -U postgres -tAc 'select 1' >/dev/null 2>&1 && break; sleep 0.5; done
docker exec zz-spike-pg psql -h 127.0.0.1 -U postgres -tAc 'select version()'
docker stop zz-spike-pgWith the image already on the Mac, it answered queries about 2 seconds after starting, and nothing was left behind. Five one-off containers took 0.17 to 0.20 seconds each. That’s cheap enough that Claude can test against the real database, not a mock.
A Linux machine. For when a test needs a whole system and not one process:
orbctl create alpine zz-spike
orb -m zz-spike uname -a
orbctl delete -f zz-spikeCreating it took 8.1 seconds, including the image download.
Kubernetes. The setting needs a restart to take effect:
orbctl config set k8s.enable true
orbctl stop
orbctl start
kubectl --context orbstack get nodesThe node was ready about 4 seconds after orbctl start returned, so get nodes may need a
retry. kubectl wait saw a Postgres pod using the image already on the Mac become ready 0.5 seconds
after creating it, and it answered a query on the third try. A bad image name gave ErrImagePull, and kubectl wait
exited 1. Deleting the namespace took about 10 seconds.
Real tasks
- A web app’s stack. From late July to mid-September, Claude worked on a Rails app’s Compose
stack on OrbStack, with
docker compose exec,up,logs,psandrun. - A monitoring experiment. In August, Claude ran kube-prometheus-stack on OrbStack’s Kubernetes. I had it removed in early September. Being able to throw away an experiment like that is the point.
- Measuring. Claude compared two memory allocators by per-container memory in the Rails stack, on my Mac mini.
- Guides on this site. The disk space guide was tested on it.
What failed
- A status check started my stack and tunnel. OrbStack was stopped, and Claude ran
orb version,orb list,orbctl statusanddocker psas harmless checks. I didn’t isolate which one did it, andorb versionran first. That launched OrbStack, which brought back five containers set to restart automatically: a web app, a database, a cache, a mail tool and a Cloudflare tunnel, whose log showed its connection checks passing.docker pslisted the published ports on0.0.0.0, though OrbStack’sdocker.expose_ports_to_lansetting was off, and I didn’t test reaching them from another machine. Claude tried to stop it, a permission check blocked that, and it asked me. I said yes. This wasn’t the first time: the disk space guide records the same kind of mistake. - Testing around that stack. To test here, each OrbStack start had to be followed at once by stopping those containers. That still leaves the tunnel up for a moment each time. The containers come back on the next start, because that’s their restart policy. If yours include a tunnel, deal with that before you hand this to an agent.
- A database that wasn’t ready.
pg_isreadypassed, thenpsqlfailed with a socket error. The image’s first-start setup was running, and it’s why the example retries a real query over TCP. - Kubernetes that wasn’t on. After
config set, Claude polled for 90 seconds and gotconnection refused. The command had said in plain words to restart OrbStack, and the script kept polling anyway. - A pod too soon after its namespace. The first pod failed with
serviceaccount "default" not found. Waiting for the account fixed it. - Start timing out. On two earlier occasions,
orbctl startover SSH on my mini andorb starton another run reportedtimed out waiting for VM to start, though OrbStack was running afterward. Check status, not just that message.
Can it check its own work?
Yes, for what it started. It can query the database, read logs and docker ps, and confirm nothing was left.
orbctl doctor passed, with warnings that kubectl wasn’t OrbStack’s copy. A missing image exited 125, and a
missing machine exited 1. Passing here doesn’t prove your production setup behaves the same way.
Can it run unattended?
Partly. Nothing asked for input in these tests, and OrbStack also installed over SSH on my Mac mini. I didn’t test a schedule, or anything with nobody logged in.
Security
- A Linux machine isn’t a sandbox. My test machine could list my Mac’s home folder and read
~/.zshrc, it wrote a file into a Mac folder, andorb -m zz-spike mac uname -sran a command on the Mac itself and printedDarwin. Treat what runs there as running as you. My UTM test VM had no shared folders, though I didn’t test its reach to the host. - Docker access is broad. An agent that can run
dockercan start containers, publish ports, stop your stack, or delete data in it. - Starting OrbStack starts your stack. Check what has a restart policy, particularly tunnels, before
letting an agent run
orbordocker. - Ports: bind test containers to
127.0.0.1, and use a throwaway password, as above. - Images: pulling means running someone else’s code. The containers used images already on the Mac, and the Linux machine downloaded its own.
- Keep names obvious. My test resources all start with
zz-, so cleanup is less likely to touch anything real.
Not tried
- Machines other than Alpine, and Intel images
- OrbStack’s domain names for containers beyond one failed request
- Exporting or importing a machine
- Running on a schedule, or with nobody logged in
- Whether Docker or machines work offline
Tested on
OrbStack 2.2.5 on an M2 Pro MacBook Pro with 16 GB, macOS 27.2, on November 4, 2026, with Kubernetes v1.35.6+orb1. I set Kubernetes back to off and stopped OrbStack afterward. The earlier work ran on 2.2.1 and later, from July 2026.