Draft, not yet published
Vercel vs Railway vs self-hosting for AI-built apps: honest cost and risk comparison
7 July 2026· 8 min read · by Stackbastion
Your AI-built app works. Now you need somewhere real to run it, and the three options everyone points at are Vercel, Railway, and self-hosting on something like Hetzner. They’re built for different jobs, and the wrong pick either burns money or eats your weekends. Here’s the honest version of each, including the scenarios where Vercel or Railway is clearly the right call and self-hosting would be a mistake.
What each one actually is
Before the table, it helps to know what you’re comparing, because these aren’t three flavors of the same thing.
Vercel is a frontend and serverless platform. It’s fantastic at hosting Next.js, React, and static sites, deploying on every git push, and serving pages fast from a global edge network. It does not run a traditional always-on backend or database for you. You bring those from somewhere else.
Railway is a full-app platform. It runs your backend, your database, and your workers as long-lived services, deploys from a git repo, and handles the plumbing. It’s the closest thing to “self-hosting without the server admin.” You pay for that convenience.
Self-hosting (Hetzner, a VPS, your own box) means you rent a Linux server and run everything yourself: the app, Postgres, the reverse proxy, backups, monitoring. Cheapest in cash, most expensive in time and responsibility.
The three-way comparison
| Factor | Vercel | Railway | Self-hosting (Hetzner) |
|---|---|---|---|
| Best at | Frontend, Next.js, edge, static | Full apps: backend + DB + workers | Full control, lowest cash cost |
| Monthly cost (small app) | €0-20, then usage spikes | ~€15-40 | ~€16-40 |
| Database included | No (bring your own) | Yes, managed Postgres | No, you run it |
| Setup effort | Very low | Low | High (8-16 hrs first time) |
| Ongoing ops | Almost none | Low | Medium (patching, backups, monitoring) |
| Scales to spikes | Automatic, instant | Automatic, smooth | Manual, you plan ahead |
| Cost predictability | Poor (usage-based, can surprise) | Moderate | High (fixed server fee) |
| Egress / bandwidth | Metered, can get pricey | Metered, moderate | 20 TB included, cheap after |
| Lock-in risk | Medium-high (edge functions, config) | Low-medium (standard Docker/Postgres) | Low (plain Linux and Postgres) |
| Who holds the pager | Vercel | Railway | You |
Read the table as a shape, not gospel: prices move and your workload matters. But the pattern holds. Vercel trades money and predictability for zero ops and great frontend performance. Railway sits in the middle. Self-hosting trades your time for the lowest cash cost and the most control.
Where Vercel is the right call
Vercel gets unfairly dunked on for cost, so let’s be fair. There are real cases where it’s the obvious pick and self-hosting would be a waste of your time:
- Your app is mostly frontend. A marketing site, a Next.js app with light API routes, a static-heavy product. Vercel deploys it in minutes, serves it fast worldwide, and you never think about servers. Self-hosting this is busywork.
- You value deploy speed over everything. Push to git, it’s live in 90 seconds with preview URLs for every branch. For a fast-moving team shipping constantly, that flow is worth real money.
- Traffic is low or bursty and you’re on the free tier. Small projects genuinely run for €0 on Vercel. Don’t pay for a server you don’t need.
Where Vercel bites you: it’s usage-based, so a traffic spike or heavy serverless usage can turn a €20 month into a €400 one with no warning. And it doesn’t host your database, so you still need Railway, Supabase, or a self-hosted Postgres alongside it. The cost surprise is the real risk, not the platform quality.
Where Railway is the right call
Railway is the sweet spot for a lot of AI-built apps, and here’s when it’s the honest best choice:
- You have a real backend and database, and you don’t want to run a server. Railway hosts your app, your Postgres, and your workers together, from a git repo, with almost no infrastructure work. For a small team without ops skills, that’s exactly right.
- You’re past prototyping but not at scale. When you’ve outgrown a builder’s hosting but you’re not ready to hire someone who knows Linux, Railway carries you well.
- You want it to just work. Railway handles the plumbing that self-hosting makes you do by hand. That convenience has a price, but for a lot of people it’s a fair one.
Where Railway bites you: cost climbs as you add services and usage, and you have less control than a real server. It’s also a platform you’re renting, so you inherit its limits and pricing changes. The lock-in is milder than Vercel’s because Railway runs standard Docker and Postgres, so leaving is doable, but you’re still on someone else’s platform. (This site itself runs its static marketing pages on Railway, for what it’s worth, so no shade here.)
Where self-hosting is the right call
Self-hosting wins when the numbers or the requirements push you there:
- Bandwidth or compute costs are eating you alive. If you serve lots of media or run heavy background work, Vercel’s egress and Railway’s usage billing can cost far more than a €16 Hetzner box that includes 20 TB. At real scale, self-hosting is dramatically cheaper.
- You need control or specific compliance. EU data residency, specific Postgres extensions, custom networking, or a setup that no platform offers. A server does whatever you configure it to.
- You have the skills or someone who does. If running Linux and Postgres doesn’t scare you, self-hosting gives you the most for your money by a wide margin.
Where self-hosting bites you: everything is your job. Backups, tested restores, patching, monitoring, and the 2 a.m. page when the disk fills. The €16 server is real, but so are the hours around it. We put actual numbers on that trade in the total cost of ownership post.
A simple way to decide
Skip the feature checklists and answer three questions honestly:
- Do you have a real backend and database, or mostly a frontend? Mostly frontend points to Vercel. A real backend points to Railway or self-hosting.
- Is your time or your cash the scarcer resource? Time-scarce points to Railway or Vercel. Cash-scarce with the skills to run a server points to self-hosting.
- Would a surprise bill or a surprise outage hurt more? Fear of a surprise bill points away from usage-based Vercel toward fixed-cost self-hosting. Fear of an outage you can’t fix points toward a managed platform, or toward paying someone to run your server for you.
There’s no universally right answer. A weekend project and a growing SaaS with paying customers should make different calls, and the same app should probably move between these as it grows. Starting on Vercel or Railway and moving to self-hosting once bandwidth costs bite is a completely normal path, not a failure.
Or, we do it for you
If the honest answer is “I want self-hosting economics without becoming an ops team,” that’s the exact gap we fill. We run your app on your own dedicated server with tested backups, monitoring, patching, and a human on call, so you get the low fixed cost without the pager. See the plans on our pricing page.
FAQ
Can I use Vercel and a separate database together?
Yes, and it’s the normal setup. Vercel hosts your frontend and API routes, and you connect a database hosted elsewhere: Supabase, Railway, or your own Postgres. Just watch the latency between them and the egress costs if they’re in different regions.
Is Railway just self-hosting with extra steps?
No, it’s the opposite. Railway removes the steps. You skip server setup, OS patching, and backup configuration, and Railway handles the infrastructure. You pay more than a raw server and give up some control, but you save the ops time. It’s a real trade, not a scam either way.
Which is cheapest for an app that serves lots of images or files?
Self-hosting, usually by a wide margin. Vercel and Railway meter bandwidth, so serving heavy media runs up usage bills fast. A Hetzner server includes 20 TB of traffic and charges around €1 per extra TB, which is far cheaper at that scale.
Should I start on one and switch later?
Often, yes. Starting on Vercel or Railway to move fast, then switching to self-hosting when costs or control demand it, is a common and sensible path. As long as you build on standard tools (Docker, Postgres, plain HTTP) rather than platform-only features, moving later stays manageable.
What’s the real lock-in risk with each?
Vercel has the most, because edge functions and platform config don’t port cleanly elsewhere. Railway has less, since it runs standard Docker and Postgres you can take with you. Self-hosting has the least, because it’s plain Linux and Postgres. If avoiding lock-in matters, favor standard tools wherever you land.