Railway vs Modal VM Sandboxes

Railway is an app platform whose sandboxes are VMs that live next to your apps and databases and are destroyed when they go idle. Modal VM Sandboxes are short-lived VMs with their own kernel and Docker inside a serverless AI cloud, and each one ends within 24 hours.

The companies and products

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.

Modal VM Sandboxes

Modal is a serverless cloud for AI work, and VM Sandboxes are the version of its sandboxes that run in a virtual machine with their own Linux kernel.

You create a VM Sandbox from Python, TypeScript or Go code with runtime="vm", run commands in it, and terminate it when the job is done. Modal built the runtime on the Rust-based Cloud Hypervisor, so Docker, FUSE, systemd and nested cgroups work, with the same API, images and prices as its gVisor sandboxes. It became generally available on 1 October 2026 and suits teams that want many short-lived agent machines next to Modal's inference and training.

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. “16th cheapest of 366” means 15 of the other 365 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 workloadRailway: price rankModal VM Sandboxes: price rankboat: price rank
Software factory
100 at once · 4 vCPU / 8 GB · 2,200 sessions of 8 h a month
Railway sandboxes are destroyed when idle and Modal VMs end within 24 hours, so on both you save the work yourself; boat keeps the disk and adds a desktop to check the app.
51st of 367, with limits
$342 a month
84th of 367, with limits
$759 a month
3rd cheapest of 367
$634 a month
Always-on AI employees
50 machines 24/7 · 2 vCPU / 4 GB
Railway can keep an assistant running by setting the idle timeout to 0, while a Modal VM Sandbox stops at 24 hours and does not fit an agent that lives on its machine.
16th cheapest of 366
$3,977 a month
Can't run it5th cheapest of 366
$657 a month
Code interpreter bursts
100 at once · 1 vCPU / 2 GB · 200,000 sessions of 1 min a month
Railway fits short code runs well because a sandbox bills for CPU used and is gone when the job ends; boat limits starts per minute by plan.
36th cheapest of 345
$413 a month
Can't run it186th 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
Modal Team runs 5,000 containers at once, while Railway caps sandboxes at 100 per environment on Pro; boat keeps each user's disk between visits.
42nd of 361, with limits
$290 a month
Can't run itCheapest of 361
$209 a month
RL rollouts
1,000 at once · 2 vCPU / 4 GB · 1,000,000 sessions of 3 min a month
Huge bursts of short rollouts are what Modal is built for, but its VMs cost more here than Railway's metered CPU, and boat queues very large bursts.
78th of 360, with limits
$4,450 a month
171st of 360, with limits
$16,322 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
108th of 364, with limits
$364 a month
Can't run it10th cheapest of 364
$200 a month
CI runners
40 at once · 8 vCPU / 16 GB · 6,000 sessions of 12 min a month
Modal VMs run Docker builds, and Railway's sandbox docs do not mention Docker; boat documents Docker and /dev/kvm on every plan.
113th cheapest of 377
$1,210 a month
188th of 377, with limits
$1,064 a month
4th cheapest of 377
$86 a month
24/7 dev boxes
1 machine 24/7 · 4 vCPU / 8 GB
66th cheapest of 368
$89 a month
Can't run it18th 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 Railway nor Modal ships a desktop, so you install Xvfb, VNC and a browser yourself; boat has a 60fps desktop and a computer-use API built in.
77th of 369, with limits
$103 a month
Can't run it6th cheapest of 369
$200 a month
Browser-use agents
50 at once · 2 vCPU / 4 GB · 30,000 sessions of 10 min a month
53rd of 367, with limits
$93 a month
Can't run it7th 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
60th cheapest of 346
$570 a month
Can't run it6th 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
109th of 338, with limits
$2,988 a month
Can't run it71st 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
Many parallel agents need machines that keep state and run Docker, which boat gives by default and Railway and Modal only partly cover.
43rd of 360, with limits
$574 a month
294th of 360, with limits
$642 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

FeatureRailwayModal VM Sandboxesboat
IsolationSandboxes are isolated Linux VMs; app services are containersVM with its own Linux kernel on Cloud HypervisorFull VM with its own kernel on dedicated AMD Ryzen 9 9950X hosts
How long a sandbox livesNo maximum, but destroyed after the idle timeout (30 minutes by default, 0 for never)Default 5 minutes, maximum 24 hoursNo session cap on paid plans; you set the time to live
Stop and resumeNo paused sandbox; files survive only in checkpoints you takeNo paused state; only Volumes and snapshots keep filesStop for free and resume with the whole disk; saved every minute and on stop
Docker and systemdRoot shell on Ubuntu; the sandbox docs do not mention DockerYes; start dockerd yourself as the entrypointDocker, root and systemd in every sandbox
Nested virtualizationNot mentioned in the sandbox docsTeam and Enterprise plans only, on request/dev/kvm on every plan
CPU benchmark (4 vCPU / 8 GB)Not measured15.54 runs/s26.69 runs/s
Coding agentsClaude Code, Codex, OpenCode and Pi preinstalled; you run them through execExamples only; you install the agent yourselfClaude Code, Codex and others preinstalled, with a prompt, steer and events API
Keeping keys out of the sandboxSecrets are environment variables inside the sandboxEnvironment variables, or your own proxy in a sidecarAI credentials proxy for model providers and any HTTPS API; real keys never enter the sandbox
Desktop and computer useHeadless: terminal, exec and SSH onlyNot offered; an example shows Xvfb and VNC set up by hand60fps desktop, Chromium and computer-use API built in
Reaching the sandboxUp to 10 public HTTPS domains, set only at creation; SSHEncrypted and raw TCP tunnels, connect tokens, inbound IP allowlistHTTPS URLs for up to 50 ports, token-protected, plus raw TCP
Sandboxes at once50 per environment on Hobby, 100 on Pro100 containers on Starter, 5,000 on Team100 to 2,000 by plan
Outbound network rulesNo egress allowlistBlock all, IP-range allowlist, domain allowlist (beta)Open internet, no provider-side allowlist
Next to your other workloadsPostgres, Redis and app services in the same project and private networkInference, training and GPU functions on the same account (GPUs need gVisor sandboxes)Sandboxes only; host your own services inside a VM
RegionsUS West, US East, Amsterdam and SingaporeUS, EU and Asia-Pacific; pinning a region costs 1.15x to 1.75xEU only: Germany, Finland, France
Every feature Battleships tracks (43)
FeatureRailwayModal VM Sandboxesboat
Full VM (own kernel)YesYesYes
Docker insideNot publishedYesYes
Nested virtualizationNoYesYes
RootYesYesYes
SystemdNot publishedYesYes
Desktop GUINoNoYes
BrowserYesNoYes
Computer-use APINoNoYes
SSHYesYesYes
Persistent diskYesYesYes
Pause/resumeYesNoYes
Automatic snapshotsNoNoYes
Fork/cloneYesYesYes
Live fork (no pause)YesYesYes
Memory forkNoYesNo
Custom image (Docker or snapshot)YesYesYes
≥24 h sessionsYesYesYes
Idle auto-stopYesYesNo
Wake on requestNoNoNo
HTTPS preview URLsYesYesYes
Raw TCP inboundNoYesYes
Public IPv4NoNoNo
Egress allowlistNoYesNo
Secret proxyNoNoYes
Secret proxy for any APINoNoYes
Preinstalled agentsYesNoYes
Agent harness APIYesNoYes
MCP serverYesNoNo
GPUNoNoNo
WindowsNoNoNo
Arm64NoNoNo
Self-hostingNoNoNo
BYOCYesNoNo
Open sourceNoNoNo
Scoped API keysNot publishedNot publishedYes
Spend limitsYesNot publishedYes
Usage per sandbox (API)NoNot publishedYes
Audit logsYesYesNo
SSOYesYesNo
SOC 2YesYesNo
HIPAAYesYesNo
EU data residencyYesYesYes
Zero data retentionNot publishedNot publishedYes

Performance

RailwayNot measured
Modal VM Sandboxes15.54 runs/s
boat26.69 runs/s

In StarSling's public Node.js build-and-test benchmark at 4 vCPU / 8 GB, boat did 26.69 runs per second and Modal's VM runtime did 15.54, so boat did about 1.7 times the CPU work in the same time. Railway has no result in that benchmark yet, so we cannot say how it compares to either.

Node.js build-and-test loop at 4 vCPU / 8 GB, higher is better. Measured with the open hpc-sandbox-benchmarks suite. Modal VM Sandboxes measured on: VM Sandbox, request = size. Railway has 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.

ScenarioRailway, a monthModal VM Sandboxes, 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
$16 · Hobby · with limits$15 · Starter · with limits$20 · $20/mo
One agent that never stops
4 vCPU / 8 GB, 50 GB disk, running 24/7 all month
$70 · Hobby · with limits$178 · Starter · 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
$739 · Hobby · with limits$2,229 · Starter · 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
$223 · Pro · with limits$792 · Team$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
$781 · Pro · with limits$3,193 · Team · with limits$2,000 · $2000/mo · with limits

Railway: Railway bills sandboxes per second at $50 per vCPU-month on CPU actually used and $50 per GB-month on memory in use, and memory keeps billing while a sandbox waits until it is destroyed. The Hobby ($5) and Pro ($20) fees count toward usage, and Railway publishes no sandbox disk price, so our numbers leave disk out.

Modal VM Sandboxes: Modal bills by the second for whichever is higher, the CPU and memory you request or what you use, until the sandbox ends. Starter is free with $30 of monthly credit, Team is $250 a month with $100 of credit, and pinning a region multiplies the price by 1.15x to 1.75x.

Modal VM Sandboxes: boat plans start at $20 a month and the whole fee becomes usage credit, spent per second while a sandbox runs. A stopped sandbox costs nothing and keeps its disk.

Limits in those scenarios

Railway is marked as a different kind of product in every scenario because it is an app platform first and does not price sandbox disk, and its cap of 100 sandboxes per environment on Pro blocks 300 user sandboxes or 1,000 jobs at once. A Modal VM Sandbox lives at most 24 hours and keeps files only in Volumes, so the workday, always-on and fleet scenarios do not fit there, while it does fit sandboxes for your users on Team. On boat, the 1,000-job burst is queued above 90 starts a minute and needs more starts a day than the $2,000 plan allows.

ScenarioRailwayModal VM Sandboxesboat
One coding agent, workdays
  • different kind of product: app platform
  • disk beyond 0 GiB: price unknown
  • files survive a stop only in Volumes: packages installed elsewhere reset
None that bite
One agent that never stops
  • different kind of product: app platform
  • disk beyond 0 GiB: price unknown
  • Starter: sessions capped at 24 h
  • files survive a stop only in Volumes: packages installed elsewhere reset
None that bite
50 agents in parallel
  • not confirmed: Docker inside
  • different kind of product: app platform
  • disk beyond 0 GiB: price unknown
  • files survive a stop only in Volumes: packages installed elsewhere reset
None that bite
Sandboxes for your users
  • Pro: max 100 concurrent
  • different kind of product: app platform
  • disk beyond 0 GiB: price unknown
None that biteNone that bite
1,000 short jobs at once
  • Pro: max 100 concurrent
  • different kind of product: app platform
  • disk beyond 0 GiB: price unknown
  • shared vCPUs on this tier (Modal (VM Sandboxes) sells dedicated cores separately as “VM Sandbox, request = size”): heavy, sustained CPU use can be slowed by other tenants
  • 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 Railway when

your app and databases already live on Railway and you want sandboxes on the same private network, billed for the CPU they use.

  • Sandboxes next to your apps. Useful if your app already runs on Railway: a sandbox can join the same private network as your Postgres and services.
  • No hard session limit. Useful for agents that run past a day: set the idle timeout to 0 and a Railway sandbox runs until you destroy it.
  • Billing on CPU actually used. Useful for many quick code runs: Railway meters the CPU a sandbox uses and destroys it when the job ends.

Use Modal VM Sandboxes when

you need Docker in a real kernel for huge bursts of short jobs that finish within a day, strict outbound rules, or your models already run on Modal.

  • Docker in a real kernel. Useful for builds and tests: each Modal VM has its own Linux kernel, so Docker, FUSE and systemd work.
  • Huge bursts and strict egress. Useful for big parallel runs: Team runs 5,000 containers at once, and you can allow only chosen domains out.
  • One platform with your models. Useful if you already serve or train models on Modal: sandboxes and GPUs sit on one account and one bill.

Where boat fits

If what you are running is coding agents that work for hours or come back the next day, both Railway and Modal make you save and rebuild the machine yourself. boat gives each agent a full VM that stops for free, keeps its disk, runs Docker and has a desktop, so the agent picks up where it left off.

A machine that keeps its work

A Railway sandbox is destroyed after 30 idle minutes and a Modal VM ends within 24 hours. On both, the agent's installs vanish unless you take checkpoints or use Volumes. A boat sandbox stops, keeps its disk and costs nothing while stopped.

Desktop, Docker and KVM ready

Railway's sandbox docs do not mention Docker, and neither Railway nor Modal ships a desktop. Modal gives /dev/kvm only on Team or Enterprise on request. boat has Docker, /dev/kvm and a 60fps desktop with Chromium on every plan.

Agents you drive, keys kept outside

On Railway you run agents through exec and parse the output, and on Modal you install them yourself. Both put API keys in environment variables. boat adds a prompt, steer and events API and a credentials proxy that keeps real keys outside.

Use boat when your agents work for hours or days in a machine they come back to: a faster full VM that keeps its disk, with Docker, /dev/kvm, a desktop and coding agents you drive from outside. Compare it one to one: boat vs Railway and boat vs Modal VM Sandboxes.

Questions people ask

Is Railway cheaper than Modal VM Sandboxes?

In most of our scenarios, yes: one always-on agent costs $70 a month on Railway against $178 on Modal, and 50 parallel agents cost $739 against $2,229. Railway's numbers leave out disk, which it does not price, and boat comes to $26 and $317 for the same two jobs.

Which is faster, Railway or Modal VM Sandboxes?

We cannot say, because Railway has no result in the StarSling CPU benchmark yet. Modal's VM runtime did 15.54 runs per second at 4 vCPU / 8 GB, and boat did 26.69 in the same run.

Can Railway sandboxes run Docker?

Railway's sandbox docs give you a root shell on Ubuntu but do not mention Docker or /dev/kvm. Modal VM Sandboxes run Docker if you start dockerd yourself, and boat has Docker and /dev/kvm in every sandbox.

How long can a sandbox run on Railway and on Modal?

Railway has no maximum, but destroys a sandbox once its idle timeout runs out, 30 minutes by default or never if set to 0. A Modal VM Sandbox defaults to 5 minutes and stops at 24 hours. boat has no session cap on paid plans.

Do Railway and Modal come with coding agents?

Railway's default image includes Claude Code, Codex, OpenCode and Pi, run headless through exec. Modal offers examples, so you install the agent yourself. boat preinstalls coding agents and lets you prompt, steer and watch them through an API.

Where do Railway and Modal run?

Railway has regions in California, Virginia, Amsterdam and Singapore. Modal runs in the US, EU and Asia-Pacific, and pinning a region costs 1.15x to 1.75x. boat runs only in the EU, in Germany, Finland and France.

Try boat

Install the CLI, then run boat new.

7-day free trial

More comparisons