Blog

Tutorials, guides and product news.

Developers

Moving a Next.js app from Vercel to your own server

2 November 2026 6 min read
Share this post

To move a Next.js app from Vercel to your own server, connect the same GitHub repository to the Coolify panel on the server, copy the environment variables, replace the Vercel-specific parts (cron, analytics, storage), test on a temporary address and switch your domain's A record last. The Next.js docs say all features work on a Node.js server. Your Vercel deployment stays up until you switch, so you have a way back.

Really, this is a choice of billing model. Vercel's docs explain that infrastructure is billed by data transferred, requests and compute duration. A server costs a fixed monthly fee for the RAM, CPU and disk you choose. Our comparison shows how to run your own numbers.

What changes when you move?

TopicVercelYour server
BillingBy usageFixed monthly, unlimited traffic, daily backups included in the price
LocationGlobal delivery networkOne server, in Istanbul
Traffic spikesThe platform absorbs them and the bill growsThe site slows when capacity runs out, and you scale up
BuildsOn the platform's machinesOn the same server, so builds set the memory you need
MaintenanceThe platform's jobOS updates, package updates and monitoring are yours, as is root access
PreviewsAutomatic for branchesEnabled separately in Coolify
Network securityVercel FirewallYou manage the server's firewall

To be plain: there's one server, no worldwide edge delivery, and maintenance becomes yours. Who won't mind? If your visitors are mostly in Turkey and nearby countries, one location is fine. If your pages all read from a single database, responses wait on that database wherever the code runs. Dashboards, internal tools and products with predictable traffic rarely need automatic scaling. If your audience is spread worldwide, your traffic spikes hard, or you never want to touch maintenance, Vercel may be the better fit.

Prepare the new server

  1. Order from the Next.js VPS page. The server comes with Coolify.
  2. Connect the repository. The short way: open the project in Claude Code or Cursor, paste the Paste into your AI tool row from the Overview tab, and the tool deploys it. You can also do it by hand.
  3. Pin your Node version with engines.node in package.json.
  4. Pull your variables: vercel env pull .env.move --environment=production. Secret values can't be read back, so the CLI writes placeholders and you get those from their source. Keep the file out of the repository and enter its contents under Environment Variables in Coolify, with NEXT_PUBLIC_ values available at build time.
  5. Search for Vercel-specific code: grep -n "@vercel/" package.json and grep -rnE "VERCEL_|x-vercel-" app src. System variables such as VERCEL_URL don't exist on your server, so use your own.

Next.js features and Vercel-specific parts

PartOn your serverWhat to do
Image optimizationWorks with next start, no setupIt uses your server's CPU and memory
ISR and cachingWork by themselves on one instance with a local diskSeveral instances must share the cache, and it refills after each deploy
Middleware (Proxy in Next.js 16)Works with next start, no setupRequests are now handled in Istanbul
Cron jobsvercel.json isn't readCall the same path from Scheduled Tasks in Coolify: curl -fsS -H "Authorization: Bearer $CRON_SECRET" http://localhost:3000/api/cron. Vercel cron runs on UTC, while Coolify uses the server's timezone
Redirects and headersvercel.json isn't readMove them to next.config
Web Analytics, Speed InsightsRely on routes Vercel adds to a deploymentRemove the components and use a tool such as Umami
AI GatewayCallable from any serverSet AI_GATEWAY_API_KEY

What about Postgres, KV and Blob?

  • Postgres and KV: Vercel's docs say these products are gone and older databases moved to Marketplace providers, so your data sits with a separate provider behind an environment variable. Carry that over and the app reaches the same database. If billing runs through your Vercel account, take your data before closing it. A distant database adds that distance to every query.
  • Moving it to your server: Create PostgreSQL in Coolify, export with pg_dump -Fc "OLD-DATABASE-URL" --no-owner --no-privileges -f backup.dump, and upload the archive with Import backup on the database's Backups page. If Redis is only a cache, starting empty is usually fine.
  • Blob: BLOB_READ_WRITE_TOKEN also works from another host, so you can leave it alone. To bring files onto your server, change the code and mount the folder with Persistent Storage.

Moving your domain without downtime

  1. Test on the HTTPS address Coolify gives you: sign-in, forms, payments, images, and Execute now for cron.
  2. dig NS example.com +short shows where your records live: Vercel's Domains page if it lists Vercel's nameservers, otherwise your DNS provider.
  3. Lower the TTL on the root and www records, to 300 seconds for example, and wait for the old TTL to pass.
  4. If the database is moving too, stop writes and load the final copy.
  5. Point the A record at the server's IP address. Leave MX and TXT records alone for email.
  6. Add the domain with https on the Domains page in Coolify and press Redeploy. The certificate is issued automatically.
  7. Keep the Vercel deployment up for a few days. Visitors with the old record cached land there, and you can point the record back if needed.
  8. Once traffic has moved, remove the domain from the Vercel project, cut the Git connection with Disconnect, and restore the TTL.

The certificate is only issued after the domain points at the server, so early visitors may see a brief certificate warning. Switch during a quiet hour.

Frequently asked questions

What size should I start with?

The sales page recommends at least 4 GB of RAM, 2 vCores and 40 GB of disk. A small project built on 2 GB, while one with 85 packages ran out of memory at 2 GB and built at 4 GB. You can scale up from your panel.

What will it cost per month?

That size is about $6 a month (VAT included), and outside Turkey you pay in US dollars. Traffic is unlimited.

Do I have to transfer a domain I bought from Vercel?

No. Vercel's docs treat registration and DNS as separate. Changing the A record at Vercel is enough, and your record overrides the default ones.

How do updates work after the move?

With a webhook, git push builds and publishes each version. If one goes wrong, Coolify's Rollback page returns you to an earlier image.

Can I move without moving the database?

Yes, and it's the lowest-risk order. Move the app first and the database later.

Ready-made on Seturack: Next.js, Coolify.

Comments0

No Comments Yet

Be the first to share your thoughts.

Join the Discussion

Please sign in or sign up to leave a comment.

Never Miss a Post

Get our latest tutorials, guides and product news in your inbox.

You're subscribed to our newsletter.