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 Feature | Replacement |
|---|---|
| Vercel KV | Redis (self-hosted or Upstash) |
| Vercel Postgres | Any PostgreSQL (Neon, Supabase, self-hosted) |
| Vercel Blob | S3-compatible storage (Cloudflare R2, MinIO) |
@vercel/analytics | Temps Analytics (built-in, zero config) |
| Speed Insights | Temps monitoring (built-in) |
| Edge Runtime | Node.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:
- Open the Temps console and go to Projects → New Project
- Select your repository and the
mainbranch - 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
- Go to Project → Settings → Domains → Add Domain in the Temps console
- Temps shows the DNS records to add (A record or CNAME)
- Update your DNS registrar — propagation typically takes 1–5 minutes with a low TTL
- Temps automatically provisions a TLS certificate via Let's Encrypt
Set your DNS TTL to 60 seconds a few hours before cutting over. This limits how long any cached records point to Vercel during the transition.
Rollback Plan
If something goes wrong after cutting DNS:
- Point your DNS back to Vercel's IP/CNAME — your Vercel deployment is still live until you delete it
- Investigate the issue on Temps using Project → Logs
- 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.