Migrate from Heroku to Nife
This guide moves a web app or API from Heroku to Nife. You deploy the same code on Nife, copy your environment variables, test it on its Nife URL, then switch over when you are ready. Your Heroku app keeps running the whole time.
Before you start
- A Nife account and an organization.
- Your app's code in a Git repository (GitHub, GitLab or Bitbucket), or a Dockerfile.
- Access to your Heroku app and the Heroku CLI.
- The Nife CLI (nifectl) if you want to deploy from the terminal. See the Nifectl commands page.
How Heroku terms map to Nife
| On Heroku | On Nife |
|---|---|
| Deploy from Git | Deploy Application from Git |
| Buildpack | Runtime (Node.js, Python, Go, Java, Ruby, PHP, Rust, .NET) or your own Dockerfile |
| Procfile web command | Your Dockerfile command, or the runtime's start command |
| Config vars | Environment variables and secrets |
| heroku logs | nifectl logs |
| Release | Release (nifectl releases) |
Step 1: Collect your settings from Heroku
- List your config vars:
heroku config -a your-heroku-app - Open your Procfile and note the command on the web line. This is how your app starts.
- Note the port your app listens on. Heroku apps read it from the PORT variable.
- Note your language and version (for example Node.js 20 or Python 3.12).
Keep the values somewhere private. Do not paste them into tickets or chat.
Step 2: Deploy your code on Nife
Option A: Deploy from the dashboard
- In the Nife dashboard, go to Applications and select Deploy Application.
- Choose your organization and enter an application name.
- Select Git Repository.
- Choose your Git provider (GitHub, GitLab or Bitbucket), enter the repository URL and select the branch.
- For a private repository, add a Personal Access Token as a secret, or pick one you saved before.
- Click Continue.
- Under Ports, set the internal port to the port your app listens on.
- Under Build Configuration, pick one:
- Auto Dockerize with Runtime: Nife generates a Dockerfile for your language.
- Add Custom Dockerfile: use the Dockerfile in your repository. If it is not in the root, give its path.
- Add your environment variables with Add Variable (see Step 3), then click Continue and start the build.
Full walkthrough: Deploy Application from Git.
Option B: Deploy from the terminal
- Log in:
nifectl auth login - In your project folder, run
nifectl init. Choose your organization, then Runtime and the builder for your language, or Docker if you use your own image. Set the internal port to match your app. - Deploy:
nifectl deploy. Pick a region when asked. The output shows your app's URL when the release is created.
A language-specific example is in the Node.js Applications guide.
Step 3: Set your environment variables
Copy each config var from Step 1 into Nife. Either:
- add them in the dashboard under Environment Variables while deploying, or
- use the CLI:
nifectl secrets create,nifectl secrets list,nifectl secrets update,nifectl secrets delete
Secrets reach your app at runtime as environment variables. Names are case sensitive and stored as you enter them, so keep the same names your code already reads. Run nifectl secrets list to confirm each name is set.
Two Heroku variables will not carry over as they are:
- PORT: set the internal port in Nife instead.
- Variables Heroku created for its own add-ons (for example a database URL). Replace them with the values for the service you use now.
Step 4: Test on your Nife URL
- Open the URL shown after deploy (or run
nifectl open). - Check the pages and API calls your users rely on.
- Check logs for errors:
nifectl logs - Check status:
nifectl status
Fix anything here before you change where your users go. Your Heroku app is still live, so nothing is at risk.
Step 5: Switch over
- When Nife behaves the way Heroku did, point your users at the Nife URL, in whatever way you do that today (your DNS provider, a link, or a client setting).
- Keep the Heroku app running for a few days in case you need to go back.
- When you are sure, scale down or delete the Heroku app from the Heroku dashboard.
What this guide does not cover
This guide does not cover custom domains, databases, or Heroku add-ons and Pipelines. If you depend on any of those, contact Nife support at support@nife.io before you migrate, and we will help you plan it.
Troubleshooting
- Build fails: check the build output in the dashboard. Confirm your language runtime or Dockerfile is correct and that the Dockerfile path is right.
- App starts but is not reachable: confirm the internal port matches the port your app listens on.
- A variable is missing: run
nifectl secrets listand compare names with Step 1. Names are case sensitive. - Private repository will not connect: check that the Personal Access Token can read the repository.
Need help? Email support@nife.io.