by poetic-labs



A Heroku buildpack for setting a private git SSH key as part of the application build. Particularly useful for granting Heroku access to installing a private git repository as a dependency.


  1. Set up a deploy/access key with GitHub, GitLab, or BitBucket.

  2. Once you've generated the SSH key, configure the Heroku environment variable GIT_SSH_KEY (note that the key needs to be base64 encoded):

    $ heroku config:set GIT_SSH_KEY=$(cat path/to/your/keys/id_rsa | base64)
  3. Configure the Heroku environment variable GIT_SSH_HOST based on your host. That is,,,, or maybe a hosted instance of GitLab:

    $ heroku config:set GIT_SSH_HOST=""
  4. Add the buildpack to Heroku using either the CLI or the dashboard. It will need to run before any buildpack trying to get SSH access. In the following example, it runs before the heroku/nodejs buildpack:

    $ heroku buildpacks:set --index 1
    $ heroku buildpacks:add heroku/nodejs