# Railway vs Vercel: which should you pay for? > A Next.js frontend on Vercel plus Postgres on Railway costs $51 to $467 a month. All on Railway costs less, and one $7 to $19 server costs less again. Published 2026-10-08, updated 2026-11-14, by Nick Potts. For agents: [llms.txt](https://ployz.dev/llms.txt) indexes the Ployz docs as Markdown. ## Which should you pay for, Railway or Vercel? 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, and Ployz is free on it. **Choose Railway if:** - You want one bill without touching a server. - Your traffic is under about 1 TB a month. - You need WebSockets and workers that stay up. **Choose Vercel if:** - Your app is mostly frontend. - Your visitors are spread around the world. - Your database bill stays near the minimum. **Choose Your own server + Ployz if:** - You pay both and the total is past $50. - Your database holds gigabytes in memory. - Your coding agent deploys the whole app to one rented server, and anything risky waits for you. Pick both if you need Vercel's global CDN and an always-on database or worker, and accept two bills. ## At a glance | Topic | Railway | Vercel | Your own server + Ployz | | --- | --- | --- | --- | | Runs | Always-on containers, databases, workers. | Functions and static files behind a CDN. | The whole app on one server you rent. | | Free plan | Free, $0 with $1 of usage a month and 0.5 GB of RAM per service. | Hobby, $0, personal and non-commercial use only. | Ployz is free on any number of servers, custom domains included. You pay for the server. | | Paid plans | Hobby, $5 a month with $5 of usage included, until a volume passes 5 GB. Then Pro, $20 per workspace with unlimited seats, $20 of usage included. | No entry plan. Pro, $20 per deploying seat with $20 of usage included, for any commercial app. | The server: $6.49 to $18.49 a month at Hetzner (Europe), plus about $0.60 for IPv4. | | Compute billing | $20 per vCPU-month and $10 per GB-month of RAM. | $0.128 per Active CPU hour and $0.0106 per GB-hour of memory (iad1). | The server's fixed monthly price. | | Bandwidth | $0.05 per GB of egress. | Flat Rate CDN tiers: 1M requests and 1 TB included, then $20, $100, $300. | 20 TB included on Hetzner Europe. Included on Netcup. (better) | | The same app, a month | All on Railway: **$23.65** small, **$96.50** medium, **$412.50** busy. | Vercel Pro plus Railway for Postgres and a worker: **$51.35** small, **$156.50** medium, **$467.21** busy. | **$7.09** small, **$10.59** medium, **$19.09** busy. (better) | | Time limits | An HTTP request can run 15 minutes if data keeps flowing. A scheduled run has no time limit. | A function runs 300 s by default and on Hobby, 800 s max on Pro, 1,800 s in beta. | None on a process you run. | | WebSockets | No time limit. Connections can stay open indefinitely, even while idle. | Public beta since 22 June 2026. A connection closes when the function hits its maximum duration. | Open as long as your proxy allows, with no per-connection bill. | | Background workers | Yes, a normal service. | No always-on workers. Vercel points to Queues and Workflows instead. | Yes, a normal process. | | Databases | One-click Postgres, MySQL, Redis, MongoDB, with scheduled volume backups. | Marketplace integrations from other companies. | Postgres and Redis are one click each. A restore point for every database, restored in a click. | | Memory per instance | Up to 1 TB per service on Pro. (better) | 2 GB on Hobby, up to 4 GB on Pro. | What the server has: 4 GB on a CX23, 16 GB on a CX43. | | Global CDN | No. Railway runs compute in four regions. | Yes. (better) | Pages are served from where your servers are, in the regions you pick. | | Next.js | Runs as an always-on container. Image optimization needs an external service, per [Vercel's comparison](https://vercel.com/kb/guide/vercel-vs-railway). | Preview deployments with Vercel's Next.js tooling, and built-in image optimization. (better) | Runs on the same box as the database. Every pull request gets [a preview environment](https://ployz.dev/features/preview-environments). | | Logs and metrics | Its own dashboard, so a split stack has two. | Its own dashboard, so a split stack has two. | Metrics, searchable logs and crash emails in one dashboard. | 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. ## Is Railway better than Vercel? Neither is better overall; they're built for different halves of an app. Two things matter most for cost: seats and memory. **Railway:** Railway is better at anything that has to stay running. Its Pro plan says "Seats are unlimited and included — the fee is per workspace, not per seat". It bills memory every second a service runs, busy or not. **Vercel:** Vercel is better at serving pages to the world. It charges $20 for every person who deploys. It bills memory only while a request is in flight. ## 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 on Vercel, and the database, Redis and workers go to Railway. Together they add a second platform fee and public traffic between providers. None of what the split adds is a disaster. It's the cost of putting two halves of one app on two platforms. **Railway:** A Vercel function can't join Railway's private network, so it connects through a public proxy, and every query result is $0.05 per GB of egress. Railway itself says high bills often come from "not using private networking for databases". Postgres doesn't like thousands of clients, so you add a pooler, which is one more always-on Railway service. **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, so most split stacks leave the database port open to everyone with the password. Vercel bills provisioned memory "even during I/O operations", so every page holds 2 GB of memory a little longer while it waits on a database in another provider's datacenter. **Your own server + Ployz:** Frontend, Postgres, worker and WebSockets run on one box, talk over localhost and share 20 TB of included traffic on Hetzner Europe. ## Does Vercel support WebSockets in 2026? Yes, in public beta since 22 June 2026, with Python support added on 23 July. **Railway:** Railway WebSockets have no time limit. Its docs say "Websocket connections are exempt from these duration and inactivity limits, and can stay open indefinitely, even while idle". **Vercel:** A connection is a function invocation, and "WebSocket connections close when a Vercel Function reaches its maximum duration": 300 seconds by default, 800 on Pro. Your client has to reconnect, resubscribe and reload state, and Vercel's docs include the reconnect loop for that. **Your own server + Ployz:** Your own server is the same as Railway: a Node process with `ws` or Socket.IO keeps connections open as long as your proxy allows. ## What does an open WebSocket cost? 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. **Railway:** A Railway service is a plain long-running process. **Vercel:** 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", and an open socket is an in-flight request. "New WebSocket connections are not guaranteed to reach the same Vercel Function instance", so rooms, presence and pub/sub need an external store like Redis, which in a split stack means another Railway service. **Your own server + Ployz:** A long-running process on your own server has no per-connection bill. ## How do cron, background jobs and timeouts compare? Scheduled jobs run on both platforms, but a Vercel run is limited to the function's 300 to 800 seconds. A background worker that never exits only fits on Railway or a server. **Railway:** Railway runs a service's start command on a schedule, every 5 minutes at most, in UTC. The service must exit when done, and a run is skipped while the last one is still active. A BullMQ or Sidekiq worker you already have doesn't move to Vercel. It moves to Railway, which is how most split stacks start. **Vercel:** Vercel calls a function over HTTP: once a day, ±59 minutes, on Hobby and once a minute on Pro. Overlapping runs aren't in its cron docs. Its answer to background work is Queues, billed per API operation in 4 KiB chunks with a visibility timeout of up to 60 minutes, and Workflows, which "pause, resume, and maintain state for minutes to months." They work, but they change how you write the job. ## 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](https://ployz.dev/blog/vercel-pricing). The Railway rates match my [Railway pricing breakdown](https://ployz.dev/blog/railway-pricing). *The interactive calculator is on the web page: https://ployz.dev/blog/railway-vs-vercel* 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 | ## What does the split stack cost at three sizes? 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, each with one worker: - **Small:** 100,000 page views a month, 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's 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](https://ployz.dev/blog/vercel-pricing), 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, because moving Next.js onto Railway drops 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. ## 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](https://ployz.dev/blog/render-pricing) and compared it head to head in [Railway vs Render](https://ployz.dev/blog/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, each including about $0.60 for IPv4. | Server | Specs | Monthly price | |---|---|---| | Hetzner CX23 | 2 vCPU, 4 GB RAM, 40 GB NVMe, 20 TB traffic | $6.49 | | Hetzner CX33 | 4 vCPU, 8 GB RAM, 80 GB NVMe, 20 TB traffic | $9.99 | | Hetzner CX43 | 8 vCPU, 16 GB RAM, 160 GB NVMe, 20 TB traffic | $18.49 | | Primary IPv4 | | about $0.60 (€0.50) | | Netcup VPS 500 | 2 vCPU, 4 GB RAM, 64 GB SSD, traffic included | €8.26 incl. VAT on a 12-month term | 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. When the app grows on Vercel and Railway, the bill goes up. On your own server you add servers and replicas when you need them. I paid Railway $500+ a month at one point, mostly for a busy database. Today my own setup is one dedicated server at €80 a month that runs more than that Railway bill ever did. ## Moving the stack to your own server I build Ployz to run the whole app on one server you rent. Your coding agent runs it. Paste `Read ployz.dev/agents.md and deploy this repo to my server.` into Claude Code, Codex or Cursor. It adds the server and ships the app. ```sh ployz up --server root@your-server ``` The frontend, worker and Postgres share one box and one bill. Push to GitHub and it builds on your server. Every pull request gets a preview with its own https address. Every deploy, restart or delete your agent asks for waits for you to approve. Ployz is free on any number of servers. [Deploy to your own server](https://ployz.dev/auth/github). ## Questions ### 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 Vercel WebSockets work with Next.js? Only through a workaround: `experimental_upgradeWebSocket()` from `@vercel/functions`. Next.js has no official upgrade API, and Vercel's docs say "Next.js does not expose an API for handling WebSocket upgrades". Express, Hono, h3, Nitro, Bun and Python ASGI/WSGI frameworks work without it. ### Do Railway and Vercel have free plans? Yes, both do. Vercel Hobby is free but limited to non-commercial, personal use. 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. ### 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. Vercel functions scale to 30,000 concurrent instances on Pro, and Vercel's own advice is to "use connection pooling for database connections." ### 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. ## Sources Every statement about Railway and Vercel comes from the pages below, checked on 8 October 2026. They can change after that date. Prices were checked on 8 October 2026 on Vercel's, Railway's and Hetzner's own pages, listed below. 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. - [Railway pricing](https://railway.com/pricing) - [Railway: understanding your bill](https://docs.railway.com/pricing/understanding-your-bill) - [Railway public networking specs and limits](https://docs.railway.com/networking/public-networking/specs-and-limits) - [Railway cron jobs](https://docs.railway.com/reference/cron-jobs) - [Railway's comparison with Vercel](https://docs.railway.com/platform/compare-to-vercel) - [Vercel Hobby plan](https://vercel.com/docs/plans/hobby) - [Vercel Pro plan](https://vercel.com/docs/plans/pro-plan) - [Vercel Pro paid add-ons](https://vercel.com/docs/plans/pro-plan#paid-add-ons) - [Vercel Fluid compute pricing](https://vercel.com/docs/functions/usage-and-pricing) - [Vercel Flat Rate CDN](https://vercel.com/docs/pricing/flat-rate-cdn) - [Vercel function limits](https://vercel.com/docs/functions/limitations) - [Vercel WebSocket docs, last updated 10 August 2026](https://vercel.com/docs/functions/websockets) - [Vercel changelog: WebSocket support in public beta](https://vercel.com/changelog/websocket-support-is-now-in-public-beta) - [Vercel cron limits](https://vercel.com/docs/cron-jobs/usage-and-pricing) - [Vercel Queues pricing](https://vercel.com/docs/queues/pricing) - [Vercel Workflows](https://vercel.com/docs/workflows) - [Vercel's comparison with Railway](https://vercel.com/kb/guide/vercel-vs-railway) - [Hetzner price list](https://docs.hetzner.com/general/infrastructure-and-availability/price-adjustment/) - [Hetzner cost-optimized plans](https://www.hetzner.com/cloud/cost-optimized) - [Hetzner servers and IPv4](https://docs.hetzner.com/cloud/servers/overview/) - [netcup VPS](https://www.netcup.com/en/server/vps) ## Read next - [Vercel pricing in 2026: Hobby vs Pro and what an app costs](https://ployz.dev/blog/vercel-pricing) - [Railway pricing in 2026: calculator and real bills](https://ployz.dev/blog/railway-pricing) - [Railway vs Render: which is cheaper in 2026?](https://ployz.dev/blog/railway-vs-render) - [Render pricing in 2026: calculator and real bills](https://ployz.dev/blog/render-pricing) - [Best Vercel alternatives in 2026, priced for a real app](https://ployz.dev/blog/vercel-alternatives) - [PaaS pricing in 2026: what it really costs](https://ployz.dev/blog/paas-pricing)