Edit

Share via


Install the Defender for Cloud CLI

This article explains how to download and install the Defender for Cloud CLI on supported operating systems.

Download the CLI

The Defender for Cloud CLI is distributed as a standalone executable. Download the binary that matches your operating system and CPU architecture.

Operating system Architecture Download URL
Windows x64 (64-bit) https://aka.ms/defender-cli_win-x64
Windows x86 (32-bit) https://aka.ms/defender-cli_win-x86
Windows ARM64 https://aka.ms/defender-cli_win-arm64
macOS Apple silicon (M-series) https://aka.ms/defender-cli_osx-arm64
macOS Intel https://aka.ms/defender-cli_osx-x64
Linux x64 https://aka.ms/defender-cli_linux-x64
Linux ARM64 https://aka.ms/defender-cli_linux-arm64

Set execution permissions (Linux and macOS)

On Linux and macOS, you must grant the downloaded binary permission to run.

From the directory that contains the downloaded file, run:

chmod +x defender

Tip

On macOS, you might see a Developer cannot be verified warning when running the CLI for the first time. To allow the binary, go to System Settings > Privacy & Security, and then select Open Anyway.

Adding the CLI to your system PATH lets you run the defender command from any directory.

Linux and macOS

Move the binary to a directory that’s already included in your PATH, such as /usr/local/bin:

sudo mv defender /usr/local/bin/defender

Windows

  1. Create a folder. For example, C:\tools\defender

  2. Move defender.exe into that folder.

  3. In Windows Search, select Edit the system environment variables.

  4. Select Environment Variables, then edit the Path variable under System variables.

  5. Add the path to the folder you created. For example, C:\tools\defender

  6. Save your changes.

Verify the installation

Open a new terminal or command prompt window and run:

defender --version

If the CLI is installed correctly, the command returns the current version.

Next steps