Why I switched from Heroku
Had a few side projects running on Heroku. Nothing massive - a couple of Node.js apps, a Python API, a static site. Was paying like $50/month for the privilege.
Looked at the bill and thought "this is ridiculous". I already have a VPS that costs $5/month. Why am I paying Heroku 10x that for worse performance?
Problem was, setting up deployments on bare VPS is annoying. Docker compose, SSL certificates, reverse proxy, auto-restarts - lots of moving parts.
Then found Coolify. Open source, self-hosted PaaS. Give it a GitHub repo, it handles the rest. Basically Heroku but on your own server.
What I'm saving now
Heroku: $50-100/month depending on apps
Coolify on my own VPS: $5/month
Saved: $45-95/month
And I get better performance, more control, and can deploy unlimited apps.
So what is Coolify
Coolify is an open-source PaaS (Platform as a Service) that you run on your own server. Think of it as a self-hosted Heroku, Vercel, or Netlify all in one.
What it does:
- Connects to GitHub: Push code, it auto-deploys
- Handles Docker: Builds containers from your code
- SSL certificates: Auto-generates HTTPS with Let's Encrypt
- Databases: One-click PostgreSQL, MySQL, MongoDB, Redis
- Static sites: Deploy Next.js, Vite, Hugo with zero config
- Preview deployments: Automatic preview URLs for pull requests
- Auto-scaling: Scales resources based on needs
- Multiple servers: Deploy to different VPS from one dashboard
Why it's better than rolling your own:
- Web UI instead of editing YAML files
- Handles all the networking stuff automatically
- Built-in monitoring and logs
- Team collaboration with role-based access
- Updates itself with one click
It's not just for deployment - it manages the whole lifecycle. Databases, cron jobs, background workers, SSL - everything in one place.
Getting Coolify running
Prerequisites
You'll need:
- A VPS (DigitalOcean, Hetzner, Linode - whatever)
- Ubuntu 20.04+ or Debian 11+ (other distros work but these are tested)
- At least 2GB RAM (4GB recommended)
- A domain name pointed to your server
- Basic knowledge of SSH and terminal
One-line install
Easiest way - run their install script:
curl -fsSL https://cdn.coollabs.io/coolify/install.sh | bash
That's literally it. It installs Docker, Coolify, and everything needed.
Manual install (if you prefer)
# Install Docker
curl -fsSL https://get.docker.com | sh
# Clone Coolify
git clone https://github.com/coollabsio/coolify.git
cd coolify
# Copy environment file
cp .env.example .env
# Edit .env and set your domain
# APP_URL=https://coolify.your-domain.com
# Start it
docker compose up -d
First setup
Go to your domain, create an admin account, connect your GitHub/GitLab. Done.
The whole process takes maybe 10 minutes. Most of that is DNS propagating.
Deploying your first app
From GitHub
Simplest workflow:
# 1. Push your code to GitHub
git push origin main
# 2. In Coolify, click "New Resource"
# 3. Select "From GitHub"
# 4. Choose your repo
# 5. Click "Deploy"
# Coolify detects your stack (Node, Python, etc.)
# Builds it, runs it on a subdomain
# https://your-app.coolify.your-domain.com
With configuration
Most apps need some config:
# coolify.yaml in your repo root
version: "1.0"
services:
- name: "my-app"
type: "dockerfile"
build:
context: .
dockerfile: Dockerfile
ports:
- 3000:3000
environment:
- NODE_ENV=production
- DATABASE_URL=${DATABASE_URL}
databases:
- type: "postgresql"
name: "my-db"
Or just use the web UI to set environment variables. Either works.
Different app types
**Node.js app:**
# Just push your repo
# Coolify detects package.json
# Runs npm install, npm build, npm start automatically
**Python app:**
# Add requirements.txt
# Coolify runs pip install
# Set your start command: python app.py or gunicorn app:app
**Static site (Next.js, Vite, Hugo):**
# Select "Static Site" as type
# Coolify builds and serves via nginx
# Auto-optimizes assets
**Dockerfile:**
# Put Dockerfile in repo
# Coolify builds image from it
# All the flexibility of Docker, none of the deployment headache
Custom domains
Point any domain to your app:
# In Coolify dashboard:
# 1. Go to your app
# 2. Click "Domains"
# 3. Add custom domain: app.yourdomain.com
# 4. Point DNS to your server
# 5. Coolify handles SSL automatically
Managing databases
This is where Coolify really shines compared to DIY deployment.
One-click databases
# In Coolify, click "New Resource" → "Database"
# Choose: PostgreSQL, MySQL, MongoDB, Redis
# That's it.
# It creates the database, exposes it internally
# Auto-backups, SSL, connection strings ready
Connecting apps to databases
# In your app settings, link the database
# Coolify sets DATABASE_URL automatically
# Or copy connection string from database settings
# Format: postgresql://user:pass@db:5432/dbname
Backups
Built-in automated backups:
# Database → Settings → Backups
# Enable auto-backups (daily/weekly)
# Store on S3 or locally
# One-click restore when needed
Stuff I deploy on Coolify
Next.js app with PostgreSQL
Full-stack app with database:
# 1. Create PostgreSQL database in Coolify
# 2. Deploy Next.js app from GitHub
# 3. Link database to app
# 4. Set DATABASE_URL env var
# 5. Build completes, app is live
# Preview deployments for every PR
# Production deploy on main branch merge
Python API with Redis
FastAPI with caching:
# Coolfile in repo
version: "1.0"
services:
- name: "api"
type: "dockerfile"
ports:
- 8000:8000
environment:
- REDIS_URL=${REDIS_URL}
resources:
- type: "redis"
name: "cache"
Multiple static sites
Blogs, docs, landing pages:
# Deploy Hugo blog
# Deploy Vite docs site
# Deploy Next.js marketing site
# All on one $5 VPS
# With automatic SSL and CDN
Background workers
Separate worker processes:
# Main app handles web requests
# Worker processes jobs in background
# In Coolify, deploy same repo twice
# One as "web", one as "worker"
# Different start commands, share database
Advanced stuff
Multiple servers
Deploy to different VPS from one dashboard:
# Add new server in Coolify
# Run install script on second VPS
# It appears in dashboard
# Deploy apps to whichever server has capacity
# I have: Hetzner (cheap, EU), DigitalOcean (backup, US)
Resource limits
Prevent one app from hogging everything:
# App Settings → Resources
# Set CPU and memory limits
# Example: 0.5 CPU, 512MB RAM
# Keeps runaway apps in check
# Ensures fair resource allocation
Health checks
Auto-restart failing apps:
# App Settings → Health Check
# Set endpoint: /health or /
# Coolify checks every minute
# Restarts if failing
# Uptime monitoring included
Cron jobs
Schedule recurring tasks:
# App → New Resource → Cron Job
# Set schedule: 0 0 * * * (daily at midnight)
# Run command: npm run backup
# Or hit endpoint: curl https://app.com/api/cleanup
Stuff that went wrong
Build failures
Apps failing to build for no obvious reason.
# Fixed by
1. Checking build logs (actually read them)
2. Making sure all dependencies in requirements.txt/package.json
3. Adding .dockerignore to exclude node_modules
4. Using smaller base images to avoid memory issues
SSL not generating
Let's Encrypt failing on custom domains.
# Fixed by
1. Waiting for DNS to fully propagate (can take time)
2. Making sure port 80/443 not blocked by firewall
3. Checking CNAME not A record for subdomains
4. Rate limiting - waited an hour and retried
Out of memory
Too many apps on small VPS.
# Fixed by
1. Setting resource limits per app
2. Moving to larger VPS (still cheaper than Heroku)
3. Spreading apps across multiple servers
4. Removing unused databases
Slow builds
Every deploy taking 10+ minutes.
# Fixed by
1. Using build cache (enabled in app settings)
2. Optimizing Dockerfile (fewer layers)
3. Using smaller base images (alpine instead of full)
4. Building on local CI, pushing images to registry
Database migration fails
New deployments breaking database.
# Fixed by
1. Running migrations manually first
2. Adding pre-deploy hook in Coolify
3. Using database backups to test migrations locally
4. Rollback functionality (Coolify keeps last 5 versions)
Coolify vs alternatives
| Coolify | Heroku | Vercel | DIY Docker | |
|---|---|---|---|---|
| Cost | $5-20/month | $50-500/month | $20+/month | $5-20/month |
| Setup time | 10 min | 0 min | 0 min | Hours/Days |
| Self-hosted | Yes | No | No | Yes |
| Databases | Free | $$$ add-ons | External only | Free |
| SSL included | Yes | Yes | Yes | Manual setup |
| Preview deployments | Yes | Paid add-on | Yes | Manual setup |
| Control | Full | Limited | Limited | Full |
| Best for | Cost-conscious devs | Rapid prototyping | Frontend apps | Control freaks |
Coolify hits the sweet spot - way cheaper than managed services, way easier than pure DIY.
Would I recommend it?
Absolutely. I migrated 7 apps from Heroku to Coolify. Went from paying ~$75/month to $5/month. That's $840/year saved.
Setup took an afternoon. Most of that was figuring out my own apps' configurations. Coolify itself was simple.
The web UI is great. I can see all my apps, check logs, restart stuff, manage databases - all from one place. No SSHing into servers to debug.
Auto-deploys from GitHub work flawlessly. Push to main, it builds, it deploys. Preview URLs for PRs make reviews so much easier.
If you're paying more than $20/month for hosting and have basic Docker knowledge, Coolify pays for itself in like a week.
Links: coolify.io | GitHub: github.com/coollabsio/coolify | Docs: coolify.io/docs