Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages

Help for owners

I want to move my app off Heroku to my own server

Short answer

A Heroku app can be moved to a server you control. The code, the database dump, the settings and the add-ons all have to be moved, then the domain switched at the end. Do not delete the Heroku app or database until the new one has run live. Download a backup of the database now and keep it.

  • Written for business owners
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Does this sound like your situation?

  • My bill is bigger than I expected, or I lost a free plan.
  • I want more control over where my data lives.
  • My app sleeps or is slow on a small plan.
  • I am afraid I will lose the database if I move.
  • My developer knows Heroku and I do not know what else is attached.

Why does this happen?

  1. Heroku ended its free plans

    Heroku announced it would stop offering free product plans for Dynos, Heroku Postgres and Heroku Data for Redis, and delete inactive accounts. Apps that were built on those plans needed a paid plan or a new home.

  2. Costs add up per piece

    The app, the database and the cache are separate products on Heroku, and add-ons come on top. A small project can look cheap and still grow into a long list.

  3. The database is the hard part

    Heroku provides database backups in a compressed binary format that can be downloaded. Restoring that file on another server needs the same database software and the right settings, and the app must be stopped or paused to avoid losing changes made in between.

  4. Settings and add-ons live only on Heroku

    Configuration values, scheduled tasks, email and logging add-ons are stored in Heroku and not in your code. They must be listed and recreated elsewhere.

  5. Heroku does the server work for you

    Building, restarts, certificates and scaling are done by the platform. On your own server somebody has to take over that work, and it is better decided before the move.

What can I do about it today?

  1. Download a database backup nowAsk your developer to download a backup from Heroku and keep it on your side. Heroku's own documentation describes downloading a backup, so this is a normal step.
  2. Do not delete the Heroku app or add-onsEven after you decide to leave, keep it until the new server has run for a while.
  3. List the add-ons and their costOpen the app's resources page in Heroku and write down every add-on, what it does and what it costs.
  4. Check the account is yoursMake sure the Heroku account, billing and domain are in your company's name with an email you read.
  5. Decide who will look after the new serverUpdates, backups, security and monitoring need an owner after the move.

When should I bring someone in?

  • Your app has customers and cannot lose data.
  • No one is sure what add-ons or settings it uses.
  • You want to move but have nobody to run the server afterwards.

How do I handle it?

  1. Inventory the Heroku appI list the app, its database, add-ons, environment settings, scheduled tasks and the domain setup.
  2. Choose a target that fitsOwn server, a managed host or containers: I explain the trade-offs in plain words and what each one asks of you to maintain.
  3. Rehearse the moveI rebuild the app on the new server with a copy of the data, test it, and measure how long the final data copy will take.
  4. Cut over and keep the old oneThe data is copied one last time, the domain switched, and Heroku stays untouched as the tested rollback until the new server has proven itself.
  5. Set up backups and monitoringBackups are tested by restoring them, and alerts reach you before your customers.

The price depends on what I find, so I quote in writing after a short discovery call. Tell me what is happening and I reply within 24 hours.

What do owners ask about this?

Will I lose my database?

Not if it is backed up first and the old one stays untouched until the new one works. I test the restore before the switch.

Is moving always cheaper?

Not always. A server you run needs updates and monitoring too, so I compare the real work, not just the hosting bill.

Do I have to leave Heroku?

No. If it suits your app, staying is a valid answer, and I will say so.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Found a mistake? Tell me.

For your developer: the technical fixes

Next step

Want this off your desk?

Send me a few lines on where things stand. I reply within 24 hours.