# Install snapdir ships as a single static binary named `snapdir` with zero runtime dependencies — all hashing and storage happen in-process, so there is nothing to install alongside it. Pick whichever route fits your environment; both give you the same `snapdir` command. ## Install with cargo If you have a Rust toolchain (1.91.1 or newer), install snapdir from crates.io: ```sh cargo install snapdir ``` This compiles and places `snapdir` in `~/.cargo/bin`. Make sure that directory is on your `PATH` (the Rust installer normally adds it for you). To upgrade later, re-run the same command with `--force`: ```sh cargo install snapdir --force ``` ## Install a prebuilt release archive Every tagged release publishes prebuilt, per-platform archives on GitHub — no Rust toolchain required. Grab the archive for your platform from the releases page: - Archives are named `snapdir--.tar.xz` and each ships with a matching `.sha256` checksum file. Prebuilt targets: | Platform | Target triple | | --- | --- | | Linux x86_64 (glibc) | `x86_64-unknown-linux-gnu` | | Linux x86_64 (static musl) | `x86_64-unknown-linux-musl` | | Linux aarch64 (glibc) | `aarch64-unknown-linux-gnu` | | Linux aarch64 (static musl) | `aarch64-unknown-linux-musl` | | macOS x86_64 (Intel) | `x86_64-apple-darwin` | | macOS aarch64 (Apple Silicon) | `aarch64-apple-darwin` | The `*-musl` builds are fully static and link hermetically — handy for containers and minimal or restricted environments. Download, verify the checksum, unpack, and put the binary on your `PATH`. For example, on Linux x86_64 with the static musl build: ```sh version=1.9.0 target=x86_64-unknown-linux-musl base="https://github.com/snapdir/snapdir/releases/download/v${version}" # Download the archive and its checksum curl -LO "${base}/snapdir-${version}-${target}.tar.xz" curl -LO "${base}/snapdir-${version}-${target}.tar.xz.sha256" # Verify integrity (exits non-zero on mismatch) shasum -a 256 -c "snapdir-${version}-${target}.tar.xz.sha256" # Unpack and install tar -xJf "snapdir-${version}-${target}.tar.xz" sudo install "snapdir-${version}-${target}/snapdir" /usr/local/bin/snapdir ``` Each archive also bundles the [`snapdir-ssh-store` and `snapdir-sftp-store` binaries](#optional-ssh-and-sftp-store-binaries), the `LICENSE`, `CHANGELOG.md`, shell completions (`completions/`), and a man page (`man/snapdir.1`). ## Optional: SSH and SFTP store binaries To use the [`ssh://` and `sftp://` stores](guide/stores.md#ssh-and-sftp-stores), the `snapdir-ssh-store` and `snapdir-sftp-store` binaries must also be on your `PATH`. The prebuilt release archives already include both; with cargo, install them from their own crate: ```sh cargo install snapdir-ssh-store ``` They drive your system OpenSSH client (version 8.5 or newer required), so there is nothing else to configure — your existing `~/.ssh/config`, keys, and agent keep working. If you only use the `file://` and cloud stores, you can skip them. ## Use snapdir as a library snapdir is also available as a Rust crate if you want to embed snapshotting in your own program: ```sh cargo add snapdir-core ``` ## Verify the install Confirm the binary is on your `PATH` and prints its version: ```sh snapdir version ``` You should see version `1.9.0`. You can also run `snapdir --help` to list every subcommand. To generate shell completions from an installed binary, use [`snapdir autocomplete`](reference/snapdir-autocomplete.md): ```sh eval "$(snapdir autocomplete zsh)" ``` ## Next steps Head to the [Quickstart](quickstart.md) for a 60-second, no-setup round-trip: snapshot a directory, push it to a local store, and pull it back byte-for-byte verified.