Sandboxes | Railway
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.
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.
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.
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
Run code live, detach, and reattach from another process. Sandboxes are great when you want to outlive the process that started them. - Files API
Every box gets a file-browser, read, write, list, and stream files of any size. - Checkpoints and forks
Named disk snapshots stored in the environment. Fork a running sandbox in one call. - Templates
Bootstrap the base image for reusability. Railway then builds, hashes, and caches the image for quicker start-up. - Private networking
Opt a sandbox into the environment's private network to reach your Railway 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 are all SSH native with keys tied to your account. - Four regions
Use our 8 sites in US West, US East, EU West, and Southeast Asia. - Idle timeout
Forgotten sandboxes destroy themselves, or have them not de-provision. Your call.
Priced for how agents actually work
A sandbox bills per second for the CPU it actually uses and the memory it holds.
- Memory
$0.001157 per GB-minute - CPU
$0.001157 per vCPU-minute - Egress
$0.05 per GB
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. They are isolated VMs outside of the Railway service lifecycle that you manage.
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.
Create your first sandbox today!