Railway vs Fly.io: which is cheaper for a Node API?

Updated 2026-10-23

For one small always-on Node API, Fly.io is cheaper at every traffic level we modelled: its smallest 512 MB Machine is $3.69/month and egress from North America or Europe is $0.02/GB, while Railway's Hobby plan starts at $5/month and egress is $0.05/GB. Railway wins on convenience (Postgres, Redis and the API in one project, a $5 usage credit, and a no-card Free tier), and the gap only matters once traffic grows.

Cost for a small Node API

Assumptions: one service with 512 MB RAM running all month, about 1.5 MB transferred per visit, no database, no volume. Railway CPU is assumed at about 0.1 vCPU average (Railway bills actual CPU use, so yours may differ). Fly.io is a shared-cpu-1x 512 MB Machine in Ashburn (iad), its cheapest region.

Visits / monthTransferRailway (Hobby)Fly.io
10,00015 GB$7.75$3.99
100,000150 GB$14.50$6.69
1,000,0001,500 GB$82.00$33.69

Railway: Hobby $5/month includes $5 of usage; if usage goes over $5 you pay total usage. Memory about $10/GB-month (0.5 GB is about $5), CPU about $20/vCPU-month, egress $0.05/GB. Fly.io: $3.69 per 30 days for the Machine plus $0.02/GB outbound in North America and Europe.

What drives the difference

Base price. Railway's Hobby plan is $5/month, but it includes $5 of usage, so a tiny API often costs exactly $5. Fly.io has no platform fee: the 256 MB Machine is $2.19/month and 512 MB is $3.69/month. Fly.io has no free tier (only a trial of up to 2 hours of Machine runtime or 7 days). Railway has a Free plan with $1/month of usage credit, capped at 1 vCPU / 0.5 GB per service and no custom domains, which is fine for a hobby API but not for a product.

Bandwidth. This is where the bills split. Railway charges $0.05/GB on service egress. Fly.io charges $0.02/GB from North America and Europe, $0.04/GB from Asia Pacific, Oceania and South America, and $0.12/GB from Africa and India. At 1M visits (about 1.5 TB), egress is roughly $75 on Railway versus $30 on Fly.io from iad.

CPU billing. Railway bills memory and CPU per second for what the container actually uses. A busy API that averages more than our assumed 0.1 vCPU will cost more on Railway (each extra 0.1 vCPU average is about $2/month). Fly.io's price is per Machine preset, so CPU use inside that Machine does not change the bill.

Databases. Fly.io Managed Postgres starts at $38/month (Basic), which is the single biggest jump on that platform. On Railway, a Postgres database is another service billed on the same per-second usage rates, so a small database adds memory and volume cost rather than a fixed plan price.

Paying less when the API is idle

Both hosts can stop an idle service. On Fly.io, fly launch writes scale-to-zero settings by default (auto_stop_machines), and a stopped Machine is billed only for its root filesystem at $0.15/GB per 30 days. Fly.io's own example: a 512 MB Machine running 2 hours a day costs about $0.45/month. Cold starts take about 2 seconds or more, or a few hundred milliseconds with suspend.

On Railway, the Serverless setting (formerly App Sleeping) puts a service to sleep after it sends no outbound traffic for about 5 to 10 minutes. Open database connections, telemetry and private-network calls keep it awake, and the first request after sleep may get a 502. Railway's Hobby plan still has a $5 minimum, so sleeping only helps once your usage is above the included $5.

Verdict

Pick Fly.io if cost is the main goal, the API is light on CPU, and you don't need managed Postgres. Pick Railway if you want the API and its database in one dashboard with simple per-second billing, and your traffic is modest (under roughly 100k visits a month the difference is a few dollars). If your API mostly serves cacheable responses, putting it behind a CDN, or using Cloudflare Workers, cuts the egress line on both. See also Railway vs Render vs Fly.io at 100k visits and Vercel vs Cloudflare Pages.

Estimates only, checked 2026-10-23 against the official pricing pages listed below. Prices vary by region; volumes, databases, dedicated IPv4 ($2/month on Fly.io) and build minutes are excluded.

Sources

Get one cost breakdown a week

New host comparisons and price changes. No spam, unsubscribe anytime.