Skip to main content

Migrate from Dokku to Nife

This guide moves an app from Dokku to Nife. You deploy the same code on Nife, copy your environment variables, test it on its Nife URL, then switch your domain when you are ready. Your Dokku 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 Dokku server and app.

How Dokku terms map to Nife​

  • git push deploy: Deploy from Git
  • Procfile web command: Dockerfile command or the runtime's start command
  • Buildpack: Auto Dockerize with Runtime, or your own Dockerfile
  • dokku config: Environment variables and secrets

Step 1: Collect your settings from Dokku​

  1. On your Dokku server, run dokku config:show YOUR-APP to list the app's environment variables.
  2. Open your Procfile, if you have one, and note the command on the web line. This is how your app starts. Note the port your app listens on.
  3. Note whether your app uses a Dockerfile or a buildpack, and your language version.

Keep the values somewhere private. Do not paste them into tickets or chat.

Step 2: Deploy your code on Nife​

  1. In the Nife dashboard, go to Applications and select Deploy Application.
  2. Choose your organization and enter an application name.
  3. Select Git Repository, choose your Git provider, enter the repository URL and select the branch. For a private repository, add a Personal Access Token as a secret.
  4. Under Ports, set the internal port to the port your app listens on.
  5. Under Build Configuration, choose Auto Dockerize with Runtime and select your language, or choose Add Custom Dockerfile if your repository has a Dockerfile. If it is not in the root, give its path.
  6. Add your environment variables (see Step 3), then continue and start the build.

You can also deploy from the terminal with nifectl auth login, nifectl init and nifectl deploy. Full walkthrough: Deploy Application from Git.

Step 3: Set your environment variables​

Copy each variable from the Dokku config into Nife. Keep the same names your code already reads.

You can add them in the dashboard while deploying, or with the command line: 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. Run nifectl secrets list to confirm each name is set.

Variables that point to services run by your old platform, such as a database address, need new values. Replace them with the service you use now.

Step 4: Test on your Nife URL​

  1. Open the URL shown after deploy (or run nifectl open).
  2. Check the pages and API calls your users rely on.
  3. Check the logs with nifectl logs and the status with nifectl status.

Fix anything here before you change where your users go. Your Dokku app is still live, so nothing is at risk.

Step 5: Move your custom domain​

Do this after the app works on its Nife URL.

  1. Go to your domain provider's DNS settings.
  2. Add a CNAME record for your domain. Use the value Nife gives you for your app, which the deploy command shows.
  3. Wait for DNS to update. It can take up to 24 hours.
  4. Open your domain and check the app.

If your domain currently points to Dokku, you will replace that record. Full walkthrough: Custom Domains.

Step 6: Clean up​

Keep the Dokku app for a few days in case you need to go back. When you are sure, remove the domain from Dokku and delete the app there.

What this guide does not cover​

This guide does not cover Dokku plugins, such as database plugins, and Dokku's multi-process scaling settings. If you depend on any of these, 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 list and 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.