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.

FeatureHeroku (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 inactivityYes (Basic)No
Custom domainsYesYes
SSL certificatesAutomaticAutomatic (Let’s Encrypt)
Git push deployYesYes
BuildpacksYesYes (Dokku/Coolify)
Docker supportYesYes
Horizontal scalingPaid tiers onlyManual (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.

FeatureHerokuCoolify
Deploy from GitYesYes (GitHub, GitLab, Bitbucket)
Docker supportYesYes (images + Compose)
One-click databasesPostgreSQL, Redis, MongoDBPostgreSQL, MySQL, MariaDB, MongoDB, Redis
Environment variablesDashboard + CLIDashboard + API
SSL/TLSAutomaticAutomatic (Let’s Encrypt, Traefik)
WebhooksYesYes (auto-deploy on push)
Team managementYesYes
Resource monitoringMetrics tabBuilt-in per-service metrics
LicenseProprietaryAGPL-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.

FeatureHerokuDokku
Deploy commandgit push heroku maingit push dokku main
BuildpacksHeroku buildpacksSame Heroku buildpacks
Procfile supportYesYes
PluginsAdd-ons marketplacePlugin system (databases, Let’s Encrypt, etc.)
Web UIYesNone (CLI only)
Multi-serverYesSingle server only
Resource usageN/A~100 MB for Dokku itself
LicenseProprietaryMIT

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

  1. Provision a VPS ($5-15/month, Ubuntu 22.04+)
  2. Install Dokku:
    wget -nv -O - https://get.dokku.com | sudo bash
  3. Add your SSH key:
    echo "your-public-key" | sudo dokku ssh-keys:add admin
  4. Create the app:
    sudo dokku apps:create myapp
  5. 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
  6. Set environment variables:
    sudo dokku config:set myapp KEY=value
  7. 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

  1. Install Coolify on your VPS:
    curl -fsSL https://cdn.coollabs.io/coolify/install.sh | bash
  2. Access the dashboard at http://your-server:8000
  3. Connect your Git provider (GitHub, GitLab, or Bitbucket)
  4. Create a new resource → select your repository
  5. Configure environment variables through the dashboard
  6. Deploy — Coolify detects the framework and builds automatically
  7. 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
Apps3 (paid per dyno)Unlimited (VPS resources)
Database10K rows ($5/mo)Unlimited (your disk)
SSLIncludedIncluded (Let’s Encrypt)
Dyno sleepingYes (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.

Comments