Installation
Dagger needs a container runtime. Docker works out of the box; Podman, nerdctl, and Apple Container also work.
Install the Dagger CLI
The commands below install Dagger v0.21.4, the version this documentation covers.
- macOS
- Linux
- Windows
curl -fsSL https://dl.dagger.io/dagger/install.sh | DAGGER_VERSION=0.21.4 BIN_DIR=/usr/local/bin sh
If your user can't write to /usr/local/bin, run the script with sudo -E:
curl -fsSL https://dl.dagger.io/dagger/install.sh | DAGGER_VERSION=0.21.4 BIN_DIR=/usr/local/bin sudo -E sh
curl -fsSL https://dl.dagger.io/dagger/install.sh | DAGGER_VERSION=0.21.4 BIN_DIR=$HOME/.local/bin sh
Make sure $HOME/.local/bin is in your PATH. To install system-wide instead, set BIN_DIR=/usr/local/bin and run the script with sudo -E:
curl -fsSL https://dl.dagger.io/dagger/install.sh | DAGGER_VERSION=0.21.4 BIN_DIR=/usr/local/bin sudo -E sh
In PowerShell 7 or later:
iwr -useb https://dl.dagger.io/dagger/install.ps1 | iex; Install-Dagger -DaggerVersion 0.21.4 -AddToPath
This installs dagger.exe in %USERPROFILE%\dagger and adds it to your user PATH.
Verify the installation:
dagger version
# version: v0.21.4
To upgrade or switch versions, re-run the install command with the version you want.
Package managers
Homebrew and winget carry the latest stable release only, which may differ from the version this documentation covers.
- macOS
- Windows
brew install dagger/tap/dagger
winget install Dagger.Cli
To run v0.21.4 from a package-managed CLI, set DAGGER_X_RELEASE or pass --x-release. The CLI builds and caches that release on first use, then runs as that version:
# Every command in this shell session
export DAGGER_X_RELEASE=v0.21.4
dagger version
# Or per command
dagger --x-release=v0.21.4 version
Unset the variable or drop the flag to return to the installed version. Commands in this documentation omit the prefix and assume the matching release is active.