A full computer on demand

Railway Sandboxes are full Linux VMs you create in code. Wire one into your project's private network, checkpoint it, fork it, and throw it away. Just pay for what it uses, not how long it exists.

Available on every plan. CLI, TypeScript SDK, dashboard, and API.

import { Sandbox } from "railway";

const sandbox = await Sandbox.create({
  networkIsolation: "PRIVATE", // reach postgres.railway.internal
});

await sandbox.exec("git clone https://github.com/you/app /app");
await sandbox.exec("npm ci", { cwd: "/app" });
await sandbox.checkpoint("app-ready");

const fork = await sandbox.fork();
const { exitCode, stdout } = await fork.exec("npm test", { cwd: "/app" });

await Promise.all([sandbox.destroy(), fork.destroy()]);

Useful right when you provision

Claude Code, Codex, and other coding agents come preinstalled, along with Node.js and Git. Start running commands as soon as your sandbox is ready, with your databases and services on the same private network when you need them. Read the guide →

From provision to first command

Railway's base image includes Claude Code, Codex, and other coding agents, along with Node.js and Git. The other-provider path shows the setup steps needed when these tools aren't included in the image.

Reach your sandbox by web, Android, iOS, or SSH

Watch your sandboxes list from code, or step in yourself with Railway's unrivaled developer experience. Dashboard docs →

250,000+

provisions

and counting

Everything a sandbox needs, in the SDK and the CLI

The same primitives from TypeScript, from your terminal, or from an agent provisioning from the MCP.
exec with durable sessions
Stream output live, detach, and reattach from another process. Commands outlive the client that started them.
Files API
Read, write, list, and stream files of any size. Retries handle dropped connections.
Checkpoints and forks
Named disk snapshots stored in the environment. Fork a running sandbox in one call.
Templates
Declare packages and build steps once. Railway builds, hashes, and caches the image.
Private networking
Opt a sandbox into the environment's private network to reach your services by hostname.
Public domains
Up to 10 Railway-provided HTTPS domains per sandbox, one per port.
SSH and port forwarding
railway sandbox ssh and railway sandbox forward 3000. Keys live on your account.
Four regions
US West, US East, EU West, and Southeast Asia. Choose a region when creating a sandbox.
Idle timeout
Forgotten sandboxes destroy themselves. Hobby and Pro can also disable the timer.
Pricing

Priced for how agents actually work

A sandbox bills per second for the CPU it actually uses and the memory it holds. See all pricing →

Memory

$0.001157 per GB-minute

CPU

$0.001157 per vCPU-minute

Egress

$0.05 per GB

One run of

Code review on every PR

8 min · 1 GB · 25% of a vCPU busy

$0.01

Memory · 1 GB × 8 min$0.0093
CPU · 25% of a vCPU × 8 min$0.0023
1,000 PRs a month$11.57

Sandbox usage draws from the same included credit and usage limits as your services. Destroyed sandboxes cost nothing. Per-plan limits are on the pricing page.

FAQ

Common questions

What is a Railway sandbox?

An isolated Linux VM you create through the TypeScript SDK, CLI, or dashboard. Git, Node.js, and coding agents are already installed, so you can start running commands and working with files right away.

How is a sandbox different from a service?

A service runs your deployed app, API, or worker. A sandbox gives your application a VM for a task, like running an agent or testing a change. Your code decides when to create it, what to save, and when to destroy it.

How much does a sandbox cost?

CPU and memory usage are billed per second, at $50/vCPU-month and $50/GB-month. Outbound traffic costs $0.05/GB. For example, a 20-minute task averaging 1 GB of memory and 30% of a vCPU costs about $0.03, plus outbound traffic.

Do I pay for an idle sandbox?

Yes. It still uses memory, and background work can use CPU and bandwidth. Sandboxes have an idle timeout by default, though running commands or active sessions can keep them alive. Destroy yours when you're done to stop compute charges.

Can a sandbox reach my database?

Yes. Set networking to PRIVATE and pass in your database credentials. Your sandbox can then connect to databases and services in the same environment. The default setting, ISOLATED, only allows outbound internet access.

What are checkpoints, forks, and templates?

A checkpoint saves a sandbox's disk so you can start from it later, even after deleting the original. A fork creates another sandbox from a running one's files. A template lets you reuse a setup, with builds cached for next time. Each new sandbox boots fresh; processes and memory aren't copied.

Which plans include sandboxes?

All of them, including Free and Trial. Your plan determines how many sandboxes you can run in each environment, their CPU and memory limits, and idle timeout options. Usage counts toward your plan's included credit.

Can my sandbox have a public URL?

Yes. Choose PRIVATE networking and request a domain when you create it. You can have up to 10 domains, each pointing to a different port. They're removed when you destroy the sandbox.

Your agent's next

computer is now boarding

Create your first sandbox today

Create a sandbox