Skip to content

Installing Zarf

Homebrew is a package manager for macOS and Linux. You can install Zarf with Homebrew by running the following:

Terminal window
brew tap defenseunicorns/tap && brew install zarf

All Zarf releases on GitHub include prebuilt binaries that you can download and use. We offer range of combinations of OS and architecture for you to choose from.

To download Zarf on Linux you can run the following (replacing $ZARF_VERSION with any release version of Zarf):

Terminal window
ZARF_VERSION=$(curl -sIX HEAD https://github.com/defenseunicorns/zarf/releases/latest | grep -i ^location: | grep -Eo 'v[0-9]+.[0-9]+.[0-9]+')
curl -sL "https://github.com/defenseunicorns/zarf/releases/download/${ZARF_VERSION}/zarf_${ZARF_VERSION}_Linux_amd64" -o zarf
chmod +x zarf

On most Linux distributions, install the binary onto your $PATH by moving the downloaded binary to the /usr/local/bin directory:

Terminal window
sudo mv zarf /usr/local/bin/zarf

To download Zarf on macOS you can run the following (replacing $ZARF_VERSION with any release version of Zarf):

Terminal window
ZARF_VERSION=$(curl -sIX HEAD https://github.com/defenseunicorns/zarf/releases/latest | grep -i ^location: | grep -Eo 'v[0-9]+.[0-9]+.[0-9]+')
curl -sL "https://github.com/defenseunicorns/zarf/releases/download/${ZARF_VERSION}/zarf_${ZARF_VERSION}_Darwin_amd64" -o zarf
chmod +x zarf

Install the binary onto your $PATH by moving the downloaded binary to the /usr/local/bin directory:

Terminal window
sudo mv zarf /usr/local/bin/zarf

To download Zarf on Windows you can run the following (replacing $ZarfVersion with any release version of Zarf):

Terminal window
$ZarfVersion = (Invoke-RestMethod https://api.github.com/repos/defenseunicorns/zarf/releases/latest).tag_name
Start-BitsTransfer -Source "https://github.com/defenseunicorns/zarf/releases/download/$($ZarfVersion)/zarf_$($ZarfVersion)_Windows_amd64.exe" -Destination zarf.exe

You can also install the binary onto your $PATH by moving the downloaded binary to the desired directory and modifying the $PATH environment variable to include that directory.

The following are unofficial methods of installing Zarf that are maintained by the community:

If you want to build the CLI from scratch, you can do that too. Our local builds depend on Go and make.

Terminal window
git clone https://github.com/defenseunicorns/zarf
cd zarf
# build the CLI for your current OS and architecture
make
# see all available make targets
make help

Once you have installed Zarf with one of the above methods, you can verify it is working with the following:

Terminal window
$ zarf version
vX.X.X # X.X.X is replaced with the version number of your specific installation

Terminal window
# if no init package is detected, zarf will prompt you to download the default one on init
$ zarf init
# if you want to download the init package without being prompted
$ zarf tools download-init
$ zarf init --confirm

The default ‘init’ package can also be obtained by visiting the Zarf releases page and downloading it into your working directory or into ~/.zarf-cache/zarf-init-<amd64|arm64>-vX.X.X.tar.zst.