Hostinger extra discount codeWEBHOST2026Get my link →
H
Tutorials

Move a Next.js app from Vercel to a Hostinger VPS

10 min read

What actually changes when you leave Vercel: env vars, images, cron, storage, analytics and DNS. A migration checklist with no downtime, plus what you'll miss.

Should you move at all?

Vercel is excellent for a team that relies on per-branch preview deployments and doesn't want to run a server. People usually leave for one of three reasons: the bill grew with traffic or seats, a function hit a timeout or size limit, or they want a database and background jobs on the same machine as the app.

If one of those is you, a VPS like Hostinger's KVM 1 (Rs 2,099/mo on 24 months, 4 GB RAM) runs most Next.js apps for a flat monthly price. If none of them apply, staying on Vercel is a reasonable choice.

Step 1 — Set up the server first

Get the VPS running before you touch DNS. Follow our full guide to deploying Next.js on a Hostinger VPS for Node 24, standalone output, PM2 and Nginx. This article only covers what's different when you're coming from Vercel.

Do the whole setup on the server's IP address first. Your Vercel site stays live the entire time.

Step 2 — Bring your environment variables

Vercel stores env vars per environment. Pull the production set down with the CLI, check it, and copy it to the server. Remove anything Vercel set automatically (`VERCEL_*`) — your app shouldn't depend on those off-platform.

On your laptop, in the linked project:
bash
npx vercel env pull .env.production --environment=production

# Inspect it, delete VERCEL_* lines, then copy it up
scp .env.production deploy@YOUR_SERVER_IP:/home/deploy/app/.env.production

Step 3 — Check the Vercel-only features you use

Most of Next.js works the same under `next start`. These are the pieces that need attention:

On VercelOn your VPS
Image OptimizationWorks under `next start`. Make sure `sharp` is installed; standalone builds pick it up automatically.
ISR / revalidateWorks. The cache lives on disk in `.next`, which is fine for one server.
Middleware / proxyWorks. It runs in the same Node process.
Vercel Cron JobsReplace with a crontab entry that calls the same route (example below).
Vercel Postgres / KV / BlobThese are hosted services. Keep using them over the network, or move to Postgres/Redis on the VPS.
@vercel/analytics, Speed InsightsVercel-only. Remove them, or switch to Plausible, Umami or GA4.
Preview deploymentsNot included. Keep Vercel for previews if your team needs them.

Step 4 — Replace Vercel Cron

If `vercel.json` has a `crons` block, each entry is just a scheduled GET request to a route. Do the same with cron on the server, and protect the route with a secret so nobody else can trigger it.

`crontab -e` as the deploy user. This runs /api/cron/daily every day at 03:00 server time:
bash
0 3 * * * curl -fsS -H "Authorization: Bearer $CRON_SECRET" https://yourdomain.com/api/cron/daily > /dev/null

Step 5 — Test before switching DNS

You can request the real domain from the new server without changing DNS for anyone else. `curl --resolve` sends the request to your VPS IP while still using your domain name:

  • Click through the main pages with your hosts file pointed at the VPS.
  • Submit a form, log in, and trigger the cron route once by hand.
  • Check `pm2 logs` for errors while you do it.
bash
curl -I --resolve yourdomain.com:80:YOUR_SERVER_IP http://yourdomain.com/

Step 6 — Switch DNS with no downtime

A day before, lower the TTL on your A/CNAME records to 300 seconds so the switch spreads quickly. On the day, point the A record at the VPS IP. Once it resolves to the new server, run Certbot (or let Caddy) issue the HTTPS certificate.

Leave the Vercel project running for a couple of days. Visitors whose DNS is still cached keep landing on a working site. Once traffic in Vercel's dashboard drops to zero, remove the domain from the project.

What you'll miss

Being honest about the trade-off: no preview URL per pull request, no instant rollback button (`git checkout` the previous commit and redeploy instead), and no global edge network unless you put Cloudflare in front. You also become the person who installs security updates.

In return you get a fixed monthly bill, no function timeouts, and one machine that can run your app, database, workers and every side project at once. If that's the trade you want, coupon WEBHOST2026 applies through the links on this site.

Ready to save with coupon WEBHOST2026?

Get my discount link →

Disclosure: links to Hostinger on this page are referral links. If you buy through them we may earn a commission, at no extra cost to you. It doesn't change what we recommend. About us

Ready to claim your Hostinger discount?

Generate your personalised cart link with coupon WEBHOST2026 attached — it takes 20 seconds.