[email protected]

How-to · PaaS & Cloud Exit

Migrate Vercel to Coolify or Hetzner: Next.js Tutorial

Editorial note: This guide was written to the best of our knowledge at the time of publication. Versions, commands, features, prices and licensing terms may change through vendor updates; the current information from the respective provider applies. Please verify critical steps independently before production use. All trademarks, product names and company names mentioned belong to their respective owners. As a rule, WZ-IT is not a partner of the vendors and projects mentioned and is not officially affiliated with them; existing partnerships are stated explicitly. This text does not replace individual professional, legal or tax advice. If any information is outdated or incorrect, please write to [email protected].

Moving a Vercel application to Coolify or controlled infrastructure? WZ-IT provides Vercel migration from EUR 1,990 excluding VAT with discovery, a test environment, cutover and optional ongoing operations.

A migration from Vercel to Coolify or Hetzner is more than a new deployment. Vercel combines builds, runtime, functions, domains, environment variables, preview deployments and often additional data products. Only a complete dependency inventory shows whether the target needs one container, a Coolify project or a broader platform architecture.

Coolify and Hetzner are not alternatives at the same layer:

  • Coolify is a self-hosted deployment and application platform.
  • Hetzner is one possible provider for servers, networking and other infrastructure.
  • A common target design runs Coolify on Hetzner, but neither component requires the other.

Contents

What actually moves

Inventory the Vercel project as a complete system before choosing the target:

  • repository, framework and package manager
  • build command, output and start behaviour
  • Node.js, edge or other runtimes
  • serverless functions, middleware and cron jobs
  • environment variables for development, preview and production
  • domains, redirects, headers and DNS
  • preview deployments and branch rules
  • databases, blob storage, queues or other integrations
  • webhooks, email, OAuth and external APIs
  • logging, analytics and error tracking

Source code does not always expose every dependency. Variables, integrations and domains may live in the Vercel project without being represented fully in the repository. Export or document that configuration before the first target build.

Export Vercel variables

In the linked project, the Vercel CLI exports available production variables. Capture preview and development separately. Recreate non-exportable or sensitive values on the target; do not commit the file or copy it into the image.

vercel env pull .env.production.local --environment=production

Map Vercel capabilities to the target

Vercel layer Possible target mapping
Git deployment Coolify Git integration or an existing CI/CD pipeline
Build settings Dockerfile, Nixpacks or an explicit build process
Environment variables separate secrets and variables per environment
Serverless functions Node.js process, separate service or job
Edge functions standard server runtime or a deliberately selected edge component
Cron jobs platform scheduler, system timer or separate worker
Preview deployments dedicated staging or preview environments
Domains and TLS reverse proxy, DNS and automated certificates
Vercel data products retained external service or migrated target product
Logs and analytics central logs, metrics and error tracking

Not every feature needs an identical replacement. The required behaviour is what matters. An infrequently called function may run as a normal application endpoint, while a latency-sensitive edge function needs a separate architecture decision.

Self-host Next.js

Next.js supports self-hosting with a Node.js server or Docker container. Its official documentation recommends placing a reverse proxy in front of the Next.js process. This layer can handle TLS, request limits and protection against malformed or unwanted traffic.

One instance is often straightforward. Several instances introduce additional controls:

  • shared or consistent cache behaviour
  • identical build IDs and deployment artefacts
  • Incremental Static Regeneration behaviour
  • Server Actions and their keys
  • image optimisation and cache persistence
  • stateless sessions or a shared session store
  • controlled rolling deployments

A successful local next start is therefore an important test, but not a complete production acceptance.

Dockerfile for Next.js

Example for an npm project with a lockfile, a build script and output: "standalone" in next.config.js. Assumes an existing public/ directory. Select the base image and dependencies for the project; exclude secrets through .dockerignore and provide them at runtime. Based on the Next.js Docker example.

FROM node:24-bookworm-slim AS build
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm ci
COPY . .
RUN npm run build

FROM node:24-bookworm-slim AS runtime
WORKDIR /app
ENV NODE_ENV=production
ENV HOSTNAME=0.0.0.0
COPY --from=build --chown=node:node /app/.next/standalone ./
COPY --from=build --chown=node:node /app/.next/static ./.next/static
COPY --from=build --chown=node:node /app/public ./public
USER node
EXPOSE 3000
CMD ["node", "server.js"]

The Next.js introduction covers the deployment context.

Use Coolify as the target platform

Coolify setup and operations; Hetzner is an infrastructure option.

Coolify can combine repository, build, deployment, environment variables, domains, TLS and health checks in a self-hosted interface. Depending on the application, it uses an existing Dockerfile or builds from source.

Define before production:

  • which branch triggers production
  • whether staging uses a separate branch or project
  • which variables apply to each environment
  • which health check confirms a successful rollout
  • how long old deployments remain available for rollback
  • where logs, metrics and alerts are collected
  • which persistent paths require backups

Coolify reduces operational interaction, but it does not automatically assume responsibility for the host, backups, security, capacity or recovery. Those layers remain part of the operating model.

Data, storage and external services

The application may continue using external databases or storage. A complete cloud exit requires an explicit decision for each dependency:

  1. Retain it: only the application moves at first.
  2. Migrate in parallel: application and data service move in one project with separate rehearsals.
  3. Replace it later: the initial cutover stays smaller and the data move becomes another phase.

For databases, assess version, extensions, roles, connection limits, pooling, backups and latency. Object storage adds bucket rules, URLs, metadata, object counts and checksums. Write traffic during cutover needs a clear freeze, final sync or suitable replication method.

When Vercel only serves the frontend and Supabase provides the backend, both paths can be planned separately. The Supabase migration checklist covers the backend move.

PostgreSQL: dump and restore

Example rehearsal into a prepared, empty target database. Check versions, extensions and roles first; supply credentials securely through .pgpass. A dump is a consistent snapshot and does not replicate subsequent writes. Plan a write freeze or replication for the final cutover. See pg_dump and pg_restore.

pg_dump --host=source.example --username=migration --dbname=app --format=custom --file=app.dump
pg_restore --host=target.example --username=migration --dbname=app --no-owner --no-privileges app.dump

Staging, previews and CI/CD

The customer can keep developing normally after the move: a push triggers the agreed build and deploys the change under the target rules. The delivery path now runs on the selected platform.

A common separation is:

  • Development: local or personal development environment
  • Staging: stable test environment with separate variables and test data
  • Production: production environment with approval, monitoring and backups
  • Preview: optional short-lived environment per pull request

Preview deployments are not free of operational design. They need rules for database access, secrets, cost and cleanup. A preview must not be able to change production data accidentally.

Rehearsal and cutover

Run the target under a test domain first. Acceptance covers at least:

  • build and reproducible startup
  • health check and restart behaviour
  • login and critical user journeys
  • uploads and background jobs
  • email, webhooks and external APIs
  • caching and dynamic pages
  • logs, metrics and alerting
  • backup and a defined recovery path

Set DNS TTL, maintenance window, owners and rollback point before switching. Keep the old Vercel deployment unchanged until the agreed rollback window ends, where application and data design allow it.

Lower the DNS TTL before switching, for example to 300 seconds where supported by the DNS provider. Let the previous TTL expire before cutover; resolver caches may still delay the change. No domain transfer is required.

Privacy and data location when migrating

A migration changes processors, subprocessors and data paths. A confirmed German target location can keep the application and database in Germany; external services, administration, backups and telemetry require separate review. Third-country transfers disappear only where no corresponding recipients or access remain. The data protection officer should review contracts, technical measures and remaining transfers. This is not a blanket legal assessment of Vercel. Relevant sources include Vercel’s processing terms and the EU data protection rules. The Coolify v4 article discusses data location and costs.

When another target architecture fits better

Coolify suits one or more containerisable applications with Git-based deployments. Another architecture may fit better when:

  • multi-node scheduling is required
  • several teams, granular policies or standard platform APIs are needed
  • the product relies heavily on edge computing
  • very low global latency is a central feature
  • complex event, queue or data platforms belong to the system
  • selected managed services should deliberately remain

Kubernetes, a separate data platform or a hybrid transition may then be appropriate. Use the PaaS exit checklist to define target and sequence before implementation. Where the target architecture remains open, the PaaS Exit Review provides a sound decision and migration basis. For other sources, the Railway, Render and Fly.io comparison explains the platform-specific differences.

The Vercel cost breakdown separates seats, CDN, image optimisation and Functions before migration.

Sources

Rather have it operated?

You'd rather not run PaaS & Cloud Exit yourself? WZ-IT handles setup, operations and maintenance - privacy-focused from Germany.

Enquiry

Assess a PaaS migration

Describe the source, application and intended target. We assess the migration path for runtime, data, delivery and ongoing operations.

  • You speak directly with Timo and Robin, who are technically responsible
  • A professional assessment of your situation
  • Concrete next steps for infrastructure, software or AI

The conversation is free and non-binding.

I recently worked with Timo and the WZ-IT team, and honestly, it turned out to be one of the best tech decisions I have made for my business. Right from the start, Timo took the time to walk me through every step in a simple and calm way. No matter how many questions I had, he never rushed me. The results speak for themselves. With WZ-IT, we reduced our monthly expenses from $1,300 down to $250. This was a huge win for us.
Aleksandr ShulikoCTO, EVA Real Estate
Timo and Robin, founders of WZ-IT

Assess a PaaS migration

I recently worked with Timo and the WZ-IT team, and honestly, it turned out to be one of the best tech decisions I have made for my business. Right from the start, Timo took the time to walk me through every step in a simple and calm way. No matter how many questions I had, he never rushed me. The results speak for themselves. With WZ-IT, we reduced our monthly expenses from $1,300 down to $250. This was a huge win for us.
Aleksandr ShulikoCTO, EVA Real Estate

Frequently Asked Questions

Answers to the most important questions

Customers from mid-sized business, industry and the public sector, in Germany and internationally

Read client reviews