Newer Version Available
Install Salesforce CLI
Install the CLI on macOS
- Download the .pkg file.
- Double-click the .pkg file.
Install the CLI with a TAR File
Use this table to find the unversioned URLs for the TAR file (.tar.gz or .tar.xz ) for your operating system. When we release a new version of Salesforce CLI every week, we also update these URLs so they point to the most up-to-date version. Unversioned URLs are especially useful for CI use cases. The table also includes manifest URLs that show the versioned URL for each file.
| Operating System | Tar Files | Manifest |
|---|---|---|
| Linux | ||
| macOS | ||
| Windows |
In these examples it’s assumed that you’re installing Salesforce CLI on Linux and in the sfdx subdirectory of your home directory.
-
Download or wget one of these TAR files.
-
Create the directory where you want to install Salesforce CLI.
-
Unpack the contents for your TAR file:
-C unpacks the contents in the ~/sfdx directory, while --strip-components 1 removes the root path component.
-
Update your PATH environment variable to include the Salesforce CLI
bin directory. For example, to set it for your current terminal
session:
To update your PATH permanently, add the appropriate entry to your shell’s configuration file. For example, if you use the Bash shell, add this line to your ~/.bashrc or ~/.bash_profile file:
Install the CLI with npm
This installation method is a good option if you don’t have administrator permissions on your workstation, or if group policy blocks CLI installation and updates. Installing the CLI with npm doesn’t require root permissions.
-
Ensure that the long-term support (Active LTS) version of Node.js is installed on your
computer. To install the LTS version, go to https://nodejs.org/en/download/. To check
your version number, run:
-
Run this command.
If you receive a permission error when installing the CLI using npm, we recommend not using sudo. See Fixing npm permissions.
Verify Your Installation
Run this command to verify the salesforcedx plug-in version:
Run this command to view all available Salesforce CLI commands: