guide

Migrating from Vercel to bext in 15 Minutes

You have a Next.js app on Vercel. It works fine. But maybe the bills are growing, or you need more control over your infrastructure, or you want to self-host for compliance reasons.

bext can replace Vercel for Next.js deployments with zero code changes. Here's how.

flowchart LR
  subgraph V["Vercel"]
    direction TB
    e["Edge network"]
    f["Serverless functions"]
    i["Image optimization"]
    r["ISR (edge cache)"]
  end
  subgraph X["bext — one server"]
    direction TB
    one["TLS · WAF · render · ISR · images<br/>in one process"]
  end
  V -.->|"same app, no code changes"| X
  classDef accent fill:#fff1f2,stroke:#f43f5e,color:#0c0c0c,stroke-width:2px
  class one accent

Prerequisites

  • A server (any VPS — Hetzner, DigitalOcean, AWS EC2)
  • A domain name pointed at your server
  • SSH access

Step 1: Install bext (30 seconds)

Shell
curl -fsSL https://bext.dev/install | sh

This installs the bext binary to ~/.local/bin. It's a single static binary — no Node.js, no Docker, no dependencies.

Step 2: Clone your app (1 minute)

Shell
git clone https://github.com/yourname/your-nextjs-app.git
cd your-nextjs-app

Step 3: Build and run (2 minutes)

Shell
bext run .

That's it. bext auto-detects Next.js, runs the build, starts the server, and provisions a TLS certificate via ACME. Your app is live at https://yourdomain.com.

What bext Handles Automatically

ISR caching. Vercel's ISR uses their edge network. bext's ISR uses an in-memory LRU cache with stale-while-revalidate. Same behavior, faster responses (no network hop to an edge cache).

Image optimization. next/image works out of the box. bext processes images on-the-fly with the same API — resize, format conversion, quality adjustment. No Vercel Image Optimization billing.

API routes. Your /api/* routes run in-process on bext's embedded V8 runtime — no separate Node server to babysit. Most routes port over unchanged; ones that reach for Node-specific built-ins may need a small tweak.

Middleware. middleware.ts is supported. Runs before routing, same as Vercel.

Environment variables. Create a .env file or set them in bext.config.toml:

TOML
[env]
DATABASE_URL = "postgres://..."
NEXT_PUBLIC_API_URL = "https://api.example.com"
Note

Most Next.js apps port over untouched. The exceptions are routes that reach for Node-only built-ins (raw Buffer streaming, some fs patterns) — those may need a small adjustment on bext's V8 runtime.

What's Different

No edge functions. bext runs on your server, not a CDN edge. For most apps, this doesn't matter — a well-cached server in a good datacenter is faster than an edge function that cold-starts on every request.

No serverless scaling. bext runs as a single process (or a cluster on multi-core servers). On the same hardware it serves many times the throughput of a Node process. If you need more, add another server behind a load balancer.

No analytics dashboard. Vercel's analytics are replaced by bext's built-in metrics at /__bext/admin/. For more detail, use the companion desktop app or connect to Grafana via OpenTelemetry.

Step 4: Set up automatic deploys (5 minutes)

For git-push deploys (like Vercel), add a webhook:

TOML
# bext.config.toml
[git_deploy]
enabled = true
secret = "your-webhook-secret"
branch = "main"

Then add a webhook in your GitHub repo settings pointing to https://yourdomain.com/__bext/git/webhook. Every push to main triggers a build and zero-downtime deploy.

Step 5: Custom domains (2 minutes)

TOML
# bext.config.toml
[server]
listen = "0.0.0.0:443"
domains = ["yourdomain.com", "www.yourdomain.com"]

bext provisions TLS certificates for all listed domains automatically.

Cost Comparison

Vercel Probext on Hetzner
Monthly cost$20 + usage$4.50 (CAX11)
Bandwidth1TB included20TB included
Build minutes6,000/moUnlimited
Image optimization$5/1000 imagesIncluded
ISR revalidationsUsage-basedIncluded
Team members$20/seatUnlimited

For a typical SaaS app serving 100K page views/month, the difference is $20-80/month on Vercel vs $4.50/month on bext.

When to Stay on Vercel

Vercel is the right choice if you need global edge deployment, you don't want to manage any infrastructure, or you're using Vercel-specific features like Edge Config or KV. bext is for teams who want control, lower costs, or self-hosting.