Cloudflare Sandbox vs Railway

Cloudflare Sandbox gives you containers, each in its own microVM, that you drive from a Worker and that sleep when idle and wake on the next request. Railway is an app platform for services and databases that added Linux VM sandboxes in 2026, which are destroyed after an idle timeout.

The companies and products

Cloudflare Sandbox

Cloudflare Sandbox SDK runs untrusted or AI-generated code in Linux containers on Cloudflare's network, driven from a Cloudflare Worker.

Each sandbox is a Cloudflare Container backed by a Durable Object, and each container runs in its own Firecracker microVM with its own kernel and network. You build a linux/amd64 image, pick an instance type of up to 4 vCPU and 12 GiB, and reach the sandbox through your own Worker. It suits teams already on Workers who want short-lived sandboxes that sleep when idle; for code that only calls known methods, Cloudflare also offers Dynamic Workers, which run JavaScript in V8 isolates.

Railway

Railway is a cloud platform for deploying web apps, servers and databases, which now also sells sandboxes and cloud agents.

Railway's main product is app hosting: you deploy services and databases as containers on its own hardware. In 2026 it added Sandboxes, isolated Linux VMs you create from the CLI or a TypeScript SDK, run commands in and destroy, and Cloud Agents, a personal VM for running a coding agent, in early access. It suits teams already hosting on Railway who want throwaway machines next to their apps.

Which use cases each one fits

For each use case, Battleships prices every sandbox provider on the same workload and sorts them from the cheapest monthly bill up. “13th cheapest of 345” means 12 of the other 344 providers run that workload, with every feature it needs, for less. “With limits” means the provider runs it but misses something, so it is listed after every full match. Open a use case for its whole ranking and what each provider misses.

Use case and its workloadCloudflare Sandbox: price rankRailway: price rankbochka: price rank
Software factory
100 at once · 4 vCPU / 8 GB · 2,200 sessions of 8 h a month
A software factory needs machines that keep their work; Cloudflare wipes the disk on sleep and Railway destroys idle sandboxes, while bochka keeps the disk and adds Docker and a desktop.
162nd of 367, with limits
$1,543 a month
51st of 367, with limits
$342 a month
3rd cheapest of 367
$634 a month
Always-on AI employees
50 machines 24/7 · 2 vCPU / 4 GB
Railway fits always-on assistants if you set the idle timeout to 0, with memory billing the whole time; Cloudflare wipes the disk on sleep, and bochka keeps it across stops.
207th of 366, with limits
$2,188 a month
16th cheapest of 366
$3,977 a month
5th cheapest of 366
$657 a month
Code interpreter bursts
100 at once · 1 vCPU / 2 GB · 200,000 sessions of 1 min a month
Both fit short code runs; Cloudflare bills CPU only while busy and wakes a sleeping sandbox on the next request, which makes it the stronger pick of the three here.
13th cheapest of 345
$144 a month
36th cheapest of 345
$413 a month
186th of 345, with limits
$2,000 a month
Sandboxes for your users
300 at once · 2 vCPU / 4 GB · 30,000 sessions of 23 min a month
Cloudflare fits sandboxes for your users fully, while Railway's 100 sandboxes per environment on Pro means 300 at once needs several environments; bochka fits too and adds per-sandbox spend limits.
9th cheapest of 361
$731 a month
42nd of 361, with limits
$290 a month
Cheapest of 361
$209 a month
RL rollouts
1,000 at once · 2 vCPU / 4 GB · 1,000,000 sessions of 3 min a month
144th of 360, with limits
$9,428 a month
78th of 360, with limits
$4,450 a month
34th of 360, with limits
$2,000 a month
Agent evals
250 at once · 4 vCPU / 8 GB · 15,000 sessions of 20 min a month
Cloudflare fits agent evals, while Railway can fork a running sandbox but caps how many run per environment; bochka forks running sandboxes and runs up to 2,000 at once by plan.
45th cheapest of 364
$818 a month
108th of 364, with limits
$364 a month
10th cheapest of 364
$200 a month
CI runners
40 at once · 8 vCPU / 16 GB · 6,000 sessions of 12 min a month
CI jobs that build images need Docker: Cloudflare runs docker:dind with iptables off and 20 GB of disk by default, Railway's sandbox docs do not mention Docker, and bochka has full Docker.
301st of 377, with limits
$704 a month
113th cheapest of 377
$1,210 a month
4th cheapest of 377
$86 a month
24/7 dev boxes
1 machine 24/7 · 4 vCPU / 8 GB
Both fit a 24/7 dev box at about the same cost, but Cloudflare starts from a fresh disk after sleep and Railway's Cloud Agents are early access; bochka stops at no cost and keeps its disk.
70th cheapest of 368
$93 a month
66th cheapest of 368
$89 a month
18th cheapest of 368
$26 a month
Computer-use agents
50 at once · 4 vCPU / 8 GB · 20,000 sessions of 15 min a month
Neither ships a desktop: Cloudflare removed its built-in one and Railway sandboxes are headless, while bochka has a 60fps desktop and a computer-use API.
166th of 369, with limits
$460 a month
77th of 369, with limits
$103 a month
6th cheapest of 369
$200 a month
Browser-use agents
50 at once · 2 vCPU / 4 GB · 30,000 sessions of 10 min a month
210th of 367, with limits
$233 a month
53rd of 367, with limits
$93 a month
7th cheapest of 367
$200 a month
Scraping & bots (startup scale)
50 at once · 1 vCPU / 2 GB · 100,000 sessions of 3 min a month
250th of 346, with limits
$286 a month
60th cheapest of 346
$570 a month
6th cheapest of 346
$90 a month
Mass scraping & bots (undetectable)
1,000 at once · 1 vCPU / 2 GB · 3,000,000 sessions of 2 min a month
169th of 338, with limits
$5,741 a month
109th of 338, with limits
$2,988 a month
71st of 338, with limits
$1,800 a month
Parallel red teaming
200 at once · 2 vCPU / 4 GB · 5,000 sessions of 30 min a month
239th of 360, with limits
$325 a month
43rd of 360, with limits
$574 a month
2nd cheapest of 360
$200 a month
GPU eval jobs
10 at once · 8 vCPU / 32 GB · 500 sessions of 30 min a month
Can't run itCan't run itCan't run it
macOS agents
5 at once · 4 vCPU / 8 GB · 1,000 sessions of 20 min a month
Can't run itCan't run itCan't run it

Key features

FeatureCloudflare SandboxRailwaybochka
IsolationFirecracker microVM per container, own kernel and networkSandboxes are isolated Linux VMs; app services are containersFull VM with its own kernel on dedicated AMD Ryzen 9 9950X hosts
Largest machine4 vCPU / 12 GiB / 20 GB disk by default (can be raised)8 vCPU / 8 GB on Hobby, 32 vCPU / 32 GB on Pro8 vCPU / 16 GB on the $20 plan, 16 vCPU / 32 GB from $100
When the sandbox goes idleSleeps after inactivity and wakes on the next request, with a fresh diskDestroyed after the idle timeout (30 minutes by default); files survive only in checkpoints you takeYou stop it; the disk is kept, with snapshots every minute and on stop, and a stopped sandbox costs nothing
Fork a running sandboxNo fork; restore a saved snapshot or backup into a new sandboxFork a running sandbox's filesystem; named disk checkpoints to boot new onesFork a running sandbox without stopping it; named snapshots to start new ones
Docker insidedocker:dind with iptables and IP forwarding turned offRoot shell on Ubuntu; the sandbox docs do not mention DockerFull Docker, root and systemd
Nested virtualizationNot documentedNot mentioned in the sandbox docsYes, /dev/kvm (Android emulators, VMs)
Desktop and computer useBuilt-in desktop removed in SDK 0.10.2; bring your ownHeadless: terminal, exec and SSH only60fps desktop and Chromium, computer-use API, embeddable stream
Inbound trafficHTTP and WebSocket previews routed through your Worker; no raw TCP or public IPUp to 10 public HTTPS domains, set only at creation; SSH and port forwardingHTTPS URLs for up to 50 ports, token-protected; raw TCP; own IPv6 or IPv4
Egress controlallowedHosts deny-by-default list plus outbound handlers you write in Worker codeNo egress allowlist for sandboxesNo provider-side allowlist
Keeping keys out of the sandboxYour outbound handler adds the token for any HTTP or HTTPS host; you write the codeSecrets sit in the sandbox as environment variables, or are signed in and saved in a checkpointManaged proxy for model providers and any HTTPS API you register; switch a credential to another account
Coding agentsRun Claude Code, Codex, OpenCode or Pi in your own image; OpenCode has an SDK helperClaude Code, Codex, OpenCode and Pi preinstalled; you run them headless through execClaude Code, Codex, OpenCode and more preinstalled, with a prompt, steer and events API
Sandboxes at onceAccount limit of 1,500 vCPU running at once by default50 per environment on Hobby, 100 on Pro; Enterprise can ask for more100 to 2,000 by plan
Platform around the sandboxSits next to Workers, Durable Objects and R2Postgres, Redis and services in the same project; a sandbox can join their private networkSandboxes only; host your own services inside a VM
RegionsSeveral regions across Cloudflare's network, nearest free instance pickedUS West, US East, Amsterdam and Singapore; new sandboxes start in US WestEU only: Germany, Finland, France
Every feature Battleships tracks (43)
FeatureCloudflare SandboxRailwaybochka
Full VM (own kernel)YesYesYes
Docker insideYesNot publishedYes
Nested virtualizationNoNoYes
RootYesYesYes
SystemdNot publishedNot publishedYes
Desktop GUINoNoYes
BrowserNoYesYes
Computer-use APINoNoYes
SSHYesYesYes
Persistent diskNoYesYes
Pause/resumeNoYesYes
Automatic snapshotsNoNoYes
Fork/cloneNoYesYes
Live fork (no pause)NoYesYes
Memory forkNoNoNo
Custom image (Docker or snapshot)YesYesYes
≥24 h sessionsYesYesYes
Idle auto-stopYesYesNo
Wake on requestYesNoNo
HTTPS preview URLsYesYesYes
Raw TCP inboundNoNoYes
Public IPv4NoNoNo
Egress allowlistYesNoNo
Secret proxyYesNoYes
Secret proxy for any APIYesNoYes
Preinstalled agentsYesYesYes
Agent harness APIYesYesYes
MCP serverNoYesNo
GPUNoNoNo
WindowsNoNoNo
Arm64NoNoNo
Self-hostingNoNoNo
BYOCNoYesNo
Open sourceYesNoNo
Scoped API keysNot publishedNot publishedYes
Spend limitsNoYesYes
Usage per sandbox (API)Not publishedNoYes
Audit logsYesYesNo
SSOYesYesNo
SOC 2YesYesNo
HIPAAYesYesNo
EU data residencyYesYesYes
Zero data retentionNot publishedNot publishedYes

Performance

Cloudflare SandboxNot measured
RailwayNot measured
bochka26.69 runs/s

There is no comparable CPU measurement for Cloudflare Sandbox or Railway: neither has a result on StarSling's hpc-sandbox-benchmarks Node.js build-and-test loop. bochka did 26.69 runs per second there at 4 vCPU / 8 GB, so we cannot say which of the three is fastest.

Node.js build-and-test loop at 4 vCPU / 8 GB, higher is better. Measured with the open hpc-sandbox-benchmarks suite. Cloudflare Sandbox and Railway have no published run in this suite yet, so there is no like-for-like number to compare.

Pricing in five scenarios

Each bill is priced from the providers' public price lists by the open Battleships engine, with the cheapest plan that runs the scenario.

ScenarioCloudflare Sandbox, a monthRailway, a monthbochka, a month
One coding agent, workdays
4 vCPU / 8 GB, 50 GB disk, 8 hours a day, 22 days a month, files kept between days
$39 · Workers Paid · with limits$16 · Hobby · with limits$20 · $20/mo
One agent that never stops
4 vCPU / 8 GB, 50 GB disk, running 24/7 all month
$148 · Workers Paid · with limits$70 · Hobby · with limits$26 · $20/mo
50 agents in parallel
50 machines of 4 vCPU / 8 GB at once, 8-hour sessions, 1,100 sessions a month, Docker inside
$1,660 · Workers Paid · with limits$739 · Hobby · with limits$317 · $20/mo × 3 seats
Sandboxes for your users
2 vCPU / 4 GB, 30,000 sessions of 10 minutes a month, up to 300 at once
$476 · Workers Paid$223 · Pro · with limits$200 · $100/mo × 2 seats
1,000 short jobs at once
2 vCPU / 4 GB, 1,000 at once, 3 minutes each, 200,000 jobs a month
$1,889 · Workers Paid · with limits$781 · Pro · with limits$2,000 · $2000/mo · with limits

Cloudflare Sandbox: You need Workers Paid ($5 a month minimum). CPU is billed only while busy; memory and disk are billed on the instance size you picked until the container sleeps, and 4 vCPU always comes with 12 GiB.

Railway: Railway bills sandboxes per second at $50 per vCPU-month on CPU used and $50 per GB-month on memory in use, which keeps billing while a sandbox waits. It does not publish a price for sandbox disk or checkpoints, so its bills here leave disk out.

Railway: You pick a monthly plan from $20, and all of it becomes usage credit spent per second on running sandboxes. A stopped sandbox costs nothing and keeps its disk.

Limits in those scenarios

Cloudflare's disk resets after sleep, so no scenario that keeps 50 GB of files between days fits there, and its default 1,500 vCPU account limit is short of the 2,000 vCPU the 1,000-job burst needs. Railway is marked as an app platform with no published disk price, and its 100 sandboxes per environment on Pro do not cover 300 sandboxes for your users or 1,000 jobs at once. On bochka, the burst waits in a queue above 90 starts a minute and needs more starts a day than the $2,000 plan allows.

ScenarioCloudflare SandboxRailwaybochka
One coding agent, workdays
  • missing persistent disk
  • different kind of product: app platform
  • disk beyond 0 GiB: price unknown
None that bite
One agent that never stops
  • missing persistent disk
  • different kind of product: app platform
  • disk beyond 0 GiB: price unknown
None that bite
50 agents in parallel
  • missing persistent disk
  • not confirmed: Docker inside
  • different kind of product: app platform
  • disk beyond 0 GiB: price unknown
None that bite
Sandboxes for your usersNone that bite
  • Pro: max 100 concurrent
  • different kind of product: app platform
  • disk beyond 0 GiB: price unknown
None that bite
1,000 short jobs at once
  • Workers Paid: max 1,500 vCPU running at once (needs 2,000)
  • Pro: max 100 concurrent
  • different kind of product: app platform
  • disk beyond 0 GiB: price unknown
  • max 2,400 starts/day (needs ~6,667)
  • max 600 starts/hour (needs ~1,000)
  • bursts above 90 starts/min are queued (a burst of 333 takes ~4 min to start)

Which one should you use?

Use Cloudflare Sandbox when

your app already runs on Workers and you want short sandboxes that sleep when idle, wake on the next request, and follow egress rules you write.

  • Sleeps when idle, wakes on request. Useful for many short, spiky sessions: a sandbox sleeps when idle, wakes on the next request, and bills CPU only while busy.
  • Egress rules you can program. Useful when sandboxes run untrusted code: block every host except the ones you list, and run your own code on each outbound request.
  • Built into the Workers platform. If your app already runs on Workers, sandboxes sit next to Durable Objects and R2, in several regions of Cloudflare's network.

Use Railway when

your app and databases already live on Railway and you want short-lived sandboxes on the same private network, with large machines and US or Asia regions.

  • Your apps and databases in one place. Useful if your app already runs on Railway: sandboxes can join the same private network as your Postgres and services.
  • Bigger sandboxes and forks. Useful for heavy jobs: Pro sandboxes go up to 32 vCPU / 32 GB, and you can fork a running sandbox's filesystem.
  • Coding agents in the default image. Useful for a quick start: Claude Code, Codex, OpenCode and Pi come preinstalled, ready to run headless through exec.

Where bochka fits

Both Cloudflare and Railway are built around short-lived sandboxes next to a larger platform: one sleeps and loses its disk, the other is destroyed when idle. If what you are running is coding agents that work for hours or days, bochka gives each one a full VM that keeps its disk, with Docker, a desktop and an API to drive the agent from outside.

A disk that stays

On Cloudflare a sleeping sandbox wakes with a fresh disk, and on Railway an idle sandbox is destroyed after 30 minutes. Either way you write snapshot or checkpoint code, or on Railway turn the timeout off and pay for memory all along.

Docker, KVM and a desktop in one machine

Cloudflare runs Docker with iptables off on 20 GB of disk by default, and Railway's sandbox docs do not mention Docker. Neither has /dev/kvm or a desktop, so an agent cannot boot an emulator or check a UI in a real browser.

Agents driven from outside, keys kept outside

On Cloudflare you bake each agent into your image and write the outbound handler that adds every token. On Railway you shell agents through exec and their API keys sit inside the VM, where code the agent runs can read them.

Use bochka when your agents work for hours or days: a full VM that keeps its disk, with Docker, /dev/kvm, a desktop, and coding agents you drive from outside while their keys stay outside. Compare it one to one: bochka vs Cloudflare Sandbox and bochka vs Railway.

Questions people ask

Is Cloudflare Sandbox cheaper than Railway?

In our five scenarios Railway's estimate is lower every time, for example $70 against $148 for one agent running all month, but Railway's numbers leave out disk, which it does not price. Only Cloudflare fits the sandboxes-for-your-users scenario cleanly ($476 a month), because Railway Pro caps an environment at 100 sandboxes.

Which is faster, Cloudflare Sandbox or Railway?

We cannot say. Neither has a result on StarSling's public Node.js build-and-test benchmark, where bochka did 26.69 runs per second at 4 vCPU / 8 GB.

Can Cloudflare Sandbox or Railway run Docker?

Cloudflare supports docker:dind with the daemon's iptables and IP forwarding turned off, because containers cannot change iptables. Railway's sandbox docs do not mention Docker. bochka runs full Docker with root and systemd.

Do they keep my files?

Cloudflare keeps files only while the container runs; after sleep it starts from a fresh disk unless your code saved a snapshot or an R2 backup. Railway destroys a sandbox after its idle timeout, so files survive only in checkpoints you took. A bochka sandbox stops instead and keeps its disk.

Are they VMs or containers?

Both run VMs underneath. Cloudflare runs each container you ship in its own Firecracker microVM, and Railway's docs call each sandbox an isolated Linux VM, while its regular app services are containers. bochka sandboxes are full VMs too.

Where does each one run?

Cloudflare places sandboxes in several regions of its network and picks the nearest free instance. Railway runs in California, Virginia, Amsterdam and Singapore, and new sandboxes start in US West. bochka runs only in the EU, in Germany, Finland and France.

Try bochka

Install the CLI, then run bochka new.

Product preview

More comparisons

Bochka product preview · Pricing, benchmarks and commands are illustrative. Sandbox provisioning is not connected.