A side project on Railway shows $5/month. The same side project on a Hetzner CX22 shows ~€5.80/month. Both numbers are true for exactly one shape of workload — and wrong for the next shape you will actually run.
Railway's 2026 pricing is a hybrid: a flat monthly subscription that converts 1:1 into usage credits, plus metered overage at $10 per GB of RAM per month and $20 per vCPU per month, billed by the minute. Hetzner's Cloud pricing is a flat box fee — CX22 gives you 2 vCPU, 4 GB RAM, 40 GB SSD, and 20 TB of traffic for one invoice line, every month, no meter.
The question is not "which is cheaper" in the abstract. It is: how many GB-hours of RAM and vCPU can you buy with Railway's credit before the meter makes Hetzner's box the cheaper per-hour-of-compute — and why bursts are the case where the cheap-on-paper answer flips in both directions?
Here is the upfront recompute for the three boring, representative workloads this comparison actually needs. All three assume Railway's meters (RAM, vCPU, 10 GB volume at $0.15/GB, egress at $0.05/GB, billed per minute) against a single Hetzner CX22-class box at €5.83/month post-April-2026 pricing (~$6.40, 20 TB traffic included) that already holds the workload. A CX32-class step-up is noted where the single box would overflow.
| Tier | Shape | Railway Hobby payable | Railway Pro payable | Hetzner CX22 flat (20 TB incl.) | Cheaper |
|---|---|---|---|---|---|
| Idle side project — 1 service, 0.3 GB RAM, 0.2 vCPU, 730h, 15 GB egress, 1 GB volume | $3.00 RAM + $4.00 vCPU + $0.75 egress + $0.15 vol = $7.90 metered → $7.90 ( $5 credit + $2.90 overage) | $20.00 floor (credits cover it) | ~$6.40 | Hetzner by $1.50, Railway Hobby close | |
| Steady small prod — API + worker, 1.5 GB RAM, 1.0 vCPU total, 730h, 80 GB egress, 10 GB volume | $15.00 + $20.00 + $4.00 + $1.50 = $40.50 → $40.50 | $40.50 ($20 credit + $20.50 overage) | ~$6.40 (CX22) | Hetzner by ~$34 | |
| Bursty growth — same footprint but 28% avg utilization ( sleeps/idles 72% of minutes) | $20.00 floor | ~$6.40 still flat | Hetzner still wins flat, but Railway per-minute is 68% cheaper than its own always-on price |
The summary: Railway's credit barely covers a single tiny always-on service. A second service pushes the steady-state bill to roughly 6x a Hetzner box. But burstiness is the third shape where Railway's per-minute meter genuinely bends the curve back — an idle-average trick Hetzner cannot match without autoscaling the box itself.
The rest of this post shows every line's math, pins the crossover point to a single number, and explains why "flat vs metered" is the wrong frame for workloads that burst.
What "$5" and "$20" Actually Buy on Railway
Railway's pricing page looks like a subscription. It bills like a utility meter with a minimum charge.
The model: a flat monthly fee that becomes usage credit. You pay the floor even if you use nothing. You pay metered rates for anything above it, measured per second and invoiced per minute.
- Free (Trial) — $0/month: no persistent workloads. You get a one-time $5 trial credit to build and deploy, then services sleep. This is not a free tier for production.
- Hobby — $5/month: includes $5 of usage credits for the workspace. If metered usage totals $3, you still pay $5. If it totals $7.90, you pay $7.90. The Hobby project and service limits are tighter (6 replicas, 8 vCPU/8 GB RAM per service, 5 GB volume cap in older docs) but the billing logic is the credit floor.
- Pro — $20/seat/month: includes $20 of usage credits per seat, higher caps (up to 32 vCPU/32 GB RAM per service in current docs, 100+ in some SKUs), team seats, private networking, and priority support. Same floor logic, higher minimum.
The meters once credits are exhausted, billed per minute from per-second measurements:
- RAM: $10 / GB / month → $0.000231 / GB / minute. Double the RAM for a minute, double the RAM charge for that minute.
- vCPU: $20 / vCPU / month → $0.000463 / vCPU / minute.
- Volume storage: $0.15 / GB / month ( $0.000021 / GB / minute). Data on a provisioned volume bills even when idle.
- Network egress: $0.05 / GB for internet egress; ingress is free. Private networking between Railway services does not bill egress — the compute for the services still does.
The critical detail is that Hobby's $5 credit is per workspace, not per service. Two services share one $5 pool. Every "Railway is $5" screenshot that shows a single 0.3 GB microservice is technically correct — and hides what happens the day the worker or Postgres you actually need is added.
A second detail: credits are a floor, not a discount. Railway's docs frame it as "your plan fee counts toward usage" and community invoices confirm the math — total due is max(plan_fee, metered_usage), capped so two $0.50 services do not both rebate the same $5.
What the Hetzner Box Is in This Comparison
To keep the comparison honest we price against the cheapest Hetzner box that holds the workload without bin-packing tricks.
- Hetzner CX22 (2026 post-April pricing): 2 vCPU (shared Intel), 4 GB RAM, 40 GB SSD, 20 TB traffic included, listed at €5.83/month in current third-party trackers (€3.79 pre-hike, €4.35 in older EU billing, €5.83 after the April 1, 2026 +30–37% adjustment that repriced existing instances). US/Singapore regions ran slightly higher after that round.
- CX32 (4 vCPU, 8 GB RAM, 80 GB SSD) sits at roughly €11.66/month and is the honest step-up when the 4 GB CX22 overflows.
- Bandwidth: the 20 TB inclusion is the quiet part — 80 GB of egress billed as $4 on Railway is $0 inside the box's allocation. You have to ship an enormous amount of data before Hetzner's traffic meter does anything at all.
- Disk: 40 GB (CX22) to 80 GB (CX32) is included. Railway's $0.15/GB/month only starts to matter if you attach volumes beyond what the box already gives you, but it is not zero.
This is also the number most sensitive to Hetzner's own 2026 drama. Two price rounds in 2026 (April 1 portfolio-wide and June 15 CCX/CPX-focused) moved shared-vCPU boxes +30–38% and dedicated-vCPU lines +113–175%. The CX22 lived on the milder side of that split, but a fleet pinned to CCX/CPX dedicated lines saw bills roughly triple — a reminder that "Hetzner is cheap" in 2026 is now an answer conditioned on which line you provision from, not a single number.
Tier 1: The Idle Side Project That Actually Fits in $5
This is the workload Railway's marketing is built around — one service, small, often idle.
Spec: single Node.js or Python API, 0.3 GB RAM allocation, 0.2 vCPU, always on for the month (730 hours), 15 GB of monthly egress (a few thousand visits plus health checks), 1 GB volume for SQLite or a tiny image cache.
Railway metered cost before the floor:
- RAM: 0.3 GB × $10 = $3.00
- vCPU: 0.2 vCPU × $20 = $4.00
- Volume: 1 GB × $0.15 = $0.15
- Egress: 15 GB × $0.05 = $0.75
- Subtotal metered: $7.90
Hobby billing: max($5, $7.90) → $7.90 payable ($5 credit consumed, $2.90 overage).
Pro billing: max($20, $7.90) → $20.00 payable (credits comfortably cover it, but you pay the higher floor anyway).
Hetzner CX22 flat: ~$6.40 ( €5.83 ), 20 TB included covers the 15 GB without a line item, 40 GB SSD covers the 1 GB volume, CPU and RAM are already on the box whether you allocate 0.2 vCPU or 2.
Verdict for the idle tier: Hetzner still wins by about $1.50 for this exact always-on shape, but the gap is narrow enough that a slightly smaller allocation (0.2 GB RAM, 0.1 vCPU) drops Railway Hobby to ~$4.85 metered → $5 floor, which does undercut the box. This is the one narrow window where Hobby's credit actually matters — a single tiny service, always on, right at the credit line. One more 0.2 GB allocation and it breaks.
This is also why Railway's own community reports flip between "my Hobby bill is $1.65 over the $5 credit" for a couple of microservices at ~$6.65 metered and "my Hobby looks like $40" for a stack with a real worker — both are true, at different allocations.
Tier 2: The Steady Small Production App That Breaks the Credit
This is the boring, representative workload a solo dev actually deploys once the side project gets users: an API plus a background worker.
Spec: API (0.75 GB RAM, 0.5 vCPU, always on) + worker/queue consumer (0.75 GB RAM, 0.5 vCPU, always on), 10 GB persistent volume shared across deploys, 80 GB monthly egress (API responses, a few images, webhooks in and out).
Combined allocation: 1.5 GB RAM, 1.0 vCPU, 730 hours continuously allocated.
Railway metered cost before the floor:
- RAM: 1.5 × $10 = $15.00
- vCPU: 1.0 × $20 = $20.00
- Volume: 10 × $0.15 = $1.50
- Egress: 80 × $0.05 = $4.00
- Subtotal metered: $40.50
Hobby: $40.50 payable ($5 credit + $35.50 overage). Pro: $40.50 payable ($20 credit + $20.50 overage; you paid the higher floor but the meter blew past it anyway).
Hetzner CX22: ~$6.40 flat. The two services are containers on the box; the 4 GB RAM and 2 vCPU cover the 1.5 GB / 1.0 vCPU allocation with headroom. Volume fits inside 40 GB. Egress fits inside 20 TB by a factor of 250×.
The same shape measured per-minute on Render, Fly.io, and Vercel lands differently — Render's per-GB metering and Fly's per-second Machines have their own floors and ceilings — but inside Railway's own meter the number to remember is $35 for just the compute before storage or bandwidth are counted. That $35 is the dominant line; egress and volumes are real but second-order for this tier.
A single-service variant — Postgres or the worker deployed as a Railway Cron — can shave a few dollars by not running 730 hours, but the comparison this tier is making is honest by construction: "always-on API + always-on worker" is what "production" quietly means the week after launch, even if the framework docs called the worker "optional."
Tier 3: The Bursty Growth App — Where Per-Minute Billing Earns Its Keep
This is the shape "flat vs metered" gets wrong.
The workload is the same API + worker, but traffic is not steady. The API is quiet at night, spiky during a launch, and mostly idle between bursts. Railway charges per minute of actually allocated RAM/vCPU; Hetzner's box charges for the capacity whether it is used or not.
Spec: same 1.5 GB / 1.0 vCPU peak reservation, but services scale to a smaller allocation or idle 72% of minutes. Average utilization across the month: 28% of peak allocation (measured in GB-minutes and vCPU-minutes, the unit Railway actually bills). Volume and egress scale roughly with active time, but we keep them at the steady-tier totals to stay conservative — the comparison should be hard to win for Railway.
Railway bursty cost:
- RAM: $15.00 × 0.28 = $4.20
- vCPU: $20.00 × 0.28 = $5.60
- Volume + egress kept at $5.50 (not prorated down)
- Metered subtotal: ~$15.30 → with slight idle-volume still ~$12.84 if egress is prorated to active time
Hobby: ~$12.84–$15.30 payable (credit covers the first $5). Pro: $20.00 floor — bursty savings are real but Pro's $20 minimum eats the first dollars of them back.
Hetzner CX22: still ~$6.40 flat. The box is hot 24/7 even when traffic is not.
What changed: Railway's per-minute meter cut 68% off its own always-on price for this same workload ($40.50 → ~$12.84). Hetzner's bill did not move — it cannot, without an autoscaler deciding to downsize the node or bin-pack the tenant elsewhere, which is infrastructure the app owner does not get for free with the box.
The lesson is not "bursty workloads are cheaper on Hetzner" or vice versa. It is that the flat box is predictably cheap and wastefully cheap at low utilization — you pay the same for 28% as for 100%. The metered platform is variably cheap — you pay less when idle, but every extra GB-minute has a price. The team that thinks of the bill as "flat cheap vs metered expensive" misses that the meter's advantage is entirely in the low-average-utilization shape, while its disadvantage compounds linearly in the high-utilization shape.
The Crossover Point: One Number to Remember
Three tiers give three anecdotes. One threshold gives a decision rule.
For always-on workloads where volume and egress are excluded first (they bill at different rates and on different resources), the compute math is linear:
Railway compute = (GB_RAM × $10) + (vCPU × $20) per month (730-hour basis) Hetzner compute = box cost: ~$6.40 for CX22, ~$12.80 for the CX32-class step-up that holds more
The naive breakeven — where Railway compute alone equals the box — is:
- Against CX22 (~$6.40): ~0.64 GB RAM at 0 vCPU, or ~0.32 vCPU at 0 RAM, or any linear combo on that line. Add the $5.50 of egress+volume from the steady tier and the breakeven drops to roughly 0.09 GB RAM + 0.045 vCPU still inside the $5 credit — meaning almost any always-on second service already sits past the crossover.
More usefully, framed as a single allocated bundle — the common solo shape of 0.5 vCPU + 0.75 GB RAM per service (~$17.50 compute per service per month) — the crossover is:
- One tiny service (0.2–0.3 GB, 0.1–0.2 vCPU): still inside Hobby's $5 credit line or just past it. Railway can win, mostly by being small, not by being cheap per unit.
- Two tiny services (1.5 GB, 1.0 vCPU): $35 compute alone versus a $6.40 box. Hetzner wins by ~$28 on compute before bandwidth is counted.
- Three or more services, or one service at 2 GB+: Hetzner widens the lead roughly in proportion to allocation. A 4 GB / 2 vCPU workload is $80/month compute on Railway against ~$6.40–$12.80 on owned hardware (step up to CX32/CPX once the CX22's 4 GB is full).
Including egress and volume pushes the crossover earlier (Railway's $0.05/GB egress and $0.15/GB volume are not large, but they are not $0 and they are not inside the credit pool beyond the $5).
Bursty math changes the line. At 28–35% average utilization, the effective monthly rate per allocated GB drops from $10 to $2.80–$3.50. A 1.5 GB / 1.0 vCPU reservation whose average use stays at 30% costs ~$10.50 compute on Railway instead of $35 — now competitive with the box again, but only while utilization stays low. Every burst that pushes average utilization toward 60–70% halves the discount. The shape that pays for Railway's meter is "quiet most of the time, bursty rarely" — not "always busy."
A Quick Decision Table
| If your month looks like... | Railway's meter does... | Hetzner's box does... | Bet on... |
|---|---|---|---|
| One microservice, <0.4 GB avg, sleeps sometimes | Stays near the $5 floor; real cost $5–8 | $6.40 even if idle | Railway Hobby (by $1–2, not 10×) |
| API + worker, always on, 1–2 GB · 0.5–1 vCPU | $25–40+ | $6.40–$12.80 | Hetzner decisively |
| Same but 25–35% avg utilization (bursty) | $12–18 on Hobby, $20 floor on Pro | $6.40 | Hetzner still flat-cheaper, but Railway cuts 60–70% off its own worst case |
| Grows to 4+ GB or adds Postgres/Redis as separate allocated services | Adds $10/GB each; bill climbs linearly | Still one box until ~8 GB; second box at step | Hetzner by multiples |
The crossover is not a single traffic number — it is an allocated-RAM-and-vCPU line. Until you know your average GB-minutes, any "Railway vs Hetzner" anecdote is really an anecdote about how much RAM someone happened to allocate that month.
Why "Flat vs Metered" Is the Wrong Frame
The blog-post shorthand — "Hetzner is flat, Railway is metered, so bursty favors metered and steady favors flat" — is half right and the wrong half is expensive.
Three things it misses:
1. Railway's "flat" subscription is not flat and not extra. The $5 or $20 does not sit on top of the meter; it is the first $5 or $20 of the meter. Talking about Railway as "a $5 flat fee plus usage" overcounts by $5 — the real floor is max(plan, metered). The "$5" part only matters as a minimum charge, not as a surcharge.
2. Hetzner's "flat" is flat because you provisioned flat. A self-hosted fleet on owned hardware can be metered too — Cluster API autoscaling, bin-packing, scale-to-zero workers — but none of that is included in the box price. The box is flat because it is always on. If you make the Hetzner fleet elastic, the comparison becomes elastic-vs-elastic, where both sides bend with demand and the operator, not the price sheet, decides how much idle to carry.
3. The meter that matters is not "requests" — it is GB-minutes. Teams optimize for fewer API calls and then allocate 1 GB of RAM to a service that sits idle holding that allocation. Railway bills allocation, not just requests. A service provisioned at 1 GB that handles 10 requests a minute costs the same as one handling 10,000, as long as the heap reservation does not change. The burstiness that saves money on Railway is allocation-minutes, not request count — which is why a properly configured sleep/idle and a smaller per-service cap saves more than a clever API cache.
These are the framing errors a simple "which is cheaper" table encourages. The question to ask instead is: what fraction of your allocated GB-minutes are actually used? Below ~35%, Railway's per-minute math is genuinely useful even though it is not cheaper than the cheapest box flat. Near 100%, every extra vCPU is $20 on Railway and $0 on the box once the box is paid for.
When to Pick Which — Without Pretending the Answer Is Universal
-
Pick Railway Hobby when you have exactly one tiny service, its RAM allocation can stay at 0.25–0.4 GB, and its traffic is small enough that 10–20 GB egress keeps you near the $5 floor. You are renting sub-GB slices by the minute without owning a whole 4 GB node. The honest alternative on Hetzner is not a cheaper number — it is a spare 3 GB of RAM on the node that nothing else is using yet, and the operational cost of owning the node at all.
-
Pick a flat Hetzner box when the project has grown to API + worker + a database (even a small one), when steady-state allocation crosses roughly 0.6–0.8 GB combined, or when you already own the box for something else and the next service is a container, not a new subscription. This is where "the box is already paid for" dominates every per-GB line. A 20 TB traffic inclusion and 40 GB SSD that are already on the invoice quietly turn Railway's $4 egress and $1.50 volume into $0 at the app level.
-
Treat bursts honestly. If the app is genuinely idle most of the month and spikes hard — a launch-week demo, a queue that drains a backlog in bursts, a cron that fans out — Railway's per-minute billing cuts roughly two thirds off its own always-on price. Hetzner's box does not. The number to watch is average GB-minutes, not peak. Pro's $20 floor muddies this: a Hobby workspace that bursts to $13 pays $13; a Pro workspace at the same usage still pays $20.
None of this implies "self-hosting is always cheaper" or that a managed platform cannot be worth paying more. The managed platform bundles deploys-from-git, buildpacks, Postgres without an operator, per-service scaling beyond a single node's size, and a dashboard that mostly just works. A Hetzner box bundles none of that — the Cluster API fleet, the build nodes, the registry cache, and the on-call for a kernel config are yours. The cost delta this post pinned — roughly $34/month for the steady API+worker shape — is the budget against which that operational work has to be weighed honestly, not hand-waved as negligible.
If the answer you wanted before opening was "which platform is cheaper," the honest answer is: Railway Hobby up to one microservice, Hetzner almost everywhere else, and bursts as the asterisk where per-minute billing claws back most — but not all — of that gap.
Bex.co is the open-source, AI-native Render alternative — push a git repo, get a running HTTPS service on machines you own. If Railway's per-GB meter made you stare at allocation sizes and you want the same git-push UX on a flat Hetzner invoice with declarative node provisioning via Cluster API, star the repo and bring your own box.