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 file and npm. Installing it both ways can lead to confusing path issues on your computer, sometimes without an explicit error and thus difficult to diagnose.
Install the CLI on macOS
- Open the Salesforce CLI download page in your browser and click macOS.
-
Click the download button that applies to the processor of your macOS computer.
For example, if your processor is Apple Silicon, click Download for macOS (Apple Silicon), which downloads an sf-arm64.pkg file.
- Run the .pkg file, such as double-clicking it from Finder, and answer all the prompts.
- After the installation completes, restart your Terminal windows or IDEs to make sure Salesforce CLI is available.
Install the CLI on Windows
- Open the Salesforce CLI download page in your browser and click Windows.
-
Click the download button that applies to the architecture of your Windows computer.
For example, if you're using a 64-bit version of the Windows operating system that's built for the x86-64 architecture, click Download for Windows x64, which downloads an sf-x64.exe file.
-
Run the .exe file, such as double-clicking it from
Windows Explorer, and answer all the prompts.
(Optional) In the Choose Components window, if you want Microsoft Defender Antivirus to exclude the installed Salesforce CLI files when it scans, select Add %LOCALAPPDATA%\sf to Windows Defender exclusions.
This option is initially deselected because we want the default Windows installation to be more secure. But excluding the CLI files from the antivirus scans improves the performance of Salesforce CLI, which is why we give you the option. Use with care.
- After the installation completes, close and then restart all your your command prompts, PowerShell windows, and IDEs to make sure Salesforce CLI is available.
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 cli/sf subdirectory of your home directory.
- Open a terminal window.
-
Download one of these TAR files. Alternatively, run wget in the terminal to get a TAR file.
1wget https://developer.salesforce.com/media/salesforce-cli/sf/channels/stable/sf-linux-x64.tar.xz -
Create the directory where you want to install Salesforce CLI.
1mkdir -p ~/cli/sf -
Unpack the contents for your TAR file:
1tar xJf sf-linux-x64.tar.xz -C ~/cli/sf --strip-components 1-C unpacks the contents in the ~/cli/sf 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=~/cli/sf/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=~/cli/sf/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 Salesforce CLI with npm doesn’t require root permissions.
- Open a terminal (macOS and Linux) or command prompt (Windows).
-
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 this command from the terminal or command prompt:
1node --version -
To install Salesforce CLI, run this command.
1npm install @salesforce/cli --globalIf you receive a permission error when installing Salesforce CLI using npm macOS or Linux, we don’t recommend using sudo. See Fixing npm permissions.
Install Older Versions of Salesforce CLI
Installers
If you installed Salesforce CLI with the installers, update to an older version with the --version flag. For example, to update to version 2.0.1, run this command in a terminal (macOS and Linux) or command prompt (Windows).
1sf update --version 2.0.1Use the --available flag to list all available older versions to which you can update. The output also shows whether you already have a local copy or if it must be downloaded.
1sf update --availableUse --interactive to choose a version interactively.
Use this command to return to the current version.
1sf update stablenpm
To update to an older version of Salesforce CLI using npm, specify the version using @<version> after the @salesforce/cli package name. For example, to update to version 2.0.1, run this command in a terminal (macOS and Linux) or command prompt (Windows).
1npm install @salesforce/cli@2.0.1 --globalTo return to the current version, run this command.
1npm install @salesforce/cli --globalSee the Salesforce CLI npmjs.com page for a list of all versions. We keep all old versions of the @salesforce/cli and sfdx-cli (deprecated) npm packages.
TAR Files
We publish JSON files that list the download URLs for recent versions of the installers and TAR files for each supported operating system. We continually add new versions to the lists; versions remain on the list for 20 weeks. We keep the TAR and installer files themselves for 40 weeks minimum.
sf (v2)
| Operating System | File Type | TAR Compression Type | Link to JSON File |
|---|---|---|---|
| Linux ARM | TAR | gz | sf-linux-arm-tar-gz.json |
| Linux ARM | TAR | xz | sf-linux-arm-tar-xz.json |
| Linux 64 | TAR | gz | sf-linux-x64-tar-gz.json |
| Linux 64 | TAR | xz | sf-linux-x64-tar-xz.json |
| Windows 64 | TAR | gz | sf-win32-x64-tar-gz.json |
| Windows 64 | TAR | xz | sf-win32-x64-tar-xz.json |
| Windows x86 | TAR | gz | sf-win32-x86-tar-gz.json |
| Windows x86 | TAR | xz | sf-win32-x86-tar-xz.json |
| macOS (Intel CPU) | TAR | gz | sf-darwin-x64-tar-gz.json |
| macOS (Intel CPU) | TAR | xz | sf-darwin-x64-tar-xz.json |
| macOS (Apple Silicon) | TAR | gz | sf-darwin-arm64-tar-gz.json |
| macOS (Apple Silicon) | TAR | xz | sf-darwin-arm64-tar-xz.json |
| Windows 64 | Installer | sf-x64-exe.json | |
| Windows x86 | Installer | sf-x86-exe.json | |
| macOS (Intel CPU) | Installer | sf-x64-pkg.json | |
| macOS (Apple Silicon) | Installer | sf-arm64-pkg.json |
| 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 (Intel CPU) | TAR | gz | sfdx-darwin-x64-tar-gz.json |
| macOS (Intel CPU) | TAR | xz | sfdx-darwin-x64-tar-xz.json |
| macOS (Apple Silicon) | TAR | gz | sfdx-darwin-arm64-tar-gz.json |
| macOS (Apple Silicon) | TAR | xz | sfdx-darwin-arm64-tar-xz.json |
| Windows 64 | Installer | sfdx-x64-exe.json | |
| Windows x86 | Installer | sfdx-x86-exe.json | |
| macOS (Intel CPU) | Installer | sfdx-x64-pkg.json | |
| macOS (Apple Silicon) | Installer | sfdx-arm64-pkg.json |
Verify Your Installation and Get Version Information
- Open a terminal (macOS and Linux) or a command prompt (Windows) on your computer.
-
To view the Salesforce CLI version that you’ve installed, run this command.
1sf --versionThe command returns details about the version, such as this example output.1@salesforce/cli/2.83.6 darwin-arm64 node-v22.14.0 -
To view the installed core plugins and their versions, run this command.
1sf plugins --coreThe command displays information such as this sample output.1@oclif/plugin-autocomplete 3.2.26 (core) 2@oclif/plugin-commands 4.1.22 (core) 3@oclif/plugin-help 6.2.27 (core) 4@oclif/plugin-not-found 3.2.48 (core) 5@oclif/plugin-plugins 5.4.36 (core) 6@oclif/plugin-search 1.2.23 (core) 7@oclif/plugin-update 4.6.36 (core) 8@oclif/plugin-version 2.2.27 (core) 9@oclif/plugin-warn-if-update-available 3.1.38 (core) 10@oclif/plugin-which 3.2.34 (core) 11apex 3.6.11 (core) 12api 1.3.3 (core) 13auth 3.6.108 (core) 14data 4.0.24 (core) 15deploy-retrieve 3.21.2 (core) 16info 3.4.51 (core) 17limits 3.3.51 (core) 18marketplace 1.3.7 (core) 19org 5.5.7 (core) 20packaging 2.12.3 (core) 21schema 3.3.58 (core) 22settings 2.4.22 (core) 23sobject 1.4.53 (core) 24telemetry 3.6.37 (core) 25templates 56.3.43 (core) 26trust 3.7.78 (core) 27user 3.6.16 (core) 28 29Uninstalled JIT Plugins: 30code-analyzer 5.0.0 31community 3.3.18 32custom-metadata 3.3.48 33dev 2.5.1 34devops-center 1.2.27 35signups 2.6.19 36@salesforce/sfdx-plugin-lwc-test 1.2.1 37@salesforce/sfdx-scanner 4.11.0 -
To view all available Salesforce CLI commands and a summary, run this command.
1sf commands -
To display the release notes for the version of Salesforce CLI that’s currently installed
on your computer, run this command.
1sf whatsnew