Newer Version Available
Install Salesforce CLI
Choose one method to install on your computer. For example, don’t install on macOs with both a .pkg and npm.
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.
1wget https://developer.salesforce.com/media/salesforce-cli/sfdx/channels/stable/sfdx-linux-x64.tar.xz -
Create the directory where you want to install Salesforce CLI.
1mkdir ~/sfdx -
Unpack the contents for your TAR file:
1tar xJf sfdx-linux-x64.tar.xz -C ~/sfdx --strip-components 1-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:
1export PATH=~/sfdx/bin:$PATHTo 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:
1PATH=~/sfdx/bin:$PATH
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:
1node --version -
Run this command.
1npm install sfdx-cli --globalIf you receive a permission error when installing the CLI using npm, we recommend not using sudo. See Fixing npm permissions.
Install Older Versions of Salesforce CLI
| Operating System | File Type | TAR Compression Type | Link to JSON File |
|---|---|---|---|
| Linux ARM | TAR | gz | sfdx-linux-arm-tar-gz.json |
| Linux ARM | TAR | xz | sfdx-linux-arm-tar-xz.json |
| Linux 64 | TAR | gz | sfdx-linux-x64-tar-gz.json |
| Linux 64 | TAR | xz | sfdx-linux-x64-tar-xz.json |
| Windows 64 | TAR | gz | sfdx-win32-x64-tar-gz.json |
| Windows 64 | TAR | xz | sfdx-win32-x64-tar-xz.json |
| Windows x86 | TAR | gz | sfdx-win32-x86-tar-gz.json |
| Windows x86 | TAR | xz | sfdx-win32-x86-tar-xz.json |
| macOS | TAR | gz | sfdx-darwin-x64-tar-gz.json |
| macOS | TAR | xz | sfdx-darwin-x64-tar-xz.json |
| Windows 64 | Installer | sfdx-x64-exe.json | |
| Windows x86 | Installer | sfdx-x86-exe.json | |
| macOS | Installer | sfdx-pkg.json |
Verify Your Installation
1sfdx --version
2sfdx-cli/7.101.0 darwin-x64 node-v16.0.0Run this command to view the installed plug-ins and their versions:
1sfdx plugins --core
2
3@oclif/plugin-autocomplete 0.3.0 (core)
4@oclif/plugin-commands 1.3.0 (core)
5@oclif/plugin-help 3.2.2 (core)
6@oclif/plugin-not-found 1.2.4 (core)
7@oclif/plugin-plugins 1.10.0 (core)
8@oclif/plugin-update 1.4.0-3 (core)
9@oclif/plugin-warn-if-update-available 1.7.0 (core)
10@oclif/plugin-which 1.0.3 (core)
11@salesforce/sfdx-plugin-lwc-test 0.1.7 (core)
12@salesforce/sfdx-trust 3.6.0 (core)
13alias 1.1.10 (core)
14apex 0.2.2 (core)
15auth 1.6.1 (core)
16config 1.2.8 (core)
17custom-metadata 1.0.12 (core)
18data 0.4.12 (core)
19generator 1.1.8 (core)
20limits 1.2.1 (core)
21org 1.6.7 (core)
22salesforce-alm 52.0.2 (core)
23schema 1.0.7 (core)
24sfdx-cli 7.107.0 (core)
25telemetry 1.2.2 (core)
26templates 52.0.0 (core)
27user 1.3.0 (core)Run this command to view all available Salesforce CLI commands:
1sfdx commands