Railway Pricing Explained: Plans, Rates and Real-World Costs
Eli Mernit11 min read
Railway pricing has two parts: a monthly plan fee ($0 on Free, $5 on Hobby, $20 on Pro) and per-second usage for CPU, memory, volumes and egress. The plan fee counts toward your usage, so each month you pay whichever is larger. On Railway, the app hosting platform, services bill at $20 per vCPU and $10 per GB of memory a month, and sandboxes bill at $50 for each.
This guide covers each charge, what common workloads cost, and how Railway compares with Fly.io and a pay-per-second VM for an AI agent.
How Railway pricing works
Railway bills a subscription plus the resources your workloads consume, and the subscription is a minimum, not a surcharge. The Hobby plan's $5 and the Pro plan's $20 each cover the same amount of usage. If your usage stays under that amount you pay the plan fee. If it goes over, you pay your usage.
The Hobby plan works like this:
| Resource usage in the month | Hobby subscription | Total bill |
|---|---|---|
| $3 | $5 | $5 |
| $5 | $5 | $5 |
| $8 | $5 | $8 |
| $15 | $5 | $15 |
Pro follows the same logic with $20. Included usage resets every billing cycle and does not roll over, so a quiet month doesn't buy a bigger allowance for the next one. The subscription is charged in advance and any usage above it is charged in arrears, which is why one invoice can show two periods.
Usage is what a service measurably consumes, not the size you could scale to. A service allowed 8 vCPUs that averages a tenth of one core is billed for a tenth of one core. Builds are free: Railway doesn't charge for build CPU, build memory or image storage.
Railway plans compared: Free, Trial, Hobby and Pro
Hobby is $5 a month for personal projects and Pro is $20 a month per workspace for teams. Pro's fee is not per seat, so adding members doesn't raise it. The plans differ mostly in limits, not in rates: every plan pays the same price per vCPU and per GB.
| Free | Hobby | Pro | |
|---|---|---|---|
| Monthly fee | $0 | $5 | $20 per workspace |
| Included usage | $1 a month | $5 a month | $20 a month |
| Max per service | 1 vCPU, 0.5 GB | 48 vCPU, 48 GB | 1,000 vCPU, 1 TB |
| Replicas per service | 1 | 6 | 42 |
| Max volume size | 0.5 GB | 5 GB | 1 TB |
| Projects | 1 | 50 | 100 |
| Custom domains | 0 | 2 | 20 |
| Log history | 3 days | 7 days | 30 days |
The per-service maximums include replica multiplication: they cap the service across all of its replicas, not each replica.
Enterprise is custom. Between Pro and Enterprise sit committed spend tiers: a workspace that commits to $1,000 a month gets 90-day logs and HIPAA BAAs, $2,000 adds single sign-on and role-based access, and $10,000 adds dedicated instances. If usage comes in under the commitment, Railway bills the difference.
Is Railway free?
Railway has a free trial and a small Free plan, and neither is enough to host a real app for long. New accounts get a one-time $5 credit that expires after 30 days, with services capped at 2 vCPUs and 1 GB. After the trial, the Free plan gives $1 of usage a month with one service replica at up to 1 vCPU and 0.5 GB. At Railway's memory rate, $1 covers about 100 MB held for a month and nothing else.
Hobby isn't free either. You pay the $5 whether or not you use it, although Railway waives the fee for a small set of active builders it picks automatically.
Railway usage rates for CPU, memory, storage and egress
Railway charges four usage rates on top of the plan fee, metered per second. The monthly figures are what a resource costs if you hold it for a full 30-day month.
| Resource | Per second | Per hour | Per month |
|---|---|---|---|
| CPU | $0.00000772 per vCPU | $0.0278 per vCPU | $20 per vCPU |
| Memory | $0.00000386 per GB | $0.0139 per GB | $10 per GB |
| Volume storage | $0.00000006 per GB | $0.0002 per GB | $0.15 per GB |
| Network egress | n/a | n/a | $0.05 per GB sent |
| Object storage | n/a | n/a | $0.015 per GB stored, free egress |
Three things about these rates shape the bill.
Memory is usually the bigger line. A web service or an agent worker holds its memory all day and uses CPU in short bursts. Railway's own example of an always-on agent worker is 300 MB of memory ($3.00) and an average of 0.05 vCPU ($1.00).
Idle services still bill. A running service uses memory and some CPU whether or not it's handling requests, and Railway charges for both. No traffic doesn't mean no bill.
Egress is easy to overlook. Traffic to your database over its public URL counts as egress at $0.05 per GB. Traffic over Railway's private network doesn't.
Railway Sandboxes pricing
Railway Sandboxes bill at separate VM rates: $50 per vCPU and $50 per GB of memory a month, metered per second, plus $0.05 per GB of egress. That is 2.5 times the service rate for CPU and 5 times the service rate for memory. Railway's cloud agents run on the same VM primitive and bill at the same rates.
| Resource | Per second | Per hour | Per month while running |
|---|---|---|---|
| CPU, active use | $0.00001929 per vCPU | $0.0694 per vCPU | $50 per vCPU |
| Memory held | $0.00001929 per GB | $0.0694 per GB | $50 per GB |
A sandbox pays for the CPU it uses, not for the vCPUs it was created with, so a sandbox waiting on a model call uses almost no billable CPU. Memory is different. Per Railway's docs, it stays billable while the VM waits for work, and the measured figure includes the operating system and the filesystem cache. A sandbox holding 2 GB costs about $0.14 an hour before it does any work. Railway's pricing page words this differently: it says time spent waiting on a model or a user "costs almost nothing". That holds for CPU. The memory figures in this guide follow the docs.
Sandbox usage draws from the same included credit as the rest of the plan. The plans set the limits:
| Free and Trial | Hobby | Pro | |
|---|---|---|---|
| Running sandboxes per environment | 10 | 50 | 100 |
| Default size | 2 vCPU, 2 GB | 4 vCPU, 4 GB | 8 vCPU, 8 GB |
| Maximum size | 2 vCPU, 2 GB | 8 vCPU, 8 GB | 24 vCPU, 24 GB |
| Default idle timeout | 5 minutes | 30 minutes | 30 minutes |
| Idle timeout range | 1 to 5 minutes | 1 to 120 minutes, or never | 1 to 120 minutes, or never |
Each environment can also hold as many checkpoints as running sandboxes (10, 50 and 100), counted separately. Checkpoints, forks and templates are available on every plan.
Two lifecycle details affect cost. When the idle timeout expires, Railway destroys the sandbox; it doesn't pause it. And a checkpoint saves a sandbox's disk, not its running processes, so a sandbox restored from a checkpoint boots fresh. A fork copies a running sandbox's disk the same way. An agent that needs to keep its working memory between tasks has to keep the sandbox running, with the timeout disabled, and pay the memory rate for every hour.
Cloud agents behave differently from sandboxes. A cloud agent sleeps on its own after five idle minutes: its files stay on disk, its processes stop, and compute billing stops until it wakes.
If you're new to the category, our explainer on what an AI sandbox is covers why agents run in one.
What common workloads cost on Railway
A light always-on process costs a few dollars of usage on Railway, a small API with a database comes to about $29 in the example below, and anything that keeps a full core busy costs more than a fixed-size VM elsewhere. Each row below shows its inputs, priced for a 30-day month.
| Workload | Inputs | Usage | Bill on Hobby | Bill on Pro |
|---|---|---|---|---|
| Always-on agent worker | 0.3 GB memory, 0.05 vCPU average | $4.00 | $5.00 | $20.00 |
| API with Postgres | API: 1 GB, 0.25 vCPU average. Postgres: 1 GB, 0.1 vCPU average, 5 GB volume. 20 GB egress | $28.75 | $28.75 | $28.75 |
| Busy service | 2 vCPU fully used, 4 GB memory | $80.00 | $80.00 | $80.00 |
| One-hour sandbox session | 1 vCPU busy, 2 GB held, VM rates | $0.21 | Within included usage | Within included usage |
| Sandbox kept all month | Idle timeout disabled, 2 GB held (billable while waiting, per Railway's docs), CPU near zero, VM rates | $100.00 | $100.00 | $100.00 |
The arithmetic for the API row: the API is $10.00 of memory plus $5.00 of CPU, Postgres is $10.00 plus $2.00, the volume is 5 × $0.15 = $0.75, and egress is 20 × $0.05 = $1.00. The first row is Railway's own example from its agent cost guide. The others are sized for illustration, so measure your own: Railway's advice is to run the app for a week and read the estimate on the usage page.
Replicas multiply the bill. Ten copies of the $4 worker are $40.
How to keep a Railway bill down
Railway gives you four controls, and the first one has conditions that are easy to miss.
- Serverless sleep. With Serverless enabled, a service sleeps after about 5 to 10 minutes without outbound traffic and wakes on the next request. Any outbound packet resets the clock, including an open database connection, framework telemetry and queue polling. So it suits request-driven services and does little for a worker that polls. The first request to a sleeping service waits for a cold boot and can return a 502.
- Usage limits. A workspace can set an email alert and a hard limit on compute usage. Hitting the hard limit takes every workload offline until you raise it, and the smallest hard limit is $10.
- Private networking. Use the private database URL between services so that traffic isn't billed as egress.
- Replica limits. Capping CPU and memory per replica caps the bill, and a service that needs more than its cap will crash.
For sandboxes, the controls are the idle timeout and checkpoints: destroy sandboxes when the work is done, and restore from a checkpoint instead of keeping a prepared sandbox running.
Railway vs Fly.io vs a pay-per-second VM for an AI agent
For a small agent that mostly waits, Railway's bill stays small because it charges for what the process uses, not for the machine's size. For an agent that needs a whole machine (a shell, a disk, Docker, a browser), Railway's VM rates add up quickly, and the table shows what a fixed-size VM costs for the same month.
The table prices one small agent box for a 30-day month, 720 hours.
| Option | Inputs | Monthly cost |
|---|---|---|
| Railway service, light use | 0.3 GB and 0.05 vCPU average, Hobby minimum applies | $5.00 |
| Railway service, full use | 1 vCPU and 2 GB used all month: $20 + 2 × $10 | $40.00 |
| Railway sandbox, kept running | 2 GB held (billable while waiting, per Railway's docs), CPU near zero: 2 × $50 | $100.00 |
| Fly Machine | shared-cpu-1x preset with 2GB: $6.70 + $6.00 for the extra GB | $12.70 |
| Beam VM, Shared tier | 1 vCPU, 2 GiB: $0.022 an hour × 720 | $15.84 |
| Beam VM, Performance tier | 1 vCPU, 2 GiB: $0.07 an hour × 720 | $50.40 |
| Beam VM, Shared tier, paused outside working hours | 1 vCPU, 2 GiB, 240 hours | $5.28 |
The Beam inputs: the Shared tier is $0.011 per vCPU-hour plus $0.0055 per GiB-hour for VMs up to 8 vCPUs and 16 GiB, and the Performance tier, the default for new accounts, is $0.05 plus $0.01. VMs bill per second for their provisioned size while they run. Storage isn't billed yet; the planned rate is $0.0001 per GB-hour. Beam charges no egress fees, against $0.05 per GB on Railway and $0.02 per GB from Fly's North American and European regions. Fly's figure is for its lowest-priced regions, and a volume for the agent's files adds $0.15 per GB a month.
The rows measure different things, and that is the point of the comparison. Railway's light-use row is a process: your code in a container, with an ephemeral filesystem unless you attach a volume. The VM rows are whole machines that you SSH into. If your agent is a Python worker that calls a model API and writes to Postgres, the Railway service is the right shape, and its bill follows the process's small footprint. If it runs a coding agent that installs packages, starts containers and keeps a workspace between tasks, it needs the machine. Our guide to AI agent hosting covers how to choose between the two shapes.
On Beam VMs, a pause keeps memory and running processes along with the disk, and a paused VM has no compute charge:
# A 2 vCPU / 4 GiB VM on the Shared CPU tier
beam vm new agentbox --cpu-tier shared --cpu 2 --memory 4096
# Pause after 5 idle minutes, keep RAM, wake on the next connection
beam vm update agentbox --ttl 300 --idle-action pause --auto-resumeThe --cpu-tier flag needs beam-client 0.2.236 or later. The idle timer counts connections such as SSH sessions and SDK calls, not processes running inside the VM, so an agent that works unattended should turn the timer off or hold a keep-alive lease while it runs. Beam VMs are CPU-only. Our guide to what a microVM is explains the isolation underneath.
For short-lived sandboxes, the difference is the billing basis. Railway bills a sandbox's measured CPU and memory at $0.0694 per unit-hour. Beam bills a sandbox's provisioned size by the millisecond: a 2 vCPU, 4 GiB sandbox is $0.044 an hour on the Shared tier and $0.14 on Performance, busy or not. A Railway sandbox that holds 2 GB and averages 0.2 vCPU costs about $0.15 an hour, so against the Shared tier the two meet only when a sandbox holds well under 1 GB. The same comparison for other vendors is in our breakdowns of E2B pricing, Daytona pricing and Modal pricing.
When Railway is the right choice
Railway is a good fit when the workload is an app, and a weaker one when the workload is a machine.
Choose Railway when:
- You're deploying a web app with its database. Services, Postgres, Redis, private networking and deploys from GitHub are in one project, and you pay for measured use.
- Your processes are small and mostly idle. Measured-use billing at $10 per GB makes a 300 MB worker cost a few dollars.
- You want one bill with a spending cap. Usage limits can stop every workload at a figure you set.
Look elsewhere when:
- The agent has to keep its memory between tasks. Railway's VM rates make an always-on sandbox expensive. An idle sandbox is destroyed and a sleeping cloud agent stops its processes, so neither keeps RAM.
- The service keeps cores busy all month. At $20 per vCPU and $10 per GB, a fully used 2 vCPU, 4 GB service is $80, against $25.39 for a Fly shared-cpu-2x with 4GB or $31.68 for a Beam VM of that size on the Shared tier.
- You need a GPU. Railway's pricing page lists no GPU rates.
If you're weighing Railway against other app platforms, our comparisons of Heroku alternatives and Northflank alternatives cover that ground.
FAQ
How much does Railway cost per month?
At least the plan fee: $5 on Hobby or $20 on Pro. Usage is added only when it exceeds that amount, at $20 per vCPU, $10 per GB of memory and $0.15 per GB of volume storage a month, plus $0.05 per GB of egress. The worked example in this guide, a small API with a Postgres database, comes to $28.75.
Is Railway free?
Only for trying it out. New accounts get a one-time $5 credit for 30 days, and the Free plan after that includes $1 of usage a month with a 0.5 GB memory cap. A project that should stay online needs the Hobby plan at $5 a month.
What is the difference between Railway Hobby and Pro?
The fee, the included usage and the limits. Hobby is $5 with $5 of usage, 48 vCPUs and 48 GB per service, and volumes up to 5 GB. Pro is $20 per workspace with $20 of usage, unlimited seats, up to 1,000 vCPUs and 1 TB per service, 1 TB volumes and 30 days of logs. Usage rates are the same on both.
Does Railway charge when my app has no traffic?
Yes. A running service holds memory and uses some CPU without any requests, and Railway bills both. Enabling Serverless lets an idle service sleep, but only if it sends no outbound traffic for several minutes.
Is Railway cheaper than Fly.io?
It depends on how much of the machine you use, because Railway bills measured use and Fly bills the Machine's preset size. A small process that mostly idles fits inside Railway's $5 Hobby plan. A service that uses 1 vCPU and 2 GB all month is $40 on Railway and $12.70 on a Fly shared-cpu-1x.
How much do Railway Sandboxes cost?
Sandboxes bill at $50 per vCPU and $50 per GB of memory a month, metered per second, which is about $0.0694 per unit-hour. CPU is charged for active use and memory for what the VM holds, including while it waits. A sandbox holding 2 GB costs about $0.14 an hour before any CPU work.
Does Railway offer GPUs?
Railway's pricing page lists rates for CPU, memory, volumes, egress and object storage, and none for GPUs. GPU workloads need a different provider.
Price your own workload
A Beam VM gives an agent a persistent disk, SSH, Docker and a pause that keeps memory, billed per second while it runs. Create a Beam account and run the two commands above to compare a paused VM's bill with your Railway invoice. Current rates are on the Beam pricing page.
