Newer Version Available

This content describes an older version of this product. View Latest

Use the Salesforce CLI from Behind a Company Firewall or Web Proxy

If you install or update the Salesforce CLI on a computer that’s behind a company firewall or web proxy, you sometimes receive error messages. In this case, you must further configure your system.

You get an error similar to the following when you run a command after installing the CLI binary behind a firewall or web proxy. This error is from a Linux computer, but Windows and macOS users sometimes see a similar error.

1sfdx-cli: Updating CLI... !
2 ▸  'ECONNRESET': tunneling socket could not be established, cause=connect EHOSTUNREACH 0.0.23.221:8080 - Local (10.126.148.39:53107)

To address this issue, run these commands from your terminal or Windows command prompt, replacing username:pwd with your web proxy username and password. If your proxy doesn’t require these values, omit them. Also replace proxy.company.com:8080 with the URL and port of your company proxy.

1npm config set https-proxy https://username:pwd@proxy.company.com:8080
2npm config set proxy https://username:pwd@proxy.company.com:8080

Then set the HTTP_PROXY or HTTPS_PROXY environment variable to the full URL of the proxy. For example, on UNIX:

1export HTTP_PROXY=https://username:pwd@proxy.company.com:8080
1export HTTPS_PROXY=https://username:pwd@proxy.company.com:8080
On a Windows machine:
1set HTTP_PROXY=https://username:pwd@proxy.company.com:8080
1set HTTPS_PROXY=https://username:pwd@proxy.company.com:8080

If You Still See an Error

Your Proxy Requires an Extra Certificate Authority

If you set the proxy environment variable, and you still see error messages, it’s possible that your proxy requires an extra certificate authority (CA). Ask your IT department where to find or download the certificates.

Set this environment variable to point to the CA file: NODE_EXTRA_CA_CERTS.

Your Corporate Network Is Blocking Salesforce Hosts

It’s possible that your corporate network is blocking the Salesforce hosts for updating or installing Salesforce CLI. Contact your IT department add these domains to your allowlist:
  • https://developer.salesforce.com/media/salesforce-cli
  • https://registry.npmjs.org