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

  1. 1

    Open your project in the Vercel Dashboard.

  2. 2

    Go to Settings then Environment Variables.

  3. 3

    Download the variables so you can import them into Temps.

# 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

  1. 1

    Go to Projects then click New Project.

  2. 2

    Select your repository and the main branch.

  3. 3

    Click Deploy — Temps auto-detects Next.js and sets the build and start commands.

# 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. 1

    Open Project then Settings then Domains and click Add Domain.

  2. 2

    Temps shows the DNS records to add (an A record or CNAME).

  3. 3

    Update your DNS registrar — propagation takes 1–5 minutes at a TTL of 60 seconds or less.

  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 takes 1–5 minutes when your TTL is 60 seconds or less
  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.

Was this page helpful?