How to Install Defang
Defang doesn't require installing anything in your cloud, but you will need to install the open source Defang command line interface (CLI) to interact with your Defang resources and account.
We offer a few different ways to install the Defang CLI. You can use a bash script, Homebrew, Winget, or you can download the binary directly.
- Bash
- Homebrew
- Winget
- Nix
- Direct Download
Using a Bash Script
You can install the Defang CLI using a bash script. Run the following command in your terminal:
. <(curl -Ls s.defang.io/install)
The script will try to download the appropriate binary for your operating system and architecture, add it to ~/.local/bin
, and add ~/.local/bin
to your PATH
if it's not already there, with your permission. If you do not provide permission it will print an appropriate instruction for you to follow to add it manually. You can also customize the installation directory by setting the INSTALL_DIR
environment variable before running the script.
Using Homebrew
You can easily install the Defang CLI using Homebrew. Run the following command in your terminal:
brew install DefangLabs/defang/defang
Using Winget
On Windows, you can install the Defang CLI using winget
. Run the following command in your terminal:
winget install defang
Using Nix
nix profile install github:DefangLabs/defang#defang-bin --refresh
Direct Download
You can find the latest version of the Defang CLI on the latest release page. Just download the appropriate binary for your operating system and architecture, and put it somewhere in your PATH
.