TL;DR: Vercel is better for a Next.js frontend and Railway is better for databases and workers, so most teams pay for both: about $51 a month for a small app, $157 for a medium one and $467 for a busy one. Moving the frontend to Railway too costs less, and one rented server costs $7 to $19.
- Pick Vercel if your app is mostly frontend, your visitors are spread around the world, and your database bill stays near the minimum.
- Pick Railway if you want one bill without touching a server, your traffic is under about 1 TB a month, or you need WebSockets and workers that stay up.
- Pick both if you need Vercel's global CDN and an always-on database or worker, and accept two bills.
- Pick your own server with Ployz, which I build, if you pay both and the total is past $50, or your database holds gigabytes in memory.
| Monthly bill | Small | Medium | Busy |
|---|---|---|---|
| Vercel Pro + Railway | $51.35 | $156.50 | $467.21 |
| All on Railway | $23.65 | $96.50 | $412.50 |
| Own server + Ployz | $7.09 | $10.59 | $19.09 |
Small is 100,000 page views a month with a 0.5 GB Postgres, medium is 1 million with 2 GB, and busy is 5 million with 8 GB. Each has one worker. The breakdown is further down.
| Plan | Vercel | Railway |
|---|---|---|
| Free | Hobby, $0, personal and non-commercial use only | Free, $0 with $1 of usage a month |
| Entry | None | Hobby, $5 a month with $5 of usage included |
| Team | Pro, $20 per deploying seat, $20 of usage included | Pro, $20 per workspace with unlimited seats, $20 of usage included |
| Which you need | Pro for any commercial app | Hobby until a volume passes 5 GB, then Pro |
Sources: Vercel Hobby, Vercel Pro, Railway pricing.
Vercel is a frontend platform: it runs your pages as functions behind a global CDN and bills per request and per seat. Railway is a container platform: it runs long-lived services, including databases and workers, and bills per second of CPU and RAM.
Most people searching this already use both. Vercel won't run a database or a long-lived worker, so those go to Railway, and now there are two bills and a database reached over the public internet. I paid Railway $500+ a month at one point, mostly for a busy database, so I've seen the Railway half of this bill grow.
Is Railway better than Vercel?
Neither is better overall; they're built for different halves of an app. Vercel is better at serving pages to the world. Railway is better at anything that has to stay running.
| Vercel | Railway | Source | |
|---|---|---|---|
| Runs | Functions and static files behind a CDN | Always-on containers, databases, workers | Vercel KB, Railway docs |
| Paid plan | $20/month per deploying seat, $20 credit | $20/month per workspace, $20 credit, unlimited seats | Vercel Pro, Railway pricing |
| Compute billing | $0.128 per Active CPU hour, $0.0106 per GB-hour of memory (iad1) | $20 per vCPU-month, $10 per GB-month of RAM | Fluid compute pricing, Railway pricing |
| Bandwidth | Flat Rate CDN tiers: 1M requests and 1 TB included, then $20, $100, $300 | $0.05 per GB of egress | Flat Rate CDN, Railway pricing |
| Request time limit | 300 s default, 800 s max on Pro, 1,800 s in beta | 15 minutes if data keeps flowing | Vercel limits, Railway limits |
| Databases | Marketplace integrations from other companies | One-click Postgres, MySQL, Redis, MongoDB | Vercel KB |
| Memory per instance | 2 GB on Hobby, up to 4 GB on Pro | Up to 1 TB per service on Pro | Vercel limits, Railway pricing |
Two rows matter most for cost:
- Seats. Vercel charges $20 for every person who deploys. Railway Pro says "Seats are unlimited and included — the fee is per workspace, not per seat" (pricing).
- Memory. Vercel bills memory only while a request is in flight. Railway bills memory every second a service runs, busy or not.
What would your split stack cost?
Pick the app closest to yours, or customize five numbers. The Vercel row uses Vercel Pro with one seat and Flat Rate CDN in its cheapest region, Washington D.C. (iad1), as in my Vercel pricing breakdown. The Railway rates match my Railway pricing breakdown.
- Data transfer
- 1.0 TB
- Vercel CDN requests
- 20.0M
- Railway usage for Postgres + worker
- $35.50
- Server that fits everything
- Hetzner CX33
- Split: Vercel Pro + Railway$157/mo
Vercel Pro with Flat Rate CDN and one seat (each extra deploying seat adds $20), plus Railway for Postgres and the worker, including query results sent to Vercel as Railway egress.
- All on Railway$97/mo
Next.js, Postgres and the worker as three Railway services. Pages are served as Railway egress at $0.05/GB, with no CDN in front.
- Your own server + Ployz$11/mo
Smallest Hetzner CX23, CX33, CX43 or CX53 that fits all three with headroom, plus about $0.60 for IPv4. Ployz is free. 20 TB traffic included.
My assumptions, which you should replace with your own Usage and Metrics tabs:
| Assumption | Value |
|---|---|
| Vercel, per page view | 20 CDN requests, 30 ms of Active CPU, 250 ms at 2 GB, a 50 KB origin response |
| Vercel images | $1.02 a month |
| Railway Postgres CPU | 0.05 vCPU plus 0.3 vCPU per million page views |
| Railway worker CPU | 0.1 vCPU |
| Next.js on Railway | 0.1 vCPU plus 0.2 per million page views; 0.5 GB of RAM, 1 GB past 2 million page views |
| Query results to Vercel | 20 KB per page view, billed as Railway egress |
Why do so many teams pay for both Vercel and Railway?
Because Vercel doesn't run a database or a process that stays up, and Railway doesn't have Vercel's CDN or its Next.js tooling. So the frontend stays where Next.js works best, and the database, Redis and workers go to Railway. Each choice makes sense alone. Together they add a second platform fee and public traffic between providers.
What the split adds, beyond two invoices:
- Your database is on the public internet. A Vercel function can't join Railway's private network, so it connects through a public proxy. Railway itself says high bills often come from "not using private networking for databases" (understanding your bill). Every query result is $0.05 per GB of egress.
- You can't easily allowlist Vercel. Vercel functions use dynamic IPs. A fixed IP is a $100 a month per project add-on, plus $0.15 per GB of private data transfer (Pro add-ons). So most split stacks leave the database port open to everyone with the password.
- Connections pile up. Vercel functions scale to 30,000 concurrent instances on Pro (limits). Vercel's own advice is to "use connection pooling for database connections." Postgres doesn't like thousands of clients, so you add a pooler, which is one more always-on Railway service.
- Memory waits on the network. Vercel bills provisioned memory "even during I/O operations" (pricing docs). A database in another provider's datacenter means every page holds 2 GB of memory a little longer while it waits.
None of these is a disaster. They're the cost of putting two halves of one app on two platforms.
What does the split stack cost at three sizes?
With my assumptions, the split stack costs $51.35 a month small, $156.50 medium and $467.21 busy. Vercel is 78% of the small bill and 71% of the busy one, because its CDN tier is set by request count. On the Railway side, Postgres RAM is the biggest line every time.
The three apps:
- Small: 100,000 page views, 1 MB each. Postgres 0.5 GB RAM and 1 GB on disk; worker 0.25 GB.
- Medium: 1 million page views. Postgres 2 GB RAM, 10 GB on disk; worker 0.5 GB.
- Busy: 5 million page views. Postgres 8 GB RAM, 50 GB on disk; worker 1 GB.
Railway stays on Hobby until the volume passes 5 GB, then moves to Pro. The plan fee is credit, so you pay the larger of the fee and your usage.
| Line | Small | Medium | Busy |
|---|---|---|---|
| Vercel Pro fee (1 seat) | $20.00 | $20.00 | $20.00 |
| Vercel Flat Rate CDN tier | $20.00 | $100.00 | $300.00 |
| Vercel functions and images, after the $20 credit | $0.00 | $0.00 | $11.71 |
| Vercel subtotal | $40.00 | $120.00 | $331.71 |
| Railway Postgres CPU | $1.60 | $7.00 | $31.00 |
| Railway Postgres RAM | $5.00 | $20.00 | $80.00 |
| Railway Postgres volume | $0.15 | $1.50 | $7.50 |
| Railway worker (0.1 vCPU + RAM) | $4.50 | $7.00 | $12.00 |
| Railway egress to Vercel | $0.10 | $1.00 | $5.00 |
| Railway subtotal | $11.35 (Hobby) | $36.50 (Pro) | $135.50 (Pro) |
| Monthly total | $51.35 | $156.50 | $467.21 |
The Vercel numbers are the same $40, $120 and $332 as in my Vercel pricing article, where I break down why the CDN tier is most of the bill. Every extra person who deploys adds $20 to the Vercel half.
Is Railway cheaper than Vercel for a Next.js app?
For the whole app, yes. Moving Next.js onto Railway takes the three bills to $23.65, $96.50 and $412.50, because you drop Vercel's platform fee and CDN tier. But Railway charges $0.05 per GB for every page it serves, so at 5 TB the frontend alone costs $282 there. Past about 1 TB, Railway's egress eats most of the saving.
| Line | Small | Medium | Busy |
|---|---|---|---|
| Next.js CPU | $2.40 | $6.00 | $22.00 |
| Next.js RAM | $5.00 | $5.00 | $10.00 |
| Page egress at $0.05/GB | $5.00 | $50.00 | $250.00 |
| Postgres and worker (from above, minus egress to Vercel) | $11.25 | $35.50 | $130.50 |
| All on Railway | $23.65 | $96.50 | $412.50 |
| Split stack, for comparison | $51.35 | $156.50 | $467.21 |
So the all-Railway bill is under half the split bill when small, 38% less at medium, and only 12% less when busy. A CDN in front of Railway would cut the egress line. I left it out, because then you're back to paying a second provider.
What you lose by leaving Vercel:
- preview deployments with Vercel's Next.js tooling;
- image optimization, which Railway needs an external service for, per Vercel's comparison;
- the global CDN. Railway runs compute in four regions.
Does Vercel support WebSockets in 2026?
Yes, in public beta since 22 June 2026 (changelog), with Python support added on 23 July. A connection is a function invocation, so it closes when the function hits its maximum duration: 300 seconds by default, 800 on Pro. Next.js has no official upgrade API; Vercel offers an experimental_upgradeWebSocket() workaround. Railway WebSockets have no time limit.
From Vercel's WebSocket docs, last updated 10 August 2026:
- "WebSocket connections close when a Vercel Function reaches its maximum duration." Your client has to reconnect, resubscribe and reload state. Vercel's docs include the reconnect loop for that.
- "New WebSocket connections are not guaranteed to reach the same Vercel Function instance." Rooms, presence and pub/sub need an external store like Redis. In a split stack, that means another Railway service.
- "Next.js does not expose an API for handling WebSocket upgrades." The workaround is
experimental_upgradeWebSocket()from@vercel/functions. Express, Hono, h3, Nitro, Bun and Python ASGI/WSGI frameworks work without it. - Billing follows normal function pricing, "including Function usage while the connection is active." Active CPU only counts while messages are processed. Provisioned memory is billed "until the last in-flight request completes" (pricing), and an open socket is an in-flight request.
On Railway, "Websocket connections are exempt from these duration and inactivity limits, and can stay open indefinitely, even while idle" (specs and limits). Your own server is the same: a Node process with ws or Socket.IO keeps connections open as long as your proxy allows, with no per-connection bill.
I think Vercel's beta is fine for AI streaming and short sessions that reconnect anyway. For a chat app or a multiplayer editor with thousands of sockets open all day, a plain long-running process is simpler and cheaper.
How do cron, background jobs and timeouts compare?
Vercel runs cron jobs by calling a function on a schedule: once a day at most on Hobby, once a minute on Pro. Each run is limited to the function's 300 to 800 seconds. Railway runs a service's start command on a schedule, at least five minutes apart, with no run-time limit. A background worker that never exits only fits on Railway or a server.
| Vercel | Railway | Own server | |
|---|---|---|---|
| Cron frequency | Hobby: once a day, ±59 minutes. Pro: once a minute | Every 5 minutes at most, in UTC | Anything |
| How a cron run works | HTTP call to a function | Starts the service, which must exit when done | Whatever you run |
| Max run time | 300 s (Hobby), 800 s (Pro), 1,800 s in beta | None while it runs; HTTP requests 15 minutes | None |
| Always-on worker | No. Vercel points to Queues and Workflows instead | Yes, a normal service | Yes, a normal process |
| Overlapping runs | Not in the cron docs | Skipped while the last run is still active | Up to you |
Sources: Vercel cron limits, Vercel function limits, Railway cron jobs, Railway limits.
Vercel's answer to background work is two products:
- Vercel Queues, billed per API operation in 4 KiB chunks, with a visibility timeout of up to 60 minutes.
- Workflows, which "pause, resume, and maintain state for minutes to months."
They work, but they change how you write the job. A BullMQ or Sidekiq worker you already have doesn't move to Vercel. It moves to Railway, which is how most split stacks start.
Render vs Vercel: does Render change the picture?
Not much. Render is in Railway's slot, not Vercel's. It runs always-on web services, workers, cron jobs and Postgres, but sells them as fixed instance sizes instead of per-minute usage. So "render vs vercel" is the same split-stack question with a different backend bill. I priced Render's sizes in Render pricing and compared it head to head in Railway vs Render.
What does it cost to run all of it on your own server?
$7.09 a month for the small app on a Hetzner CX23, $10.59 for the medium on a CX33 and $19.09 for the busy one on a CX43. That includes about $0.60 for IPv4, and Ployz is free. Frontend, Postgres, worker and WebSockets run on one box, talk over localhost and share 20 TB of included traffic.
| Server | Specs | Monthly price | Source |
|---|---|---|---|
| Hetzner CX23 | 2 vCPU, 4 GB RAM, 40 GB NVMe, 20 TB traffic | $6.49 | Price list, plans |
| Hetzner CX33 | 4 vCPU, 8 GB RAM, 80 GB NVMe, 20 TB traffic | $9.99 | Same |
| Hetzner CX43 | 8 vCPU, 16 GB RAM, 160 GB NVMe, 20 TB traffic | $18.49 | Same |
| Primary IPv4 | about $0.60 (€0.50) | Hetzner docs | |
| Netcup VPS 500 | 2 vCPU, 4 GB RAM, 64 GB SSD, traffic included | €8.26 incl. VAT on a 12-month term | netcup VPS |
Hetzner prices are after its 15 June 2026 price adjustment, for Germany and Finland, in USD before VAT. Netcup is often the better deal, and it has a US datacenter in Manassas; its VPS 1000 (4 vCPU, 8 GB, 128 GB) is €14.50 incl. VAT.
I sized each server with 1.5 GB of headroom for the OS and Caddy, and 20 GB of disk beyond the database. The busy app uses about 11.5 GB of the CX43's 16 GB, counting headroom, and 5 TB is a quarter of its included traffic. A shared Hetzner vCPU isn't the same as a Railway vCPU or a Vercel CPU-hour, so don't compare the CPU lines one to one. Today my own setup is one dedicated server at €80 a month that runs more than my $500+ Railway bill ever did.
What you give up:
| Job | Vercel + Railway | Your own server |
|---|---|---|
| Global CDN | Yes, on Vercel | No. Pages come from one city, so far-away visitors get slower first loads |
| Database backups | Railway's scheduled volume backups | A Ployz mirror on a second server, synced on request |
| Scaling | The bill goes up instead | Add servers and replicas when you need them |
For every other platform's fees side by side, see what PaaS pricing really costs. For more options in Vercel's slot, see Vercel alternatives.
Where Ployz fits
I build Ployz, which runs this setup on servers you rent. Push to GitHub, and it builds and deploys with zero downtime once you set a health check. Every pull request gets a preview environment. Postgres and Redis are one click each, with Railway-style variables like ${{ postgres.DATABASE_URL }}.
ployz up --server root@your-server
That installs Ployz on a Linux server, builds the current directory and gives it an HTTPS address through Caddy. Your frontend, worker and database share the box and talk over localhost.
For backups, Ployz mirrors the database's volume onto another of your servers and syncs it when you ask. If the first server dies, restore from the mirror, or move the database there with seconds of downtime.
What it doesn't do yet:
- No global CDN. Pages come from your server's location.
Ployz is free on your own servers, custom domains included. Start free on your own server.
FAQ
Can Vercel host a database?
No. Vercel offers databases through Marketplace integrations from other companies. That's why many teams put Postgres on Railway.
Is Railway cheaper than Vercel?
For a whole app, yes: $23.65, $96.50 and $412.50 on Railway against $51.35, $156.50 and $467.21 split across both. Past about 1 TB of traffic, Railway's $0.05 per GB egress eats most of the saving.
Can I run Next.js on Railway?
Yes, as an always-on container. You lose Vercel's CDN and built-in image optimization, and you pay $0.05 per GB for every page served.
Does Vercel support WebSockets?
In public beta since 22 June 2026. Connections close when the function hits its maximum duration, 800 seconds on Pro. Railway WebSockets can stay open indefinitely.
Do Railway and Vercel have free plans?
Yes, both do. Vercel Hobby is free but limited to non-commercial, personal use (Hobby plan). Railway Free is $0 with $1 of usage a month and 0.5 GB of RAM per service, and Railway Hobby is $5 a month with $5 of usage included (pricing).
Can I use Railway and Vercel together?
Yes, and it's the most common setup: the frontend on Vercel, the database and workers on Railway. Connect through Railway's public database URL, add a connection pooler, and expect two bills.
Can Vercel run background workers?
No always-on workers. Vercel points to Queues and Workflows instead, and cron runs are limited to the function's maximum duration.
How I checked
Prices were checked on 8 October 2026 on Vercel's, Railway's and Hetzner's own pages, linked next to each number. All three bill in USD before tax. I used Vercel's cheapest region, Washington D.C. (iad1). The three app sizes and their usage are assumptions, not measurements. I build Ployz, which competes with both, so the maths is all here to check.
Run your frontend, worker and Postgres on your own server with Ployz, free: get started.