> ## Documentation Index
> Fetch the complete documentation index at: https://supastack.dev/llms.txt
> Use this file to discover all available pages before exploring further.
> For the full documentation corpus in one file, fetch: https://supastack.dev/llms-full.txt

# Where to host a Next.js SaaS in 2026: Vercel vs Cloudflare vs Railway vs a VPS

Choose a Next.js host by pricing a real workload, placing Postgres near your app, and deciding where cron, workers, and WebSocket connections will run.

_Published 2026-11-23._
_Updated 2026-11-23._

> **Where should I host a Next.js SaaS that needs Postgres and background jobs?**
> It depends on how much work your app does outside the HTTP request. Vercel is a good starting point for Next.js with managed jobs elsewhere. Railway is a reasonable step toward keeping a Node app, worker, and database together. Cloudflare Workers suit an app that runs well through the OpenNext adapter. A VPS buys runtime control and predictable server rent, but someone has to maintain it. Choose the database region before comparing global edge claims.

## Choose a host by what has to stay running

For a Next.js app that renders pages, handles checkout, and hands slow work to a managed queue, start with Vercel. If you need a resident worker and want it near your database without maintaining a server, start with Railway. Pick Cloudflare Workers when you have tested the app on OpenNext and know which work benefits from running close to the visitor. Use a VPS when control or a steady workload justifies taking the pager.

A global homepage and an authenticated dashboard have different needs. The homepage can be cached almost anywhere. The dashboard might make six Postgres queries before it renders. Choose hosting for the dashboard and let the CDN take care of the homepage.


## What you pay for after launch

On Vercel, preview deploys are a good reason to start there. Once usage grows, measure requests, function compute, image optimization, and data transfer separately. An export route can be a bigger cost driver than the page most people visit. Check the [function limits](https://vercel.com/docs/functions/limits) before treating an HTTP handler like a worker.

Cloudflare bills Workers for requests and CPU time. Include whatever you add for caching, state, or database access, and test routes with [OpenNext on Workers](https://developers.cloudflare.com/workers/framework-guides/web-apps/nextjs/), not just the Next.js dev server. A Node dependency may build locally and still need an adapter change.

Railway lets you run the app and a separate worker as regular services. Size the memory and CPU for both, then account for egress and storage. On a VPS you rent capacity whether busy or idle. That can look attractive for constant load, but budget for backups, patching, spare capacity, and your time.


## A cron trigger is not a job queue

Have cron enqueue work or claim a batch of due jobs. Record progress durably so a retry can pick up without sending a second round of emails. Vercel cron calls a route. Cloudflare Cron Triggers run a scheduled Worker handler. A [Railway cron service](https://docs.railway.com/guides/cron-jobs) starts a process that should exit after the run. On a VPS, a timer can wake a worker you control. None of those triggers is a substitute for a retry policy.

If the feature needs WebSockets, draw the connection on the architecture diagram. [Vercel Functions cannot act as the WebSocket server](https://vercel.com/kb/guide/do-vercel-serverless-functions-support-websocket-connections). Use a separate realtime provider there. On Workers, consider Durable Objects for connections that need shared room state. On Railway or a VPS, run a suitable server process and verify proxy timeouts and reconnects during a redeploy.


## Put the database near the code that waits for it

Run the chatty, signed-in routes in the database region if possible. An extra 40 ms on each of six sequential queries adds 240 ms before rendering. Test with the production connection mode, including a pooler if bursts would otherwise open too many connections. Check p95 latency on a signed-in page and a write, not the cached health check.

For a portable first deploy, keep business logic out of platform cron adapters, use a normal Postgres connection, and document how to build the app as a container. If you adopt a host-specific service, write down what you would have to replace when moving. That trade can be worth it. Finding it during an outage is not.


## What supastack gives you to start with

Supastack ships a standalone Next.js Docker build, with runbooks for a plain Docker VPS or a VPS managed by Coolify. The [web deployment guide](https://supastack.dev/docs/web/deployment.md) covers the app build, Postgres migrations, and production provider setup. The [Cloud Run guide](https://supastack.dev/docs/web/deploy-google-cloud.md) is another documented container route.

For the built-in job runner on a VPS, the runbook has you configure a scheduler tick. If you run multiple app instances, the default in-process realtime bus no longer shares workspace events across them; the kit documents a Postgres realtime provider for that case. Use those deployment requirements to evaluate Vercel, Workers, or Railway before assuming the Docker runbook translates.
