Installation
Homebrew (macOS and Linux)
brew install dynatrace-oss/tap/dtctl
This installs the binary and sets up shell completions automatically.
Shell Script (macOS and Linux)
If you don’t use Homebrew:
curl -fsSL https://raw.githubusercontent.com/dynatrace-oss/dtctl/main/install.sh | sh
This downloads the latest release, extracts it to ~/.local/bin (Linux) or /usr/local/bin (macOS), and verifies the installation. Override the install directory with DTCTL_INSTALL_DIR:
curl -fsSL https://raw.githubusercontent.com/dynatrace-oss/dtctl/main/install.sh | DTCTL_INSTALL_DIR=~/bin sh
Windows (PowerShell)
irm https://raw.githubusercontent.com/dynatrace-oss/dtctl/main/install.ps1 | iex
This downloads the latest release, extracts it to %LOCALAPPDATA%\dtctl, and adds it to your PATH. Restart your terminal afterwards.
Manual install: Download the zip for your architecture from the releases page, extract it, and add the directory to your PATH. See the Windows guide for detailed steps, PowerShell tips, and troubleshooting.
Binary Download (Manual)
Download a pre-built binary from the GitHub releases page.
Linux/macOS:
# Extract the archive
tar -xzf dtctl_*.tar.gz
# Make it executable
chmod +x dtctl
# macOS only: remove quarantine attribute
sudo xattr -r -d com.apple.quarantine dtctl
# Move to a directory in your PATH
sudo mv dtctl /usr/local/bin/
# Verify
dtctl version
Building from Source
Requires Go 1.24+, Git, and Make.
git clone https://github.com/dynatrace-oss/dtctl.git
cd dtctl
make build
./bin/dtctl version
To install system-wide:
make install # installs to $GOPATH/bin
# or
sudo cp bin/dtctl /usr/local/bin/
Ensure $GOPATH/bin is in your $PATH:
export PATH="$PATH:$(go env GOPATH)/bin"
Shell Completion
Enable tab completion for faster workflows.
Bash
dtctl completion bash > /tmp/dtctl-completion.bash
sudo mkdir -p /etc/bash_completion.d
sudo cp /tmp/dtctl-completion.bash /etc/bash_completion.d/dtctl
source ~/.bashrc
Zsh
mkdir -p ~/.zsh/completions
dtctl completion zsh > ~/.zsh/completions/_dtctl
# Add to ~/.zshrc (if not already present)
echo 'fpath=(~/.zsh/completions $fpath)' >> ~/.zshrc
echo 'autoload -U compinit && compinit' >> ~/.zshrc
rm -f ~/.zcompdump*
source ~/.zshrc
oh-my-zsh users: place the file in ~/.oh-my-zsh/completions/_dtctl instead.
Fish
mkdir -p ~/.config/fish/completions
dtctl completion fish > ~/.config/fish/completions/dtctl.fish
PowerShell
# Add to your PowerShell profile ($PROFILE):
dtctl completion powershell | Out-String | Invoke-Expression
Updating
# Homebrew
brew update && brew upgrade dtctl
# Shell script (re-run)
curl -fsSL https://raw.githubusercontent.com/dynatrace-oss/dtctl/main/install.sh | sh
# From source
git pull && make build
Windows:
irm https://raw.githubusercontent.com/dynatrace-oss/dtctl/main/install.ps1 | iex
Uninstalling
# Homebrew
brew uninstall dtctl
brew untap dynatrace-oss/tap # optional
# Manual install
sudo rm /usr/local/bin/dtctl
# Remove configuration (optional)
rm -rf ~/.config/dtctl # Linux
rm -rf ~/Library/Application\ Support/dtctl # macOS
Troubleshooting
“command not found: dtctl”
The binary is not in your PATH. Either use the full path (./bin/dtctl) or add the binary’s directory to your PATH:
export PATH="$PATH:/path/to/dtctl/bin"
“permission denied”
Make the binary executable:
chmod +x dtctl
macOS: “Apple could not verify dtctl is free of malware”
This is expected for unsigned open-source binaries. Remove the quarantine attribute:
sudo xattr -r -d com.apple.quarantine dtctl
Or allow it via System Settings > Privacy & Security > Allow Anyway.
“exec format error”
You’re running a binary built for a different OS/architecture (e.g., a Linux binary on macOS). Rebuild for your platform:
make clean && make build
For Apple Silicon Macs, target darwin/arm64. For Intel Macs, target darwin/amd64.
Windows: “dtctl is not recognized”
The binary is not in your PATH. Restart your terminal after installation, or check your PATH:
$env:Path -split ';' | Select-String dtctl
See the Windows guide for more Windows-specific troubleshooting.
Next: Quick Start – set up your first environment and run your first commands.