Guides · Blog

Railway vs VPS in 2026: cost at three sizes, with Postgres

We are paid if you buy through an 'Order' link. 'Visit' links pay us nothing.

Prices in this guide, checked 28 Nov 2026

  1. Webdock VPS Essential1 vCPU, 2 GB, 15 GB NVMe

    $2.36/mo before tax · billed €2.15 (euro rate of 27 Nov 2026)checked 28 Nov 2026

  2. InterServer 1 slice1 vCPU, 2 GB, 40 GB SSD

    $3/mochecked 28 Nov 2026

  3. Hetzner CPX021 vCPU, 1 GB, 20 GB NVMe

    $8.09/mo before tax · $7.49 server + $0.60 IPv4 · Germany; $6.59 in Helsinkichecked 28 Nov 2026

How we pick: the plans this guide names, then the providers it names, then the cheapest we would pick, in that order, each one you can order today; cheapest first within each of the three. Figures in the text below were written 22 Sep 2026. Prices in this table were checked 28 Nov 2026 on each provider's own site. How we check prices

Railway (railway.app) is a modern PaaS that ships git-push deploys, instant managed database provisioning, and a genuinely nice developer experience. This guide compares it honestly to a plain cloud VPS: when Railway is the answer, when the price gap makes a $5 Hetzner CX22 a straight upgrade.

Figures in this text were written 22 Sep 2026.

The one-paragraph verdict

Railway is the best DX in the PaaS category — deploy your app, provision a Postgres and Redis with one click, and iterate. For a small production app, expect to pay $10-30/mo on Railway; a comparable Hetzner CX22 costs $4.60. Railway's cost advantage shows up in the "your first 10 hours of setup are free" sense — you don't need to install Nginx, configure PHP-FPM, or write systemd services. Pick Railway when your time is worth more than the price gap; pick VPS when it isn't.

Cost comparison at three scales

Railway prices per resource unit (~$0.000463/GB-minute + $0.000058/vCPU-minute), which translates roughly to:

Workload Railway (est.) Hetzner VPS
Small hobby project, 512 MB / 0.5 vCPU average $5-10/mo $4.60 (CX22)
Growing SaaS, 1 GB / 1 vCPU + Postgres $15-30/mo $4.60-7.60
Real production, 2 GB / 2 vCPU + Postgres + Redis $30-70/mo $7.60-15.60
Multi-service architecture at scale $80+ $28+ (Hetzner CX52)

Railway's Postgres starts around $5/mo for a small instance, scaling with usage.

What Railway is genuinely great at

Deploy experience. Connect your GitHub repo, Railway detects the framework, deploys automatically. Zero configuration for most stacks (Node, Python, Ruby, Go, Rust, PHP).

Instant managed database. Click a button, get a Postgres URL. Same for Redis, MongoDB, MySQL. No configuration.

Environment management. Separate development, staging, production environments with proper secrets management. Not something you get free on a VPS.

Automatic HTTPS. Every project gets *.up.railway.app domain with SSL included. Custom domain setup is one click.

Preview environments per PR. Every pull request gets its own environment. Real workflow value.

Metrics and logs built in. No need to set up Prometheus, Grafana, or an external log service for a small project.

Templates. One-click deploys for popular open-source stacks (Ghost, Umami, Directus, NocoDB, etc.).

Reasonable free tier. $5/month usage credit on the free plan, enough for hobby projects.

What a plain VPS is great at

Cost at scale. $4.60/mo Hetzner CX22 runs any small SaaS. Fixed cost. No per-service line items.

No usage-based surprises. Traffic spike doesn't blow up your bill.

Full control. Custom Nginx modules, custom cron precision, unusual system libraries.

Multi-service on one box. Your app, Postgres, Redis, background workers all on the same VPS.

No cold starts. Always warm.

Where Railway's pricing bites

Per-service resource units. Each container you run bills separately. A stack with your app + Postgres + Redis + a worker = 4 services, each with its own resource line.

Bandwidth beyond included allowance. Bandwidth pricing kicks in on higher usage; check the current calculator.

Team seats. Priced per developer on the team.

Sustained CPU workloads. Priced per vCPU-minute — a workload that pins CPU 24/7 gets expensive fast compared to a fixed-cost VPS.

When Railway is right

  • Prototyping and side projects where your time is the limiting resource.
  • Small teams that value DX.
  • You want managed database without setting one up.
  • Preview environments per PR are worth real money to your workflow.
  • You're comfortable with the platform's opinions (Docker-based, HTTP-service-focused).

When a VPS is right

  • Cost matters more than DX.
  • Sustained CPU workloads where per-minute pricing hurts.
  • Non-HTTP workloads (game servers, mail servers, MQTT brokers) that don't fit Railway's model.
  • You want to run your database on the same host as your app (cost savings, latency).
  • You've done VPS setup before and it's not a bottleneck.

The specific migration

From Railway to a Hetzner VPS:

1. Provision Hetzner CX32 (4 vCPU / 8 GB) at $7.60/mo.

2. Install Docker + docker-compose.

3. Take your Railway Dockerfile (or write one if you were using Nixpacks defaults) and add to docker-compose.yml.

4. Add Postgres and Redis containers to the same compose file.

5. Add Caddy as a reverse proxy — handles Let's Encrypt automatically.

6. Copy environment variables from Railway to .env on the VPS.

7. pg_dump from Railway Postgres, restore to local Postgres.

8. docker-compose up -d. Done.

Total migration time: 2-4 hours for a typical single-app-plus-DB setup.

Related guides

Figures in this text were written 22 Sep 2026.