⚡
SelfHostStackOpen-Source Directory

Why Migrate Away from Heroku & Render / Railway?

Heroku eliminated its free tier in 2022 and charges $7-$25 per basic/standard dyno per month, plus $0.10/GB bandwidth and $15-$50/mo for managed Postgres. Railway and Render follow similar per-resource metering models where a moderately active full-stack application easily costs $150-$500+/mo. Self-hosting CapRover or Dokku on a single $3.79/mo VPS gives you unlimited apps, unmetered bandwidth, automated Git push deploys, automatic Let's Encrypt SSL, and one-click database provisioning without per-dyno licensing.

Technical Architecture & Migration Analysis

Heroku runs applications on proprietary Dyno containers with an internal routing mesh, QoS-tiered RAM allocations, and per-dyno billing. Render and Railway use similar container-based architectures with metered resource billing. When self-hosting CapRover, your stack uses Docker Swarm under a single Captain manager container with Nginx as the built-in reverse proxy. Each app is deployed as a separate Docker container with its own subdomain, health checks, and rolling deploy strategy. Dokku takes a leaner approach, running a single Go/Shell process that orchestrates Docker builds, Nginx proxy configuration, and Let's Encrypt certificate management — all from a single systemd service on any $4/mo VPS.

⚠️

When NOT to Migrate (When Staying on Heroku & Render / Railway Makes Sense)

Self-hosting is not universally the right move. Keep paying for SaaS if your team hits any of these constraints:

  • ▸Your team depends on Heroku add-on marketplace integrations (Papertrail, Heroku Data, LogDNA) that have no self-hosted equivalent.
  • ▸You need Heroku's proprietary review apps workflow integrated deeply with GitHub PR automation.
  • ▸Your deployment process relies on Heroku's build system (Heroku-24 stack) with compiled slug caching.

Real-World Cost Comparison: Heroku & Render / Railway vs Self-Hosted

Comparing vendor cloud billings against standard Hetzner / DigitalOcean infrastructure costs at scale.

Tier / ScaleHeroku & Render / Railway CostSelf-Hosted VPS CostEstimated Annual SavingsTechnical Breakdown
MVP / Side Project (1-3 apps)
3 lightweight web apps, shared Postgres, 100GB bandwidth/mo
$21-$75/month (3 Basic Dynos × $7-$25 each + managed DB)€3.79/month (Hetzner CX22 2 vCPU, 4GB RAM)$200-$850/yearCapRover handles 3+ lightweight apps with shared Postgres on a single 4GB VPS.
Production SaaS (5-10 apps)
10 apps, separate Postgres per app, 500GB bandwidth/mo, background workers
$150-$500/month (Standard Dynos + managed DBs + bandwidth overages)€14.28/month (Hetzner CPX31 4 vCPU, 8GB RAM)$1,600-$5,700/yearCapRover cluster handles production workloads at fixed VPS pricing with zero bandwidth metering.
High-Traffic Platform (20+ apps)
20+ apps, autoscaling workers, dedicated databases, 2TB bandwidth/mo
$800-$2,500+/month (Performance Dynos + enterprise tier)€36.47/month (2× Hetzner CPX31 cluster with load balancing)$9,000-$29,000+/yearMulti-node CapRover cluster provides horizontal scaling at a fraction of PaaS pricing.

Top 2 Recommended Open-Source Replacements

Tested, self-contained, and production-ready. Click any tool to inspect verified docker-compose configurations, hardware sizing, and deployment guides.

CapRover

Apache-2.0⭐ 13.8k+

Open-source PaaS that turns any Docker cluster into a Heroku-like platform with one-click app deploys and auto-scaling.

Min RAM2 GB
Min CPU2 vCPU
GitHub Repo ↗

✅ Advantages

  • Full Heroku-like experience with a polished web UI for non-CLI users
  • Runs Docker images directly, supporting any language or framework
  • Multi-server cluster support for high-availability production deployments

⚠️ Trade-offs / Limitations

  • Docker Swarm is less widely adopted than Kubernetes for advanced enterprise orchestration
  • Dashboard is functional but less visually modern than Coolify

Core Features

▸Web dashboard for one-click app deployments, environment variables, and custom domains
▸Built-in one-click databases: PostgreSQL, MySQL, MongoDB, Redis, and MinIO S3
▸Git push deployment with automatic Docker image building and SSL provisioning
▸Zero-downtime rolling deploys and easy horizontal scaling across multiple VPS nodes
▸App template marketplace for one-click deployment of 30+ popular open-source apps

Architecture Notes

CapRover runs a single Captain manager container that orchestrates app deployments via Docker Swarm under the hood. It includes a built-in Nginx reverse proxy with Let's Encrypt auto-SSL, persistent volume management, and a React-based web dashboard for managing apps, domains, databases, and cluster nodes.

Known Limitations

Requires Docker Swarm mode; horizontal scaling across multiple servers requires provisioning additional VPS worker nodes.

Official Documentation ↗
📄 docker-compose.yml
Production Ready
version: '3.8'
services:
  caprover:
    image: caprover/caprover:latest
    container_name: caprover
    restart: always
    cap_add:
      - NET_ADMIN
      - SYS_PTRACE
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - caprover_data:/var/lib/captain
    ports:
      - "80:80"
      - "443:443"
      - "3000:3000"
    environment:
      - MAIN_NODE_IP_ADDRESS=127.0.0.1
    networks:
      - selfhost_net

volumes:
  caprover_data:

networks:
  selfhost_net:
    external: true

🚀 5-Minute Deployment Guide

  1. 1Provision a VPS with at least 2GB RAM and Ubuntu 22.04+ (e.g. Hetzner CX22).
  2. 2Install Docker: `curl -fsSL https://get.docker.com | sh`.
  3. 3Install CapRover: `docker run -p 80:80 -p 443:443 -p 3000:3000 -e MAIN_NODE_IP_ADDRESS=YOUR_SERVER_IP -v /var/run/docker.sock:/var/run/docker.sock -v /captain:/captain caprover/caprover`.
  4. 4Install the CapRover CLI locally: `npm install -g caprover`.
  5. 5Run `caprover setup` and follow prompts to connect your root domain and SSL certificate.
  6. 6Open `https://captain.yourdomain.com` in your browser to deploy apps with one click.

Recommended Cloud VPS for CapRover

Compare all VPS hosts →
Hetzner Cloud€3.79/mo

CX22 (2 vCPU, 4GB RAM, 40GB NVMe)

Best value for hosting multiple apps via CapRover.

Deploy on Hetzner →
DigitalOcean$24.00/mo

Basic Droplet (2 vCPU, 4GB RAM, 80GB SSD)

Includes $200 free trial credits for new accounts.

Claim $200 DO Credit →

Dokku

MIT⭐ 26.8k+

The smallest PaaS implementation you have ever seen — Docker-powered mini-Heroku in a single binary.

Min RAM1 GB
Min CPU1 vCPU
GitHub Repo ↗

✅ Advantages

  • Extremely lightweight and rock-solid stability
  • CLI-first workflow ideal for terminal power users
  • Zero graphical overhead

⚠️ Trade-offs / Limitations

  • No default web GUI (requires CLI or third-party web interface)
  • Steeper learning curve for non-developers

Core Features

▸Git push deployment workflow: `git push dokku main`
▸Heroku buildpack and Dockerfile compatibility
▸Rich plugin ecosystem for PostgreSQL, Redis, Let's Encrypt SSL, and Slack alerts
▸Minimal overhead — runs smoothly on a $4/mo 1GB VPS

Architecture Notes

Dokku runs as a single systemd service on Ubuntu/Debian. It orchestrates Docker containers, manages Nginx reverse proxy configurations, handles Let's Encrypt SSL via plugins, and provides Heroku-compatible buildpacks for app compilation.

Known Limitations

CLI-only workflow with no built-in web dashboard; requires third-party tools or Dokku UI plugin for graphical management.

Official Documentation ↗
📄 docker-compose.yml
Production Ready
# Dokku installs natively on Ubuntu / Debian via apt
# Run on your VPS:
# wget -NP . https://dokku.com/bootstrap.sh
# sudo DOKKU_TAG=v0.34.8 bash bootstrap.sh

🚀 5-Minute Deployment Guide

  1. 1Provision an Ubuntu 24.04 VPS.
  2. 2Run the bootstrap script: `wget -NP . https://dokku.com/bootstrap.sh && sudo bash bootstrap.sh`.
  3. 3Configure your SSH key: `cat ~/.ssh/id_rsa.pub | dokku ssh-keys:add admin`.
  4. 4Create your first app: `dokku apps:create my-app`.
  5. 5Add git remote on your local machine: `git remote add dokku dokku@your-vps-ip:my-app` and push!

Recommended Cloud VPS for Dokku

Compare all VPS hosts →
Hetzner Cloud€3.79/mo

CX22 (2 vCPU, 4GB RAM, 40GB NVMe)

Flawless for hosting dozens of Dokku apps.

Deploy on Hetzner →
DigitalOcean$6.00/mo

Basic Droplet (1 vCPU, 1GB RAM, 25GB SSD)

Pre-built Dokku 1-click marketplace image available.

Claim $200 DO Credit →

Quick Specification Matrix

ToolLicenseMin RAMMin CPUGitHub RepoPrimary Advantage
Heroku & Render / Railway (Proprietary)Proprietary ClosedManaged CloudManaged CloudN/ATurnkey onboarding with vendor lock-in & paywalls
CapRoverApache-2.02 GB2 vCPUcaprover/caproverFull Heroku-like experience with a polished web UI for non-CLI users
DokkuMIT1 GB1 vCPUdokku/dokkuExtremely lightweight and rock-solid stability

Performance Benchmarks & Hard Operational Limits

Real-world operational trade-offs, resource consumption limits, and measured throughput.

Benchmark MetricHeroku & Render / Railway BaselineSelf-Hosted Alternative MetricOperational Bottleneck / LimitSource
App Deployment Time (100MB image)30s-90s (Heroku slug compilation + dyno restart)15s-40s (Docker image pull + container start)Docker image registry pull speed.Production Test
Monthly Bandwidth Cost (1TB)$100.00 ($0.10/GB Heroku egress overage)$0.00 (Included with VPS plan — Hetzner CX22 includes 20TB)None — bandwidth is unmetered on most VPS providers.Production Test
Managed PostgreSQL Cost (2GB RAM)$15-$50/month (Heroku Postgres Mini/Basic)$0.00 (Runs as a container on your existing VPS)NVMe disk IOPS for write-heavy workloads.Production Test

Frequently Asked Questions

Practical deployment, migration, and maintenance answers.

Can I migrate my existing Heroku apps to CapRover without rewriting anything?▾

Yes. CapRover supports Dockerfile-based deployments, so any Heroku app that uses a Procfile can be migrated by adding a simple Dockerfile. Apps using Heroku buildpacks are also compatible via CapRover's buildpack mode. Environment variables can be migrated via the dashboard.

How does CapRover handle SSL certificates and custom domains?▾

CapRover includes a built-in Nginx reverse proxy that automatically provisions and renews Let's Encrypt SSL certificates for every app. You simply add your custom domain in the dashboard, point the DNS A-record to your VPS IP, and CapRover handles the rest — including wildcard certificates.

Can CapRover scale horizontally across multiple servers?▾

Yes. CapRover uses Docker Swarm under the hood. You can add worker nodes to your cluster via the dashboard, and CapRover will distribute app containers across nodes using Swarm's built-in scheduling and load balancing.

Is Dokku suitable for production workloads?▾

Yes. Dokku is battle-tested in production by thousands of companies. It handles automatic SSL, log management, process scaling, cron tasks, and deployment hooks. The main trade-off is the CLI-only interface — if you need a web dashboard, consider CapRover or Coolify instead.

What is the cheapest VPS I can run CapRover on?▾

CapRover runs comfortably on a Hetzner CX22 (2 vCPU, 4GB RAM) for €3.79/mo, which can host 5-10 lightweight apps. For a single app, Dokku can run on a 1GB VPS for as little as €2.89/mo.

Starter Stack Pack — $29

Skip the setup: get the production-ready stack

Don't stitch together configs from five different READMEs. Get all 5 production-hardened Docker Compose stacks — Postgres, Redis, SSL auto-renewal, and backup scripts — ready to deploy in minutes.

⚡n8nVisual workflow automation
📊UmamiPrivacy-first web analytics
🛡️Uptime KumaUptime monitoring & alerts
🔐VaultwardenBitwarden-compatible vault
☁️NextcloudDropbox/Drive replacement
Get the Stack Pack — $29 →

One-time purchase · Instant download · Production-ready

esc
↑↓ navigate↵ open