DeployWise
HomeGuidesMigrate from Vercel to VPS
MigrationVercelVPSNext.jsSelf-Hosting

Migrate from Vercel to VPS: Complete Step-by-Step Guide

Move your Next.js app from Vercel to a self-hosted VPS with zero downtime. This guide covers auditing your existing setup, replacing Vercel-specific features, DNS migration, and post-migration verification.

12 min read
Updated 2026

What you need

A Next.js project currently deployed on Vercel
A VPS running Ubuntu 22.04 (Hetzner, DigitalOcean, or Vultr)
SSH access to the VPS — password or private key
Access to your domain's DNS settings
A GitHub account with your project repo
15-45 minutes depending on project complexity

Why developers leave Vercel

Vercel is an excellent platform for getting started. But as projects grow, three issues consistently push developers to self-host: unpredictable bandwidth costs that can spike to hundreds of dollars, the Hobby plan's commercial use restriction, and vendor lock-in from Vercel-specific APIs like Edge Config and KV.

A $5/month VPS gives you 20 TB of bandwidth, full SSH access, and the freedom to run any software you need. With DeployWise, the deployment experience is nearly identical to Vercel — push to GitHub, your app updates automatically.

1Audit your Vercel setup

Before migrating, document everything your Vercel project uses. Open your Vercel dashboard and check each of these:

Environment variables

Go to Settings > Environment Variables. Copy every variable — you'll need to set these on your VPS. Pay attention to which are Production vs Preview vs Development.

Serverless functions

Check the /api directory. Standard Next.js API routes work identically on a VPS. If you're using Vercel's edge runtime, note which routes use it.

Edge middleware

Check middleware.ts at the project root. If you use edge middleware for redirects, rewrites, or authentication, these will need to be adapted to run in Node.js mode.

ISR configuration

Look for revalidate settings in your pages. Incremental Static Regeneration works on a self-hosted VPS — Next.js handles it natively.

Vercel-specific features

Check for @vercel/analytics, @vercel/speed-insights, @vercel/og, @vercel/kv, or @vercel/edge-config. These need replacements.

2Choose and set up your VPS

For most Next.js apps migrating from Vercel, we recommend Hetzner CX22 ($4.51/month) or DigitalOcean Basic Droplet ($6/month). Both provide 2 vCPU, 2-4 GB RAM, and more than enough bandwidth.

ProviderPlanPriceSpecs
HetznerCX22$4.51/mo2 vCPU, 4 GB, 40 GB SSD
DigitalOceanBasic Droplet$6/mo1 vCPU, 2 GB, 50 GB SSD
VultrCloud Compute$6/mo1 vCPU, 2 GB, 50 GB SSD

Choose Ubuntu 22.04 LTS as the OS. After provisioning, make sure you can SSH in: ssh root@your-server-ip

3Install DeployWise on your VPS

Open DeployWise dashboard and sign in with GitHub. Navigate to Servers → Add Server and enter your VPS connection details.

HostYour VPS IP address
Port22 (default SSH port)
Usernameroot or your sudo user
AuthPassword or SSH private key

Click Test Connection to verify. DeployWise will automatically install Node.js (via NVM) and PM2 on your server during the first deployment.

4Configure your project

This is the most important step. You need to remove Vercel-specific code and ensure your app runs as a standard Node.js application.

Update next.config.js

Make sure your Next.js config uses the standalone output mode. This creates a self-contained build that runs without node_modules:

/** @type {import('next').NextConfig} */ const nextConfig = { output: 'standalone', } module.exports = nextConfig
Remove Vercel-specific packages

Uninstall packages that only work on Vercel and replace them:

@vercel/analytics→ Use Plausible, Umami, or PostHog
@vercel/speed-insights→ Use web-vitals library directly
@vercel/og→ Use @vercel/og alternative or satori
@vercel/kv→ Use Redis directly (ioredis)
@vercel/edge-config→ Use environment variables or a config file
Adapt edge middleware

If your middleware.ts uses Vercel-specific edge APIs, convert it to use the Node.js runtime. In most cases, adding export const runtime = 'nodejs' to your middleware file is enough. For auth middleware, NextAuth/Auth.js works identically on a VPS.

Set environment variables

In DeployWise, go to your project settings and add every environment variable from your Vercel dashboard. DeployWise stores them securely and injects them at build time and runtime, exactly like Vercel does.

5Set up DNS and SSL

To migrate without downtime, set up your VPS first, verify it works, then switch DNS.

Test on IP first

Deploy your app and verify it works by accessing your VPS IP directly on the configured port.

Update DNS records

Log into your domain registrar (Cloudflare, Namecheap, etc.) and update the A record to point to your VPS IP. If you were using Vercel's nameservers, switch back to your registrar's nameservers first.

Wait for propagation

DNS changes can take 5 minutes to 48 hours, though most propagate within 30 minutes. Use a DNS checker to monitor.

SSL auto-configures

Once DNS points to your VPS, DeployWise automatically issues a free Let's Encrypt SSL certificate via Certbot. No manual steps required.

6Deploy and verify

In DeployWise, create a new project pointing to your GitHub repo. Set the branch, build command (npm run build), start command (npm start), and click Deploy.

After deployment completes, verify these work correctly:

All pages render correctly (check SSR pages, static pages, and dynamic routes)
API routes return expected responses
Authentication flows work end-to-end
Image optimization works (Next.js built-in optimizer runs on the VPS)
ISR pages regenerate after the revalidate period
Environment variables are correctly loaded
Webhooks and external integrations still connect

7Post-migration checklist

Set up monitoring

Use a free uptime monitor like UptimeRobot or Better Stack to alert you if your app goes down. PM2 automatically restarts crashed processes, but external monitoring catches server-level issues.

Create a rollback plan

Keep your Vercel project intact for at least 2 weeks. If something goes wrong, you can switch DNS back to Vercel in minutes.

Compare performance

Run Lighthouse tests on both your Vercel deployment and VPS deployment. In most cases, a dedicated VPS has lower TTFB than serverless cold starts.

Enable auto-deploy

Turn on auto-deploy in DeployWise so that every push to your main branch triggers a new deployment automatically — the same workflow you had on Vercel.

Delete Vercel project

After 2-4 weeks of stable operation, you can safely remove the Vercel project and cancel your Vercel subscription if applicable.

Common gotchas

Build fails with 'out of memory'

Vercel gives your build process 8 GB of RAM. A small VPS might only have 1-2 GB. Add a 2 GB swap file: sudo fallocate -l 2G /swapfile && sudo mkswap /swapfile && sudo swapon /swapfile. Or use the standalone output mode to reduce build memory usage.

next/image returns 500 errors

Next.js image optimization works on a VPS, but it needs sharp installed. Run npm install sharp in your project. DeployWise handles this automatically in most cases.

Middleware doesn't work

If your middleware uses Vercel-specific edge APIs (like geolocation headers), these won't be available on a VPS. Replace with IP-based geolocation libraries or move the logic to API routes.

Cron jobs stop running

If you used Vercel Cron, set up equivalent cron jobs on your VPS using crontab. For example: */5 * * * * curl -s https://yourdomain.com/api/cron >/dev/null

What about Vercel-specific features?

Vercel Analytics

Replace with Plausible (privacy-focused, $9/mo) or Umami (free, self-hosted). Both are lightweight and don't slow down your site.

Vercel Edge Functions

Standard Next.js API routes running on your VPS handle most use cases. For global distribution, put Cloudflare in front of your VPS — the free plan includes edge caching.

Vercel Blob Storage

Use S3-compatible storage like Cloudflare R2 (free for 10 GB), Backblaze B2, or MinIO self-hosted on your VPS.

Preview Deployments

DeployWise supports branch-based deployments. Push to a preview branch and deploy it alongside your production branch on the same server.

Serverless Function Timeout

On Vercel Hobby, functions timeout at 10 seconds. On your VPS, there's no timeout — your API routes can run as long as needed.

Ready to migrate?

Sign in with GitHub, add your VPS, and move your Next.js app off Vercel in minutes — for free.

Open DeployWise Dashboard

Related guides