Migrate from Vercel to Self-Hosted

Most Next.js apps migrate to Temps in under 30 minutes. This guide covers what transfers as-is, what needs a small adjustment, and the exact steps to cut over your domain with zero downtime.


What Transfers Without Changes

The following work identically on Temps:

  • Static pages (SSG) and server-side rendering (SSR)
  • API routes and Route Handlers
  • App Router and Pages Router
  • Middleware (redirect/rewrite logic)
  • Incremental Static Regeneration (ISR)
  • Image optimization
  • Environment variables

What Needs an Alternative

Vercel-proprietary APIs need to be swapped before you migrate:

Vercel FeatureReplacement
Vercel KVRedis (self-hosted or Upstash)
Vercel PostgresAny PostgreSQL (Neon, Supabase, self-hosted)
Vercel BlobS3-compatible storage (Cloudflare R2, MinIO)
@vercel/analyticsTemps Analytics (built-in, zero config)
Speed InsightsTemps monitoring (built-in)
Edge RuntimeNode.js runtime

If your app doesn't use any of these, you can migrate with no code changes.


Pre-Migration Checklist

Before starting, confirm:

  • You have SSH access to a VPS (Ubuntu 22.04+ recommended) or Temps is already installed
  • You control the DNS for your domain
  • You have your Vercel environment variables exported (see Step 1)
  • Any Vercel-specific packages are swapped or removed

Step 1: Export Environment Variables

# Via Vercel CLI
vercel env pull .env.local

Or export manually from Vercel Dashboard → Project → Settings → Environment Variables.


Step 2: Configure Next.js for Self-Hosting

Add standalone output mode to next.config.ts if it isn't already set:

const nextConfig = {
  output: "standalone",
};

export default nextConfig;

This produces a self-contained bundle that runs anywhere Node.js is installed — no Vercel-specific runtime required.


Step 3: Deploy to Temps

# Install Temps on your server if not already installed
curl -fsSL https://temps.sh/deploy.sh | bash

Then connect your repository:

  1. Open the Temps console and go to Projects → New Project
  2. Select your repository and the main branch
  3. Click Deploy — Temps auto-detects Next.js and sets the correct build and start commands

Add your environment variables under Project → Settings → Environment Variables before the first deploy, or the build may fail.


Step 4: Verify Before Cutting Over

Once the first deploy succeeds, your app is reachable at a Temps-provided preview URL (e.g. my-app.temps.app). Verify:

  • Pages load correctly
  • API routes respond
  • Auth flows work end-to-end
  • Environment-dependent features function as expected

Only proceed to DNS cutover after this verification passes.


Step 5: Cut Over DNS

  1. Go to Project → Settings → Domains → Add Domain in the Temps console
  2. Temps shows the DNS records to add (A record or CNAME)
  3. Update your DNS registrar — propagation typically takes 1–5 minutes with a low TTL
  4. Temps automatically provisions a TLS certificate via Let's Encrypt

Rollback Plan

If something goes wrong after cutting DNS:

  1. Point your DNS back to Vercel's IP/CNAME — your Vercel deployment is still live until you delete it
  2. Investigate the issue on Temps using Project → Logs
  3. Re-deploy after fixing the issue, then cut DNS again

Keep your Vercel project active for at least 48 hours after a successful migration before removing it.


Next Steps

Was this page helpful?