A Hetzner CX22 server costs $4.50/month. Coolify is free and open-source. Between them, you get git-push deploys, automatic SSL, preview environments, and a built-in database manager: everything Vercel gives you, for a fraction of the cost. The tradeoff is that you now own the server.
This is for teams whose Vercel bill has grown past what makes sense, or for founders who want predictable costs from day one. If you need specific Vercel features like Edge Middleware, AI SDK streaming, or Vercel Analytics, this guide is not for you. If you just need a fast Next.js deployment that works reliably, keep reading.
Step 1: Get a VPS
For a small Next.js app, the Hetzner CX22 (2 vCPU, 4GB RAM) handles dozens of concurrent users comfortably. Coolify requires a minimum of 2GB RAM, so do not go smaller.
Alternatives: DigitalOcean Droplet ($12/month for 2GB), Vultr, Linode. Hetzner is the best price-to-performance option for European and Middle East traffic. Choose a server region near your users.
Create the server with Ubuntu 22.04 or 24.04. Note the public IP address.
Step 2: Install Coolify
SSH into your new server and run the Coolify installation script:
# SSH into your server
ssh root@your-server-ip
# Install Coolify
curl -fsSL https://cdn.coollabs.io/coolify/install.sh | bashThe installer handles Docker, Docker Compose, and Coolify itself. It takes about 3-5 minutes. When it finishes, Coolify is accessible at http://your-server-ip:8000.
Create your admin account on first access. Set a strong password. This dashboard controls your entire server.
Step 3: Point a domain at Coolify
Set an A record for your domain pointing to the server IP. You also want to set a wildcard A record (*.yourdomain.com) for preview environments. Most registrars support wildcard records.
In Coolify, go to Settings → Instance and set your domain. Coolify handles SSL certificates automatically via Let's Encrypt once DNS propagates.
Step 4: Connect your Git repository
In Coolify, go to Sources and add your GitHub, GitLab, or Bitbucket account. You will create a GitHub App (or use a personal access token) that gives Coolify read access to your repositories and the ability to receive webhook events.
Step 5: Create your Next.js application
In Coolify, click New Resource → Application → select your Git source → pick your repository. Coolify detects Next.js and offers to use Nixpacks (no Dockerfile needed) or a custom Dockerfile.
Nixpacks works for most standard Next.js apps. If you have specific build requirements, add a Dockerfile to your project:
# Dockerfile for a standard Next.js app
FROM node:20-alpine AS builder
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build
FROM node:20-alpine AS runner
WORKDIR /app
ENV NODE_ENV=production
COPY --from=builder /app/.next/standalone ./
COPY --from=builder /app/.next/static ./.next/static
COPY --from=builder /app/public ./public
EXPOSE 3000
ENV PORT=3000
CMD ["node", "server.js"]If you use the standalone output in your Dockerfile, make sure to enable it innext.config.js:
// next.config.js
module.exports = {
output: 'standalone',
}Step 6: Set environment variables
In the application settings in Coolify, add your environment variables under the Environment Variables tab. These are injected at runtime and never exposed in your repository.
Set your domain in the application configuration. Coolify automatically provisions an SSL certificate and configures Caddy (the built-in reverse proxy) to serve your app over HTTPS.
What you get vs Vercel
| Feature | Coolify on VPS | Vercel Pro |
|---|---|---|
| Monthly cost (3-person team) | ~$5-10 | $60+ |
| Git-push deploys | Yes | Yes |
| Automatic SSL | Yes (Let's Encrypt) | Yes |
| Preview environments | Yes (per branch) | Yes (per branch) |
| Edge Middleware | No | Yes |
| Analytics | Basic (self-hosted) | Paid addon |
| Server control | Full | None |
| Data residency | Your choice of region | Vercel's infrastructure |
The maintenance cost
The honest tradeoff: you now manage the server. That means applying OS updates, monitoring disk space, and being responsible for uptime. Coolify handles its own updates automatically, but the underlying server is yours.
For most small teams shipping a web app: 30 minutes per month of server maintenance in exchange for $50+/month in cost savings is a good trade. If even that overhead is too much, Vercel is still the right choice.
$ setup --coolify-vps
If you want this done without going through it yourself, I can set up the server, install Coolify, configure your app, and hand you the keys.
$ ./request-devops-help.sh →