Cloudflare Sandbox vs Railway

Cloudflare Sandbox gives you containers, each in its own microVM, that you drive from a Worker. They sleep when idle, wake on the next request, and keep files through snapshots or R2 that your code sets up. Railway is an app platform for services and databases that added Linux VM sandboxes in 2026. A Railway sandbox is destroyed at its idle timeout unless you set the timeout to 0, and checkpoints you take keep its files.

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. 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. The disk resets when the container stops, and your code keeps files with snapshots, automatic saves, R2 backups or R2 bucket mounts. It suits teams already on Workers who want 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. It 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 that you create from the CLI or a TypeScript SDK, run commands in and destroy. It also added Cloud Agents: a personal VM for a coding agent that keeps its disk and sleeps or wakes. Cloud Agents are in Priority Boarding, and breaking changes may occur. Railway suits teams that already host on Railway and want sandboxes 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. “43rd cheapest of 361” means 42 of the other 360 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 rankboat: 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. On Cloudflare your code saves snapshots, automatic saves or R2. On Railway you take checkpoints before the idle timeout, or use a Cloud Agent, which keeps its disk. boat saves the disk with no code and adds Docker and a desktop.
192nd of 365, with limits
$1,543 a month
28th cheapest of 365
$1,481 a month
5th cheapest of 365
$634 a month
Always-on AI employees
50 machines 24/7 · 2 vCPU / 4 GB
Railway fits always-on assistants with the idle timeout set to 0, and memory bills the whole time. On Cloudflare your code keeps files with snapshots or a mounted R2 bucket. On boat you turn auto-stop off on a paid plan (default 1 hour), and a running sandbox bills at full rate.
43rd cheapest of 361
$2,188 a month
21st cheapest of 361
$3,977 a month
6th cheapest of 361
$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. Railway bills CPU used, ends the sandbox when the job ends, and publishes no start limit.
17th cheapest of 336
$144 a month
42nd cheapest of 336
$413 a month
189th of 336, 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, with 1,500 vCPU per account by default. Railway allows 100 sandboxes per environment on Pro, so 300 at once needs several environments or an Enterprise limit. boat runs 300 at once from the $100 plan, with starts limited per plan.
19th cheapest of 349
$731 a month
46th of 349, with limits
$290 a month
3rd cheapest of 349
$209 a month
RL rollouts
1,000 at once · 2 vCPU / 4 GB · 1,000,000 sessions of 3 min a month
147th of 349, with limits
$9,428 a month
84th of 349, with limits
$4,450 a month
39th of 349, with limits
$2,000 a month
Agent evals
250 at once · 4 vCPU / 8 GB · 15,000 sessions of 20 min a month
Railway can fork a running sandbox's filesystem but caps sandboxes per environment. Cloudflare starts new sandboxes from a saved snapshot or backup. boat forks a running sandbox from its last 1-minute snapshot and runs up to 2,000 at once by plan.
60th cheapest of 359
$818 a month
113th of 359, with limits
$364 a month
10th cheapest of 359
$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 has 20 GB of disk at most. Railway's sandbox docs do not mention Docker, so you install and verify it yourself. boat has Docker with BuildKit on every sandbox.
303rd of 374, with limits
$704 a month
116th cheapest of 374
$1,210 a month
2nd cheapest of 374
$86 a month
24/7 dev boxes
1 machine 24/7 · 4 vCPU / 8 GB
A dev box should keep its files when you log off. Cloudflare starts a fresh disk after sleep unless your code restores a snapshot (beta, 30 days) or mounts an R2 bucket. Railway's Cloud Agents keep their disk, but are in Priority Boarding. boat keeps a stopped disk at least 14 days.
123rd cheapest of 371
$93 a month
69th cheapest of 371
$89 a month
19th cheapest of 371
$26 a month
Computer-use agents
50 at once · 4 vCPU / 8 GB · 20,000 sessions of 15 min a month
Neither ships a built-in desktop. On Cloudflare you build one into your image, or use the separate Browser Run service. On Railway you add Xvfb and noVNC with the template builder and publish the port. boat streams a 60 fps desktop with computer tools.
207th of 367, with limits
$460 a month
47th cheapest of 367
$407 a month
7th cheapest of 367
$200 a month
Browser-use agents
50 at once · 2 vCPU / 4 GB · 30,000 sessions of 10 min a month
68th of 356, with limits
$233 a month
53rd of 356, with limits
$93 a month
7th cheapest of 356
$200 a month
Scraping & bots (startup scale)
50 at once · 1 vCPU / 2 GB · 100,000 sessions of 3 min a month
102nd cheapest of 343
$286 a month
65th cheapest of 343
$570 a month
6th cheapest of 343
$90 a month
Mass scraping & bots (undetectable)
1,000 at once · 1 vCPU / 2 GB · 3,000,000 sessions of 2 min a month
168th of 327, with limits
$5,741 a month
111th of 327, with limits
$2,988 a month
73rd of 327, with limits
$1,800 a month
Parallel red teaming
200 at once · 2 vCPU / 4 GB · 5,000 sessions of 30 min a month
25th cheapest of 351
$325 a month
71st of 351, with limits
$574 a month
3rd cheapest of 351
$200 a month
GPU eval jobs
10 at once · 8 vCPU / 32 GB · 500 sessions of 30 min a month
Not ranked: misses a requirementNot ranked: misses a requirementNot ranked: misses a requirement
macOS agents
5 at once · 4 vCPU / 8 GB · 1,000 sessions of 20 min a month
Not ranked: misses a requirementNot ranked: misses a requirementNot ranked: misses a requirement

Key features

FeatureCloudflare SandboxRailwayboat
IsolationFirecracker microVM per container, own kernel and networkSandboxes and Cloud Agents are isolated Linux VMs; app services are containersFull VM with its own kernel, on a physical host dedicated to boat (AMD Ryzen 7 9700X or Ryzen 9 9950X); vCPUs are shared
Largest machine4 vCPU / 12 GiB / 20 GB disk8 vCPU / 8 GB on Hobby; on Pro up to 32 vCPU / 32 GB per the docs (24 vCPU / 24 GB per the pricing page); disk size not published8 vCPU / 16 GB / 111 GB disk on the $20 plan; 16 vCPU / 32 GB / 251 GB disk from the $100 plan
When the sandbox goes idleSleeps after inactivity and wakes on the next request; the disk is fresh unless your code saved a snapshot (public beta, 30 days), an automatic save or R2Destroyed after the idle timeout (30 minutes by default, or 0 for never); files survive in checkpoints you take; Cloud Agents sleep and keep their diskAuto-stop 1 h by default (up to 30 days, or off on paid plans); disk saved every minute and at each stop, kept at least 14 days
Fork a running sandboxSnapshot or back up a running sandbox, then start new sandboxes from it; no one-call forkFork a running sandbox's filesystem; named disk checkpoints boot new onesFork a running sandbox in one call from its last 1-minute snapshot; saved snapshots start new ones
Custom imageAny linux/amd64 container imageTemplates built from ordered steps (apt packages, env, commands); no custom Docker image for sandboxesboat's Ubuntu 24.04 image or a saved snapshot; no custom Docker image
Docker insidedocker:dind with iptables and IP forwarding turned offRoot shell on Ubuntu; Docker not documented, you install and verify it yourselfDocker with BuildKit and Compose, root and systemd
Nested virtualizationNot documentedNot documentedYes, /dev/kvm (Android emulators, VMs)
Desktop and computer useBuilt-in desktop removed in SDK 0.10.2; build one into your own image, or use the separate Browser Run service for headless browsersNo desktop included; add Xvfb and noVNC with the template builder and publish the port; Chromium is in the Cloud Agent image1920x1080, 60 fps desktop and Chrome, computer tools, embeddable stream; no GPU
Inbound trafficHTTP and WebSocket previews routed through your Worker; SSH; no raw TCP inbound or public IPUp to 10 public HTTPS domains, set only at creation, with no built-in auth; SSH and port forwardingUp to 50 HTTPS URLs, token-gated by default; SSH; raw ports over public IPv6; the IP changes at each resume
Egress controlallowedHosts deny-by-default list plus outbound handlers you write in Worker codeNo egress allowlist documented for sandboxesNo provider-side allowlist; filter inside the VM with root
Keeping keys out of the sandboxYour outbound handler adds the token for any HTTP or HTTPS host; you write the codeSecrets enter the sandbox as environment variables, or you sign in and save it in a checkpointOptional paid proxy ($1 a day while on, plus $1 per 1,000 requests) for model providers and HTTPS APIs you register
Coding agentsGuides for Claude Code, Codex, OpenCode and Pi in your imageClaude Code, Codex, OpenCode and Pi in the default image, run through exec; Cloud Agents keep terminal sessions you reattach toSeven installed (Claude Code, Codex, OpenCode and more), with a prompt, steer and events API
Sandboxes at once1,500 vCPU running per account by default; higher on request; no per-start fee50 per environment on Hobby, 100 on Pro; Enterprise can ask for more; no published start limit100 to 2,000 by plan; $20 plan includes 12 starts a minute and 200 a day; extra starts $0.03 to $0.07
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; pin to a region or jurisdictionUS West, US East, Amsterdam and Singapore; new sandboxes start in US West unless you pick oneGermany, Finland and France; no US or Asia region; you cannot pick one
Every feature Battleships tracks (43)
FeatureCloudflare SandboxRailwayboat
Full VM (own kernel)YesYesYes
Docker insideYesNot publishedYes
Nested virtualizationNo documented wayNot publishedYes
RootYesYesYes
SystemdNot publishedNot publishedYes
Desktop GUINo documented wayWith your own setupYes
BrowserWith your own setupYesYes
Computer-use APINo documented wayNo documented wayYes
SSHYesYesYes
Persistent diskWith your own setupYesYes
Pause/resumeNo documented wayYesYes
Automatic snapshotsWith your own setupNo documented wayYes
Fork/cloneWith your own setupYesYes
Live fork (no pause)With your own setupYesYes
Memory forkNo documented wayNo documented wayNo documented way
Custom image (Docker or snapshot)YesYesYes
≥24 h sessionsYesYesYes
Idle auto-stopYesYesNo documented way
Wake on requestYesNo documented wayNo documented way
HTTPS preview URLsYesYesYes
Raw TCP inboundNo documented wayNo documented wayYes
Public IPv4No documented wayNo documented wayNo documented way
Egress allowlistYesNo documented wayNo documented way
Secret proxyYesNo documented wayYes
Secret proxy for any APIYesNo documented wayYes
Preinstalled agentsYesYesYes
Agent harness APIWith your own setupYesYes
MCP serverNo documented wayYesNo documented way
GPUNo documented wayNo documented wayNo documented way
WindowsNo documented wayNo documented wayNo documented way
Arm64No documented wayNo documented wayNo documented way
Self-hostingNo documented wayNo documented wayNo documented way
BYOCNo documented wayYesNo documented way
Open sourceYesNo documented wayNo documented way
Scoped API keysNot publishedNot publishedYes
Spend limitsNo documented wayYesYes
Usage per sandbox (API)Not publishedNo documented wayYes
Audit logsYesYesNo documented way
SSOYesYesNo documented way
SOC 2YesYesNo documented way
HIPAAYesYesNo documented way
EU data residencyYesYesNo documented way
Zero data retentionNot publishedNot publishedYes

Performance

Cloudflare SandboxNot measured
RailwayNot measured
boat28.06 runs/s

Neither Cloudflare Sandbox nor Railway is in StarSling's run of 3 October 2026 (run 37073680030), so we cannot say which is faster. In that run boat did 28.06 runs/s on the V8 Web Tooling Benchmark at 4 vCPU / 8 GB, second of 15. Every boat sandbox in this run ran on an AMD Ryzen 9 9950X host. boat also places some sandboxes on AMD Ryzen 7 9700X hosts, which this run did not measure.

V8 Web Tooling Benchmark at a 4 vCPU / 8 GB target, runs per second, higher is better. Source: StarSling's run of 3 October 2026 (run 37073680030), median of 5 sandboxes. Providers ran on different hardware in different regions. StarSling gives a shared rank when the run cannot separate two providers. Every boat sandbox in this run ran on an AMD Ryzen 9 9950X host. boat also places some sandboxes on AMD Ryzen 7 9700X hosts, which this run did not measure. Cloudflare Sandbox and Railway are not in the public benchmarks we use, so we cannot say which is faster.

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. Start limits, per-start fees and plan minimums are in the price, boat's included.

ScenarioCloudflare Sandbox, a monthRailway, a monthboat, 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$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$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$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$8,800 · $2000/mo · with limits

Cloudflare Sandbox: You need Workers Paid ($5 a month minimum). CPU is billed only while busy, at $0.072 per vCPU-hour. Memory and disk are billed on the instance size in 10 ms steps until the container sleeps. 4 vCPU always comes with 12 GiB. Snapshot pricing is not published.

Railway: Railway bills sandboxes per second at about $50 per vCPU-month on CPU used and $50 per GB-month on memory in use, plus $0.05 per GB out. Memory keeps billing while a sandbox waits, until it is destroyed. Plans: Free ($0 with $1 of usage), Hobby ($5) and Pro ($20 per workspace), and the fees count toward usage. Railway does not publish a price for sandbox disk or checkpoints, so its bills here leave disk out.

Railway: Plans cost $20, $100, $500 or $2,000 a month, and the whole plan price comes back as VM time for that month. A default 4 vCPU / 8 GB sandbox costs $0.036 an hour, billed per second while it runs, busy or idle. The $20 plan includes 12 starts a minute, 60 an hour and 200 a day; extra starts cost $0.03 to $0.07. A stopped sandbox has no compute charge and keeps its disk at least 14 days. Saved snapshots above the included count ($0.056 a day each) and the AI proxy, if on, still bill while stopped.

Limits in those scenarios

Cloudflare keeps files between days only through snapshot, automatic-save or R2 code, and its local disk tops out at 20 GB. Its default 1,500 vCPU account limit is short of the 2,000 vCPU the 1,000-job burst needs, raised on request. Railway is marked as not a clean fit in every scenario: its main product is an app platform, it publishes no sandbox disk price, and its 100 sandboxes per environment on Pro do not cover 300 user sandboxes or 1,000 jobs at once. boat does not fit the burst either: the $2,000 plan includes 90 starts a minute and 600 an hour, charges $0.03 to $0.07 for extra starts, and refuses starts above 270 a minute.

ScenarioCloudflare SandboxRailwayboat
One coding agent, workdaysNone for this scenario
  • different kind of product: app platform
  • disk beyond 0 GiB: price unknown
None for this scenario
One agent that never stopsNone for this scenario
  • different kind of product: app platform
  • disk beyond 0 GiB: price unknown
None for this scenario
50 agents in parallelNone for this scenario
  • not confirmed: Docker inside
  • different kind of product: app platform
  • disk beyond 0 GiB: price unknown
None for this scenario
Sandboxes for your usersNone for this scenario
  • Pro: max 100 concurrent
  • different kind of product: app platform
  • disk beyond 0 GiB: price unknown
None for this scenario
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
  • 2,400 starts/day included, paid above that (needs ~6,667)
  • 600 starts/hour included, paid above that (needs ~1,000)
  • starts above 90/min are paid, and starts above 270/min fail with 429

Which one should you use?

Use Cloudflare Sandbox when

your app already runs on Workers and you want short sandboxes from your own image 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 a region you can pick.

Use Railway when

your app and databases already live on Railway and you want sandboxes on the same private network, large machines, US or Asia regions, or a plan under $20 a month.

  • 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.
  • Low bills for light use. Useful for small or bursty loads: Railway bills CPU used, has a $0 Free plan and a $5 Hobby plan, and publishes no start limit.

Where boat fits

Cloudflare and Railway both put sandboxes next to a larger platform, and both keep files through steps you take: snapshots or R2 on Cloudflare, checkpoints or a zero idle timeout on Railway. If your agents work for hours or days, boat gives each one a full VM that saves its disk with no code, with Docker, a desktop and an API to drive the agent from outside. boat runs only in the EU, has no GPU and limits starts per plan.

Files that stay put with no code

On Cloudflare your code saves snapshots (kept 30 days), automatic saves or R2. On Railway you take checkpoints before the 30-minute idle timeout, or set it to 0 and pay for memory all along. boat saves the disk every minute and at each stop. Memory is not saved, so a resume is like a reboot.

Docker, KVM and a desktop in one machine

Cloudflare runs Docker with iptables off on 20 GB of disk, and Railway's sandbox docs do not mention Docker. Neither documents /dev/kvm or ships a desktop, so you build those yourself. boat has Docker with BuildKit, /dev/kvm and a 60 fps desktop.

Agents driven from outside

On Cloudflare you bake each agent into your image and write the outbound handler that adds every token. On Railway you run agents through exec, and their API keys sit inside the VM. boat has a prompt, steer and events API, and its optional paid proxy keeps supported model keys outside.

Use boat when your agents work for hours or days: a full VM that saves its disk with no code, with Docker, /dev/kvm, a desktop, and coding agents you drive from outside. Compare it one to one: boat vs Cloudflare Sandbox and boat vs Railway.

boat's own limits
  • Plans start at $20 a month. The plan price comes back as VM time for that month. Unused time does not carry over. Source
  • Starts (create, fork, resume): the $20 plan includes 12 a minute, 60 an hour and 200 a day. The $2,000 plan includes 90 a minute, 600 an hour and 2,400 a day. Extra starts cost $0.03 to $0.07. A start fails with 429 above 3 times the included starts per minute, or 6 times per hour or per day. Source
  • A stopped sandbox has no compute charge. boat keeps its disk for at least 14 days. A saved snapshot keeps it longer; extra saved snapshots and the AI credentials proxy are paid. Source
  • Auto-stop defaults to 1 hour. You can turn it off on a paid plan. The trial allows 2 hours at most. Source
  • boat saves the disk every minute and at each stop. Memory, running programs and /tmp are not saved: a resume is like a reboot. A machine failure loses writes after the last good snapshot. Source
  • Machines run in Germany, Finland and France only. Snapshot copies can be stored outside the EU. Source
  • Public IPv6 and outbound IPv4. No dedicated IPv4. The IP changes at each resume. Source
  • Hosts are AMD Ryzen 7 9700X and Ryzen 9 9950X. vCPUs are shared. No GPU. You cannot boot your own Docker image. Source

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, and $223 against $476 for 300 user sandboxes. Railway's numbers leave out disk, which it does not price, and 300 sandboxes at once need several Railway environments. boat costs $26 and $200 for the same two, but $8,800 for 1,000 short jobs at once, because it bills extra starts.

Which is faster, Cloudflare Sandbox or Railway?

We cannot say. Neither is in StarSling's run of 3 October 2026. boat did 28.06 V8 Web Tooling runs/s in that run at 4 vCPU / 8 GB, on an AMD Ryzen 9 9950X host; boat also places some sandboxes on other hosts.

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, so you install and verify it yourself. boat runs Docker with BuildKit and Compose, root and systemd.

Do they keep my files?

Yes, through steps you take. Cloudflare keeps files with a snapshot (public beta, 30 days), scheduled automatic saves, an R2 backup or a mounted R2 bucket. Railway keeps files in checkpoints you take before the idle timeout, or keeps the sandbox alive with the timeout set to 0; Cloud Agents keep their disk. boat saves the disk every minute and at each stop with no code, and keeps it at least 14 days after a stop.

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. boat sandboxes are full VMs too.

Where does each one run?

Cloudflare places sandboxes in several regions of its network and lets you pin a region or jurisdiction. Railway runs in California, Virginia, Amsterdam and Singapore, and new sandboxes start in US West unless you pick one. boat runs on machines in Germany, Finland and France, and you cannot pick a region.

Try boat

Install the CLI, then run boat new.

7-day free trial

More comparisons