Self-Hosted Alternatives to Heroku
Why Replace Heroku?
Heroku killed its free tier in November 2022. The cheapest option is now $5/month per dyno (Basic), which sleeps after 30 minutes of inactivity. Eco dynos cost $5/month for a pool of 1,000 hours across all apps — barely enough for one always-on app. The Hobby tier ($7/month per dyno) doesn’t sleep but has no horizontal scaling. Production-grade dynos start at $25/month each.
For a modest deployment — say, three small web apps, two workers, and a PostgreSQL database — you’re looking at $50-100+/month on Heroku. The same workload runs comfortably on a $5-15/month VPS with a self-hosted PaaS.
Heroku’s convenience was always its selling point: git push heroku main and your app deploys. Self-hosted PaaS tools now replicate this workflow on your own infrastructure.
| Feature | Heroku (Basic) | Self-Hosted (Coolify/Dokku) |
|---|---|---|
| Cost (3 apps) | $15-21/month (dynos only) | $5-15/month (entire VPS) |
| Cost (3 apps + database) | $20-30/month | $5-15/month (same VPS) |
| Database included | $5/month (10K rows) | Free (PostgreSQL on same server) |
| Sleep on inactivity | Yes (Basic) | No |
| Custom domains | Yes | Yes |
| SSL certificates | Automatic | Automatic (Let’s Encrypt) |
| Git push deploy | Yes | Yes |
| Buildpacks | Yes | Yes (Dokku/Coolify) |
| Docker support | Yes | Yes |
| Horizontal scaling | Paid tiers only | Manual (add more servers) |
Best Alternatives
Coolify — Best Overall Replacement
Coolify is a self-hosted Heroku/Vercel/Netlify alternative with a modern web UI. It supports deploying from Git repositories, Docker images, or Docker Compose files. It handles SSL certificates, reverse proxying, database provisioning, and zero-downtime deployments — all through a clean dashboard.
Coolify supports multiple deployment targets (your own servers connected via SSH), making it suitable for managing applications across several VPS instances from a single interface.
| Feature | Heroku | Coolify |
|---|---|---|
| Deploy from Git | Yes | Yes (GitHub, GitLab, Bitbucket) |
| Docker support | Yes | Yes (images + Compose) |
| One-click databases | PostgreSQL, Redis, MongoDB | PostgreSQL, MySQL, MariaDB, MongoDB, Redis |
| Environment variables | Dashboard + CLI | Dashboard + API |
| SSL/TLS | Automatic | Automatic (Let’s Encrypt, Traefik) |
| Webhooks | Yes | Yes (auto-deploy on push) |
| Team management | Yes | Yes |
| Resource monitoring | Metrics tab | Built-in per-service metrics |
| License | Proprietary | AGPL-3.0 |
Best for: Teams wanting a visual dashboard for deploying multiple applications. Closest UX to Heroku.
Dokku — Best for Solo Developers
Dokku is the original self-hosted PaaS — “Docker-powered mini-Heroku.” It uses Heroku’s own buildpacks, so most Heroku apps deploy to Dokku with zero changes. The workflow is identical: git push dokku main triggers a build and deploy.
Dokku is CLI-driven (no web UI) and runs on a single server. It’s lightweight, battle-tested, and has an extensive plugin ecosystem for databases, caching, cron jobs, and more.
| Feature | Heroku | Dokku |
|---|---|---|
| Deploy command | git push heroku main | git push dokku main |
| Buildpacks | Heroku buildpacks | Same Heroku buildpacks |
| Procfile support | Yes | Yes |
| Plugins | Add-ons marketplace | Plugin system (databases, Let’s Encrypt, etc.) |
| Web UI | Yes | None (CLI only) |
| Multi-server | Yes | Single server only |
| Resource usage | N/A | ~100 MB for Dokku itself |
| License | Proprietary | MIT |
Best for: Solo developers or small teams comfortable with the command line. The most Heroku-compatible alternative.
CapRover — Best for Docker-First Workflows
CapRover is a Docker-based PaaS with a web dashboard. It’s less opinionated than Coolify or Dokku — you deploy Docker images or Compose files rather than relying on buildpacks. CapRover has a one-click app marketplace with 100+ pre-configured applications.
Best for: Users who prefer Docker-native deployments over buildpack-based workflows.
Migration Guide
From Heroku to Dokku
- Provision a VPS ($5-15/month, Ubuntu 22.04+)
- Install Dokku:
wget -nv -O - https://get.dokku.com | sudo bash - Add your SSH key:
echo "your-public-key" | sudo dokku ssh-keys:add admin - Create the app:
sudo dokku apps:create myapp - Add PostgreSQL (if needed):
sudo dokku plugin:install https://github.com/dokku/dokku-postgres.git sudo dokku postgres:create myapp-db sudo dokku postgres:link myapp-db myapp - Set environment variables:
sudo dokku config:set myapp KEY=value - Add the Dokku remote and push:
git remote add dokku dokku@your-server:myapp git push dokku main
Your Procfile, buildpack, and environment variables work unchanged from Heroku.
From Heroku to Coolify
- Install Coolify on your VPS:
curl -fsSL https://cdn.coollabs.io/coolify/install.sh | bash - Access the dashboard at
http://your-server:8000 - Connect your Git provider (GitHub, GitLab, or Bitbucket)
- Create a new resource → select your repository
- Configure environment variables through the dashboard
- Deploy — Coolify detects the framework and builds automatically
- Set up a custom domain and Coolify provisions SSL automatically
Cost Comparison
| Heroku (3 apps + DB) | Self-Hosted Dokku | |
|---|---|---|
| Monthly cost | $20-35/month | $5-15/month (VPS) |
| Annual cost | $240-420/year | $60-180/year |
| 3-year cost | $720-1,260 | $180-540 |
| Apps | 3 (paid per dyno) | Unlimited (VPS resources) |
| Database | 10K rows ($5/mo) | Unlimited (your disk) |
| SSL | Included | Included (Let’s Encrypt) |
| Dyno sleeping | Yes (Basic) | No |
What You Give Up
- Managed infrastructure. Heroku handles OS updates, security patches, and scaling. Self-hosted means you manage the server.
- Add-on marketplace. Heroku has hundreds of add-ons (logging, monitoring, email, search). Self-hosted PaaS tools have plugin systems, but the ecosystem is smaller.
- Horizontal scaling. Heroku scales dynos with a slider. Self-hosted scaling means provisioning more servers and load balancing.
- Review apps. Heroku creates temporary app instances for PRs. Coolify supports preview deployments; Dokku does not natively.
- Dashboard polish. Heroku’s dashboard is mature. Coolify’s is good and improving. Dokku has no dashboard.
- Support SLA. Heroku offers enterprise support contracts. Self-hosted means community support.
Related
Get self-hosting tips in your inbox
Get the Docker Compose configs, hardware picks, and setup shortcuts we don't put in articles. Weekly. No spam.
Comments