TECHDAUR
Home/Software & Web Tech•2026-11-12T11:00:00+05:00•5 min read

Coolify vs Vercel: Self-Host Next.js on Hetzner VPS (2026)

Coolify on a Hetzner VPS turns flat monthly hosting into a self-hosted Vercel alternative for Next.js, with Git deploys, SSL and local databases.

Jawad Ahmad Almas
By Jawad Ahmad Almas
Founder & Lead Tech Editor
Share:
Coolify vs Vercel: Self-Host Next.js on Hetzner VPS (2026)
ADVERTISEMENT

Key Takeaways

  • •Coolify v4 gives developers Git-push previews, automated Let's Encrypt SSL, Docker orchestration, and managed PostgreSQL/Redis on raw VPS hardware with zero per-seat fees.
  • •Pairing Coolify with a Hetzner CAX21/CX23 VPS (~$6 to $12/month including IPv4) includes 20 TB of outbound monthly traffic, saving teams money versus Vercel Pro ($20/seat plus bandwidth overages).
  • •Persistent Docker containers eliminate serverless execution timeout caps, making Coolify dramatically better for long-running AI agent SSE streams, WebSockets, and background queues.
  • •Configuring Next.js with output: 'standalone' alongside a 3-stage node:20-alpine Dockerfile keeps production container images small with fast container restarts.

Why Developers Are Leaving Usage-Based PaaS Pricing in 2026

Managed cloud platforms spoiled web engineers with effortless Git-push deployments, but usage-based billing has turned growth into a financial hazard. Once your Next.js application moves past a personal hobby tier, adding just three developers on Vercel Pro costs $60/month before serving a single byte of traffic—and viral traffic spikes, unoptimized images, or runaway SSR bots trigger painful bandwidth overage invoices. (Vercel Pro pricing) Similarly to how homelab builders are reclaiming storage rent using self-hosted Immich vs Google Photos, backend teams are moving production SaaS stacks onto Coolify v4 + Hetzner Cloud.

ADVERTISEMENT

Coolify v4 vs Vercel Pro: Real-World Cost & Architecture Matrix

Here is how a single mid-tier Hetzner Cloud VPS running Coolify compares directly against a 3-person commercial team deployment on Vercel Pro across monthly fixed costs, bandwidth allowances, AI streaming durability, and database colocation:

textSnippet
Metric / Capability        | Vercel Pro (3-Seat Team)     | Coolify v4 + Hetzner (CAX21/CX23)
---------------------------+------------------------------+-----------------------------------
Base Monthly Cost          | $60/mo ($20 x 3 seats)       | ~$7 - $12/mo flat (VAT excl.)
Included Bandwidth         | 1 TB pooled (+$150/TB extra) | 20 TB included outbound traffic
Team Collaborators         | $20/mo per additional seat   | Unlimited ($0 open-source)
Postgres & Redis Hosting   | External (Neon / Upstash)    | Co-located Docker containers ($0)
Function Execution Timeout | Capped (Fluid/Pro tiers)     | Unlimited (Persistent Node server)
Cold Starts                | Low (Serverless warm pools)  | None (Always-running container)
Global Edge Asset CDN      | Built-in                     | Free via Cloudflare DNS/CDN Proxy

The AI Streaming & Long-Running Agent Advantage

Modern Next.js applications rarely serve static CRUD forms anymore—they orchestrate multi-step LLM chains, Playwright scrapers, webhook ingestion queues, and real-time voice/text streams. (Hetzner traffic allowances) Serverless edge runtimes penalize open HTTP connections that wait 45 seconds for a reasoning model to finish its chain-of-thought. On Coolify, your Next.js server executes inside an always-warm Docker container connected to local Redis and Postgres over a private loopback bridge—keeping database query latency very low over the local loopback connection while streaming AI payloads without timeout disconnects. If you deploy API-heavy products, estimate your inference budget alongside infrastructure savings using our AI Token & API Cost Calculator.

Step 1: Provision & Install Coolify v4 on a Hetzner VPS

Spin up an Ubuntu 24.04 LTS instance on Hetzner (either a 4 vCPU / 8GB ARM64 CAX21 or x86 CX23 depending on your Docker image needs) with SSH key authentication enabled. (Coolify documentation) Once connected as root, enforce minimal firewall rules and run Coolify's official installer. Make sure you point a wildcard subdomain (*.apps.yourdomain.com) via Cloudflare to the server IP before exposing the Coolify dashboard on port 8000.

Important NoticeDo not leave port 8000 exposed over plain HTTP permanently. Inside Coolify Settings, assign a subdomain (like panel.yourdomain.com), let Traefik issue a free Let's Encrypt TLS certificate, and immediately close port 8000 in UFW.
bashSnippet
# 1. Update Ubuntu 24.04 packages and harden basic firewall
apt update && apt upgrade -y
ufw allow OpenSSH
ufw allow 80/tcp
ufw allow 443/tcp
# Temporarily allow 8000 ONLY during initial setup, then close it behind your domain
ufw allow 8000/tcp
ufw --force enable

# 2. Install Coolify v4 (Installs Docker, Traefik reverse proxy & control plane)
curl -fsSL https://cdn.coollabs.io/install.sh | sudo bash

# 3. Once you configure a custom HTTPS domain inside Coolify Settings -> Instance,
# close raw port 8000 on the host firewall:
# ufw delete allow 8000/tcp && ufw reload

Step 2: Optimize Next.js with Output Standalone & Multi-Stage Dockerfile

By default, Nixpacks builds large container images that include the entire Next.js build cache and devDependencies, chewing through precious VPS RAM during builds. (Next.js standalone output) Instead, enable standalone output tracing in next.config.ts (output: 'standalone') and switch Coolify's Build Pack to Dockerfile. This multi-stage pattern compiles inside a temporary stage and copies only the trimmed .next/standalone bundle into a small non-root Alpine runner image.

dockerfileSnippet
# syntax=docker/dockerfile:1
FROM node:20-alpine AS deps
RUN apk add --no-cache libc6-compat
WORKDIR /app
COPY package.json package-lock.json* ./
RUN npm ci

FROM node:20-alpine AS builder
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .
ENV NEXT_TELEMETRY_DISABLED=1
RUN npm run build

FROM node:20-alpine AS runner
WORKDIR /app
ENV NODE_ENV=production
ENV NEXT_TELEMETRY_DISABLED=1

RUN addgroup --system --gid 1001 nodejs && adduser --system --uid 1001 nextjs
COPY --from=builder /app/public ./public
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static

USER nextjs
EXPOSE 3000
ENV PORT=3000
ENV HOSTNAME="0.0.0.0"
CMD ["node", "server.js"]

Solving Global Latency & Backups: Cloudflare Edge + S3 Offsite Snapshots

The only structural area where Vercel beats a single Hetzner node out-of-the-box is multi-region edge distribution for static assets. Putting Cloudflare's free CDN proxy in front of your Coolify origin closes that gap in five minutes: static JS chunks, optimized images, and immutable CSS bundles cache across 300+ global edge PoPs while only dynamic SSR and API mutations reach Hetzner. Finally, configure Coolify's built-in S3 backup scheduler inside your PostgreSQL resource to dump encrypted nightly snapshots to Backblaze B2 or Cloudflare R2—and pair this setup with our guide to fixing Cloudflare human-loop and WAF edge rules so automated webhooks never get blocked.

Frequently Asked Questions

How much RAM does Coolify need on a Hetzner VPS to build Next.js apps smoothly?

While Coolify itself uses a modest amount of RAM when idle, running 'next build' inside Docker requires peak memory spikes of 2 to 3 GB. A 4 GB RAM VPS works cleanly if you configure a 2 GB Linux swapfile, while an 8 GB RAM Hetzner node (CAX21/CX32) handles concurrent Next.js builds plus Postgres and Redis comfortably.

Does Coolify support zero-downtime deployments when pushing to GitHub?

Yes. Coolify configures Traefik healthchecks on port 3000, builds the new container alongside the running instance, waits until the new container responds cleanly to HTTP checks, swaps incoming traffic without dropping connections, and gracefully drains the old container.

Should I pick Hetzner ARM64 (CAX) or x86 (CX) for Coolify?

If you run modern Node.js, Next.js, Go, Postgres, or Redis containers, Hetzner's ARM64 Ampere nodes (CAX11/CAX21) deliver more vCPU performance per dollar than x86 instances. Choose x86 only if you depend on closed-source x86-only binaries or legacy Chromium packages.

Can I still use preview deployments for GitHub pull requests?

Yes! By linking a GitHub App inside Coolify's Sources menu, Coolify automatically deploys ephemeral preview URLs for every pull request branch and tears down the containers automatically when the PR merges.

Jawad Ahmad Almas
Founder & Lead Tech Editor

Jawad Ahmad Almas

Tech entrepreneur, full-stack web developer, and digital strategist with over 5 years of experience in modern CMS architectures, AI-driven content generation, and UI/UX design. Founder of TechDaur and jawadalmas.store, dedicated to auditing frontier LLMs, hardware benchmarks, and publisher monetization playbooks.

More from TechDaur

TechDaur Intelligence

Stay Ahead in Tech & AI

Join developers, engineers, and creators. Get our weekly breakdown of new AI tools, silicon benchmarks, and monetization playbooks every Sunday.

Zero spam. Unsubscribe at any time with a single click.