Vercel's free tier is generous until you run background jobs, need persistent file storage, want WebSocket support, or your traffic crosses their soft limits. Then you're looking at $20/month minimums that scale uncomfortably fast.
Coolify is an open-source Heroku/Netlify/Vercel alternative you self-host on any VPS. One $6/month Hetzner CAX11 has run 8 full-stack apps in my production setup for 4 months without hitting resource limits.
What Coolify Does
- Git-push deployments (GitHub, GitLab, Gitea)
- Docker-based or Nixpacks buildpacks (auto-detects Next.js, Astro, Bun, etc.)
- PostgreSQL, MySQL, Redis, MongoDB with one-click provisioning
- SSL via Let's Encrypt (auto-renews)
- Environment variable management per app
- Preview deployments on pull requests
- Cron jobs
- SSH key management
- Resource monitoring (CPU, RAM, disk per service)
Server Setup (5 Minutes)
# On a fresh Ubuntu 22.04 VPS (Hetzner, DigitalOcean, Vultr, etc.)
curl -fsSL https://cdn.coollabs.io/coolify/install.sh | bash
This installs Docker, Docker Compose, and the Coolify stack. Open http://your-ip:8000 to complete setup.
Minimum spec: 2 CPU, 2GB RAM. The $6 Hetzner CAX11 (2 ARM cores, 4GB RAM) handles this fine.
Deploying a Next.js App
- Connect your GitHub account in Coolify
- New Resource → Application → Select repo
- Coolify detects Next.js and configures Nixpacks automatically
- Set environment variables
- Set your custom domain
- Deploy
Deploy logs stream in the UI. Typical Next.js cold build: 90-120 seconds.
Environment Variables
Coolify handles secrets securely — they're encrypted at rest and injected at build time or runtime depending on your config.
# Set in Coolify dashboard, not in your repo
NEXT_PUBLIC_APP_URL=https://myapp.com
DATABASE_URL=postgresql://...
STRIPE_SECRET_KEY=sk_live_...
ANTHROPIC_API_KEY=sk-ant-...
Sensitive keys never touch your git history.
One-Click Postgres + Redis
In the Coolify dashboard:
- New Resource → Database → PostgreSQL 16
- Coolify provisions a containerized Postgres with a generated password
- Connection string injected as
DATABASE_URLinto any app you link it to
Same for Redis. No manual Docker network configuration.
Preview Deployments
# In your GitHub repo: .github/workflows/coolify-pr.yml
# Not needed — Coolify handles this natively via webhook
In Coolify settings, enable "Preview Deployments" on your app. Every PR gets its own subdomain: pr-42.myapp.coolify.yourdomain.com with its own environment.
This is the feature that makes Coolify genuinely compete with Vercel for team workflows.
Deploying a Bun + Elysia Backend
Coolify doesn't have a native Elysia buildpack, but Nixpacks detects Bun automatically:
# Or use a Dockerfile for full control
FROM oven/bun:1
WORKDIR /app
COPY package.json bun.lockb ./
RUN bun install --frozen-lockfile
COPY . .
EXPOSE 3000
CMD ["bun", "run", "src/index.ts"]
Coolify builds and runs the container, handles reverse proxying via Traefik, and provides the SSL cert.
Cron Jobs
New Resource → Cron Job
Schedule: 0 9 * * *
Command: cd /app && node scripts/send-digest.js
No separate cron server needed. Runs inside a container on your VPS.
Cost Comparison
| Setup | Cost | Apps | Limitations |
|---|---|---|---|
| Vercel Pro | $20/mo | Unlimited | 60s functions, no persistent FS |
| Railway | ~$10-40/mo | Usage-based | Per-service billing |
| Coolify on Hetzner CAX11 | $6/mo | ~8 full-stack | You manage the VPS |
| Coolify on Hetzner CX32 | $14/mo | ~20+ apps | More RAM/CPU |
The tradeoff is ops responsibility. You handle VPS security patches and backups. Coolify's automated backups to S3 cover the database side.
What Coolify Doesn't Replace
- Edge functions — Coolify runs in one region. Use Cloudflare Workers for true edge.
-
Vercel's image optimization —
next/imageoptimization works but you're responsible for the compute. - Managed databases at scale — Neon or PlanetScale are better choices beyond 10GB.
- DDoS mitigation — Put Cloudflare in front.
The Setup That Works
My current stack:
- Coolify on Hetzner CX32 ($14/mo) — all apps
- Cloudflare in front (free plan) — CDN + DDoS
- Neon for production Postgres — branch-per-PR
- Backblaze B2 for S3-compatible storage ($0.006/GB)
All-in cost for 6 apps: ~$25/month.
Deploying a SaaS without Vercel bills? The AI SaaS Starter Kit includes a Coolify-ready Dockerfile and deployment guide — ship to your own VPS with full Stripe + Claude integration on day one.
Top comments (0)