I am trying to follow commands to install SFDX CLI on Heroku instance.

When I execute commands

>heroku run bash
>wget https://developer.salesforce.com/media/salesforce-cli/sfdx-linux-amd64.tar.xz

I receive an error:

bash: wget: command not found

When I then try to run install command to install wget,

>sudo apt-get install wget

I receive an error

bash: sudo: command not found

When I execute just

>apt-get install wget

I receive errors

W: Not using locking for read only lock file /var/lib/dpkg/lock

E: Unable to write to /var/cache/apt/

E: The package lists or status file could not be parsed or opened.

Ok, there should be a way to install sfdx without root access provided Node.js is installed. On heroku instance with Node.js it is installed

$ node --version


However, npm command to install sfdx, is not available

npm install sfdx-cli --global

bash: npm: command not found

Did anyone managed to resolve this issue?

Is this possible to install SFDX CLI on Heroku instance at all?

1 Answer 1


Yes, the DX CLI can run on Heroku. Wade Wegner contributed this buildpack here: https://github.com/heroku/salesforce-cli-buildpack

EDITED: added some extra details on how to install it since the readme is minimalist and outdated:

1) create the Heroku app

heroku create

2) Set the buildpack

heroku buildpacks:set https://github.com/heroku/salesforce-cli-buildpack

3) Push sources (you should see that the salesforce-cli-buildpack is detected)

git push heroku master

4) Run bash (notice that the Salesforce CLI is added to path automatically)

heroku run bash

5) Check that it works

sfdx -v

6) Enjoy your favorite Salesforce DX commands :)

  • Did I understand you correctly, if I run "heroku create node-mine -b github.com/heroku/salesforce-cli-buildpack" then I will get an app with sfdx preinstalled, but when I run this command followed by "heroku run bash" and "sfdx" I receive "bash: sfdx: command not found", or did I misunderstand you?
    – Patlatus
    Jul 13, 2018 at 13:19
  • Did you export the command paths as indicated in the readme?
    – POZ
    Jul 13, 2018 at 15:06
  • I have executed both commands in commands line but that didn't work. Did I understand correctly that those two commands I was supposed to execute after heroku run bash?
    – Patlatus
    Jul 14, 2018 at 15:49
  • I just retried the full install and it looks like the readme is outdated, the SFDX command is already included in the path so you don't need to add it yourself.
    – POZ
    Jul 16, 2018 at 8:36
  • See edited answer for detailed instructions.
    – POZ
    Jul 16, 2018 at 8:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .