TechAnatix

A self-hosted Heroku alternative: moving your apps to Coolify

Teams rarely leave Heroku because it stopped working. They leave when the invoice shows a staging app nobody opens and four add-ons priced like a junior salary. The search that follows is nearly always the same: a self-hosted Heroku alternative that keeps git push deploys without the bill. Coolify is the one we run ourselves. Here is what it replaces, what it asks of you, and how to move.

What you are actually replacing

Heroku is a handful of conveniences in one place. A replacement has to cover each of them.

What Heroku gives you What Coolify gives you
Deploy on git push Deploy on push from GitHub, GitLab or any git remote
Buildpacks Nixpacks, a Dockerfile or Docker Compose
Config vars Environment variables per app and per environment
Add-on databases One-click Postgres, MySQL, MongoDB and Redis on your server
Review apps Preview deployments for pull requests
Automatic SSL Let's Encrypt certificates through the built-in proxy
Heroku Scheduler Scheduled tasks per application

Coolify is open source and runs on a server you rent or own. Your apps run as Docker containers on that same server, or on other servers you connect to it.

What you take on

Self-hosting moves three jobs from the platform to you. Be honest about who will do them.

  • The server. Security updates, disk space and the occasional reboot.
  • Backups. A managed database backs itself up. Yours will, once you configure it and test a restore.
  • Uptime. If the server goes down at night, nobody else is paged.

For a small team these add up to an hour or two a month when things are set up well. If nobody wants that hour, stay on a managed platform. It is a legitimate choice.

The migration, step by step

1. Inventory

List every app, add-on, config var, scheduled job, custom domain and worker process. Run heroku config for each app and keep the output somewhere safe. Note which add-ons have a self-hosted equivalent and which you will keep as external services, such as transactional email.

2. Choose and prepare a server

Pick a provider and a region near your users. Start with more memory than you think you need, because databases are hungry. Lock the server down before installing anything: SSH keys only, a firewall, automatic security updates.

3. Install Coolify and connect your repositories

Install Coolify with its official script, point a subdomain at the dashboard and connect your git provider. From here, each app is a resource you add through the dashboard.

4. Make each app build

Most Heroku apps build with Nixpacks without changes. If yours has an unusual buildpack, write a Dockerfile, which is usually twenty lines. Translate the Procfile: the web process becomes the start command, and each worker becomes its own resource.

Copy the config vars across. Add a health check path so Coolify knows when a deploy is healthy.

5. Move the database, twice

Rehearse first. Take a backup from Heroku and restore it into the new Postgres:

heroku pg:backups:capture --app acme-api
heroku pg:backups:download --app acme-api
pg_restore --no-owner --no-acl -d "$NEW_DATABASE_URL" latest.dump

Point a copy of the app at the restored data and click through it. Time the whole process. That number is your maintenance window.

On the day, put the Heroku app in maintenance mode, take a fresh backup, restore it and switch over.

6. Cut over DNS

Lower the DNS TTL a day beforehand. After the final restore, point the domain at the new server and watch certificates issue. Leave the Heroku app in maintenance mode for a week instead of deleting it. That is your rollback.

7. Set up backups before you celebrate

Schedule database backups to S3-compatible storage outside the server. Then restore one into a scratch database. A backup you have never restored is a hope, not a backup.

When not to self-host

  • You need a compliance certification that your platform currently provides.
  • Traffic is spiky and global, and you rely on automatic scaling.
  • Nobody on the team will own the server.

In those cases the platform fee is buying something real.

What it costs afterwards

You pay your server provider directly for the machine and for backup storage. There is no per-app or per-seat fee for the self-hosted version of Coolify. The saving depends on how many dynos and add-ons you were paying for, so price your own setup before deciding.

Want help moving?

We do this as a fixed-scope Heroku to self-hosted migration, with a rehearsed database cutover and tested backups. Send us your app count and add-on list for a quote.

Leaving Heroku, done for you

Git-push deploys on a server you own, with Coolify.

WhatsApp