Quick Start
System Requirements
Move from sfdx (v7) to sf (v2)
Install Salesforce CLI
Uninstall Salesforce CLI or Plugins
Run Salesforce CLI Using a Docker Image
CLI Deprecation Policy
Next Steps
Release Notes
Previous PDF Versions
Install Salesforce CLI on your computer using operating system-specific artifacts, such as .pkg on macOS, TAR files, or with npm.
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 Salesforce CLI on macOS with a .pkg file.
Install Salesforce CLI on Windows with an .exe file.
Install the CLI with a TAR File
Salesforce CLI distributes TAR files that you can install on all supported operating systems.
If you’ve installed Node.js on your computer, you can use npm to install Salesforce CLI. This method lets you install Salesforce CLI from the command line and can be especially useful for continuous integration (CI) use cases.
Install Older Versions of Salesforce CLI
We recommend that you always use the latest version or release candidate of Salesforce CLI. However, we also understand that sometimes you want an older version of the CLI.
Verify Your Installation and Get Version Information
To ensure that you’ve installed Salesforce CLI correctly, run these commands to view the version and list of available commands.
Install Salesforce CLI on macOS with a .pkg file.
Open the Salesforce CLI download page in your browser.
Under macOS, click the download link 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.
See Also
Install Salesforce CLI on Windows with an .exe file.
Open the Salesforce CLI download page in your browser.
Under Windows, click the download link 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.
Salesforce CLI works best within the native Windows command prompt (cmd.exe) and the Microsoft Windows PowerShell. We don’t recommend using Salesforce CLI with a Linux terminal emulator, such as Windows 10 Subsystem for Linux, cygwin, or MinGW, because support for bugs is limited.
Warning
See Also
Salesforce CLI distributes TAR files that you can install on all supported operating systems.
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.
We highly recommended that you use the installers or npm to install Salesforce CLI on Windows. If, however, you decide to use the Windows TAR files, you must first install a separate program, such as 7Zip, to extract the file contents.
Important
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.xzCreate the directory where you want to install Salesforce CLI.
1mkdir -p ~/cli/sfUnpack 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.
This example shows just one possible set of flags for the tar command on Linux. For other options on your operating system, refer to the tar documentation.
Note
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:$PATHSee Also
If you’ve installed Node.js on your computer, you can use npm to install Salesforce CLI. This method lets you install Salesforce CLI from the command line and can be especially useful for continuous integration (CI) use cases.
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 --versionTo 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.
See Also
We recommend that you always use the latest version or release candidate of Salesforce CLI. However, we also understand that sometimes you want an older version of the CLI.
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 stableTo 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.
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.
| Operating System | File Type | TAR Compression Type | Link to JSON File |
|---|---|---|---|
| Linux ARM (Deprecated) | TAR | gz | sf-linux-arm-tar-gz.json |
| Linux ARM (Deprecated) | 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 (Deprecated) | TAR | gz | sf-win32-x86-tar-gz.json |
| Windows x86 (Deprecated) | 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 |
As of July 12, 2023, we no longer update sfdx (v7). We keep these old versions for historical reasons only.
Note
| 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 |
To ensure that you’ve installed Salesforce CLI correctly, run these commands to view the version and list of available commands.
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.128.5 darwin-arm64 node-v22.22.0To 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.41 (core)
2@oclif/plugin-commands 4.1.40 (core)
3@oclif/plugin-help 6.2.38 (core)
4@oclif/plugin-not-found 3.2.75 (core)
5@oclif/plugin-plugins 5.4.58 (core)
6@oclif/plugin-search 1.2.39 (core)
7@oclif/plugin-update 4.7.23 (core)
8@oclif/plugin-version 2.2.38 (core)
9@oclif/plugin-warn-if-update-available 3.1.55 (core)
10@oclif/plugin-which 3.2.44 (core)
11agent 1.32.4 (core)
12apex 3.9.13 (core)
13api 1.3.11 (core)
14auth 4.3.1 (core)
15data 4.0.80 (core)
16deploy-retrieve 3.24.16 (core)
17info 3.4.111 (core)
18limits 3.3.80 (core)
19marketplace 1.3.10 (core)
20org 5.9.72 (core)
21packaging 2.25.10 (core)
22schema 3.3.98 (core)
23settings 2.4.60 (core)
24sobject 1.4.86 (core)
25telemetry 3.8.3 (core)
26templates 56.10.7 (core)
27trust 3.7.114 (core)
28user 3.7.1 (core)
29
30Uninstalled JIT Plugins:
31code-analyzer 5.10.2
32community 3.3.48
33custom-metadata 3.3.84
34dev 2.5.2
35devops-center 1.2.27
36flow 1.0.5
37lightning-dev 6.2.16
38signups 2.6.56
39@salesforce/sfdx-plugin-lwc-test 1.2.1To view all available Salesforce CLI commands and a summary, run this command.
1sf commandsTo display the release notes for the version of Salesforce CLI that’s currently installed on your computer, run this command.
1sf whatsnewSee Also