Developers and system administrators testing RESTful APIs or debugging web services often turn to xh, a lightweight, blazingly fast command-line HTTP client written in Rust that provides the friendly syntax of HTTPie with native binary performance. On freshly deployed cloud VPS instances or minimal docker images, running the tool fails with bash: xh: command not found.
Install xh via Distribution Package Repositories
Install xh directly using native Linux package managers where available:
- Arch Linux:
sudo pacman -S xh - Alpine Linux:
sudo apk add xh - Void Linux:
sudo xbps-install -S xh - Debian / Ubuntu: Install via Homebrew:
brew install xh
Download Official GitHub Release Binary
For Debian, Ubuntu, Fedora, or RHEL distributions without third-party package managers, fetch the official standalone binary release:
curl -sL https://raw.githubusercontent.com/ducaale/xh/master/install.sh | sh
Alternatively, download and extract the static tarball manually:
XH_VER=$(curl -s https://api.github.com/repos/ducaale/xh/releases/latest | grep 'tag_name' | cut -d '"' -f 4)
curl -sL "https://github.com/ducaale/xh/releases/download/${XH_VER}/xh-${XH_VER}-x86_64-unknown-linux-musl.tar.gz" | tar -xz
sudo mv "xh-${XH_VER}-x86_64-unknown-linux-musl/xh" /usr/local/bin/
sudo chmod +x /usr/local/bin/xh
Install via Rust Cargo
If you have the Rust development toolchain configured on the machine:
cargo install xh
Confirm the binary is accessible by running xh --version or making a sample request via xh httpbin.org/json.