# Where to Host Your Backend When Your Frontend Is on Vercel

Vercel has no always-on servers and Vercel Postgres is gone. Where to run your API, workers, WebSockets and database, and how to wire them to a Vercel frontend.

URL: https://blog.dockhosting.dev/vercel-backend-hosting
Published: 2026-10-19 · Updated: 2026-11-06 · Author: Doughmi ILYAS

## Summary

- Vercel runs functions per request: it has no always-on server, so long-running workers, WebSockets and bots need another home.
- Vercel Postgres is no longer available; Vercel points new projects to Marketplace providers instead.
- A common setup: frontend on Vercel, API + workers + database on a PaaS, connected over HTTPS with CORS.

ort const meta = {
  title: "Where to Host Your Backend When Your Frontend Is on Vercel",
  seoTitle: "Where to Host Your Backend If You Use Vercel (2026)",
  description:
    "Vercel has no always-on servers and Vercel Postgres is gone. Where to run your API, workers, WebSockets and database, and how to wire them to a Vercel frontend.",
  date: "2026-10-19",
  updated: "2026-11-06",
  sources: ["https://vercel.com/pricing", "https://vercel.com/docs/postgres"],
  category: "Explainers",
  tags: ["Vercel", "Backend", "Next.js", "Serverless", "Architecture"],
  stack: ["vercel", "nextjs", "postgresql"],
  tryLabel: "backend",
  command: "dock deploy",
  takeaways: [
    "Vercel runs functions per request: it has no always-on server, so long-running workers, WebSockets and bots need another home.",
    "Vercel Postgres is no longer available; Vercel points new projects to Marketplace providers instead.",
    "A common setup: frontend on Vercel, API + workers + database on a PaaS, connected over HTTPS with CORS.",
  ],
  faq: [
    {
      q: "Can Vercel run a backend?",
      a: "It runs serverless functions and Route Handlers, which are fine for request/response APIs. It doesn't offer an always-on server, so queue workers, cron-heavy jobs, WebSocket servers and bots that hold a connection need a long-running host.",
    },
    {
      q: "What happened to Vercel Postgres?",
      a: "Vercel's docs say Vercel Postgres is no longer available. Existing databases were moved to Neon in December 2024, and new projects use Marketplace providers such as Neon, Prisma Postgres, Supabase or AWS Aurora.",
    },
    {
      q: "Is Vercel's free Hobby plan OK for a business?",
      a: "Vercel's Hobby plan is for personal, non-commercial use. Commercial projects need Pro, which is $20/month per seat with usage on top.",
    },
  ],
};

Vercel is one of the best places to deploy a Next.js frontend. But most real apps also have parts that **don't fit the serverless model**: a queue worker, a WebSocket server, a scheduled job that runs for ten minutes, a Discord bot, a database. Here's how to split the app sensibly.

> **Checked 6 November 2026:** Vercel facts are from [vercel.com/pricing](https://vercel.com/pricing) and the [Vercel Postgres docs](https://vercel.com/docs/postgres).

## What Vercel does (and doesn't do)

- **Does:** static assets on a global CDN, Server Components and SSR, Route Handlers and serverless functions billed per invocation and CPU.
- **Doesn't:** run an **always-on server**. Functions exist while a request is being handled.
- **Database:** Vercel Postgres is no longer available. New projects pick a [Marketplace provider](https://vercel.com/marketplace) (Neon, Prisma Postgres, Supabase, AWS Aurora), each priced separately.
- **Plans:** Hobby is free for **personal, non-commercial** use, with hard usage caps. Pro is $20/month with $20 of usage credit included.

## What needs a long-running host

| Workload | Why serverless struggles | Where it fits |
|---|---|---|
| Queue workers (BullMQ, Celery, Sidekiq) | Must run continuously to pull jobs | Always-on service |
| WebSockets / realtime | Connections outlive a request | Always-on service |
| Discord bots | Hold a gateway connection 24/7 | [Always-on service](/host-discord-bot-24-7) |
| Long jobs (video, imports, reports) | Function time limits | Worker service |
| A database | Needs persistent storage | Managed database |

## A clean split: frontend on Vercel, backend on a PaaS

```text
Browser ──▶ Vercel (Next.js frontend)
               │  fetch("https://api.myapp.com/…")
               ▼
          API service ──┬── PostgreSQL (DATABASE_URL)
          Worker service ┴── Redis queue (REDIS_URL)
```

On DockHosting, each box is a project:

1. **API**: Express, FastAPI, Django, Go or anything with a Dockerfile, deployed with `dock deploy`.
2. **Worker**: the same repository deployed as a second project with a different start command, for example `node worker.js`.
3. **PostgreSQL + Redis**: managed databases attached to both projects. `DATABASE_URL` and `REDIS_URL` are injected over a private network, so the database has no public port.

## Wiring it to the frontend

**1. Point the frontend at the API** with an environment variable in Vercel:

```bash
NEXT_PUBLIC_API_URL=https://api.myapp.com
```

**2. Allow the frontend's origin** in the API (Express example):

```js
import cors from "cors";
app.use(cors({ origin: ["https://myapp.com", "https://myapp.vercel.app"] }));
```

**3. Give the API its own domain.** Add `api.myapp.com` as a custom domain on Hobby and up. HTTPS certificates are issued automatically.

> Keep secrets server-side. Anything prefixed `NEXT_PUBLIC_` ends up in the browser bundle. Call protected APIs from Route Handlers or Server Components using server-only variables.

## Or keep it all in one place

If you'd rather not split, a Next.js app also runs as a normal Node.js server, with no Vercel-specific features required. Deploy it with `npm run build` and `npm start`, or as a Docker image: see [deploying Next.js with Docker](/deploy-nextjs-docker). Then the frontend, API, worker and database all live next to each other.

## Cost sketch

For a small commercial app on DockHosting Hobby ($4/month): 1 GB memory shared across 3 projects (frontend or API, worker) and 2 managed databases (PostgreSQL + Redis), with daily backups and your own domain. Pro ($9) raises that to 10 projects, 6 databases and 3 GB. See [pricing](https://dockhosting.dev/pricing) and the [Heroku alternatives comparison](/best-heroku-alternatives-2026) for other options.

**Related:** [Free backend hosting compared](/free-backend-hosting) · [Railway app alternatives](/railway-alternatives)

## FAQ

### Can Vercel run a backend?

It runs serverless functions and Route Handlers, which are fine for request/response APIs. It doesn't offer an always-on server, so queue workers, cron-heavy jobs, WebSocket servers and bots that hold a connection need a long-running host.

### What happened to Vercel Postgres?

Vercel's docs say Vercel Postgres is no longer available. Existing databases were moved to Neon in December 2024, and new projects use Marketplace providers such as Neon, Prisma Postgres, Supabase or AWS Aurora.

### Is Vercel's free Hobby plan OK for a business?

Vercel's Hobby plan is for personal, non-commercial use. Commercial projects need Pro, which is $20/month per seat with usage on top.
