# Install the CLI

Install the CLI on your online computer and copy a Linux binary to your offline machine.

Source: https://debark.dev/docs/get-started/installation

---
The executable is named `debark`. Install it on your online computer to prepare bundles,
then copy a Linux binary to the offline machine to install them.

For the GUI, see [desktop app setup](/download#desktop).

## Install a package

Published CLI downloads and hashes: https://debark.dev/download#cli. The Linux installer checks SHA-256 and installs to ~/.local/bin without sudo.

**Linux**

```bash
curl -fsSL https://debark.dev/install.sh | sh
export PATH="$HOME/.local/bin:$PATH"
debark version
```

**Windows (after downloading and verifying the ZIP)**

```powershell
# After downloading and verifying the Windows CLI archive
Expand-Archive .\debark_0.1.1_windows_amd64.zip -DestinationPath .\debark-cli
.\debark-cli\debark.exe version
```

**Go / source (Go 1.26.8+; macOS has no published binary or CI)**

```bash
go install github.com/inferops/debark/cmd/debark@latest
```


The [download page](/download#cli) lists published Linux amd64/arm64 and Windows amd64
archives, Linux `.deb` / `.rpm` packages, file sizes, and SHA-256 hashes. Use the
[release verification guide](/docs/trust/release-downloads) to check manual downloads.

On Debian or Ubuntu, install a downloaded CLI `.deb` with `sudo apt install ./FILENAME.deb`.
On an RPM-based builder, use `sudo dnf install ./FILENAME.rpm`. Replace `FILENAME` with
the verified package you downloaded. RPM packaging does not add RPM bundle support.

## Linux installer

The installer at [debark.dev/install.sh](/install.sh) detects amd64 or arm64, downloads
the latest stable CLI release from `inferops/debark`, and checks its published SHA-256.
It stops if the download or checksum check fails. It installs only the CLI, into
`$HOME/.local/bin`, without sudo, shell-profile edits, or an update service.

It needs `curl`, CA certificates, `sha256sum`, `tar`, `awk`, `mktemp`, and `install`.
On a minimal Debian or Ubuntu builder, install prerequisites with
`sudo apt install ca-certificates curl coreutils tar gawk`.

To read the script before running it, pin a version, and select a writable directory:

```bash
curl -fsSL https://debark.dev/install.sh -o install.sh
less install.sh
sh install.sh --version v0.1.1 --bin-dir "$HOME/.local/bin"
export PATH="$HOME/.local/bin:$PATH"
debark version
```

Add the `export PATH` line to your shell profile if that directory is not already on PATH.
For a system-wide copy that `sudo debark` can find, run:

```bash
sudo install -m 755 "$HOME/.local/bin/debark" /usr/local/bin/debark
```

Rerun the installer to update, or use `--version` to choose a specific stable release.
Run `sh install.sh --help` for options. The script verifies download integrity against
the release checksum file; it does not verify the publisher's Sigstore signature.
For that additional check, follow [release verification](/docs/trust/release-downloads).

The offline machine cannot use a network installer. Transfer its matching Linux binary
as described [below](#copy-to-the-offline-machine).

## Build the binary

You need Git and Go 1.26.8 or newer on the computer you build it on.

With Go already installed, the shortest source installation is:

```bash
go install github.com/inferops/debark/cmd/debark@latest
debark version
```

Add `GOBIN`, or `$(go env GOPATH)/bin` when `GOBIN` is unset, to PATH first.
Use a release tag instead of `@latest` to pin a version. macOS has no published
binary or CI coverage; its container build workflow is unvalidated.

To build from a checkout:

On Linux or macOS:

```bash
git clone https://github.com/inferops/debark.git
cd debark
CGO_ENABLED=0 go build -trimpath ./cmd/debark
./debark version
```

<details>
<summary>Windows (PowerShell)</summary>

```powershell
git clone https://github.com/inferops/debark.git
cd debark
$env:CGO_ENABLED = '0'
go build -trimpath ./cmd/debark
.\debark.exe version
```

</details>

Put the resulting binary on your `PATH` so you can run `debark` from any directory.
For example, on Linux:

```bash
sudo install -m 755 debark /usr/local/bin/debark
```

## Copy to the offline machine

The offline machine needs a Linux binary matching its architecture. A Windows or macOS
executable will not run there. Check the target with `dpkg --print-architecture`.

If you installed or built the CLI on a Linux computer with the same architecture, copy that
binary over. You can also download the matching Linux archive from
[GitHub Releases](https://github.com/inferops/debark/releases) on the online computer
and extract its `debark` binary.

After copying a binary named `debark` to the offline machine, install it there:

```bash
sudo install -m 755 debark /usr/local/bin/debark
debark version
```

### Build a Linux binary yourself

Run this from the CLI source directory to build for Linux amd64:

On Linux or macOS:

```bash
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -trimpath \
  -o debark-linux-amd64 ./cmd/debark
```

<details>
<summary>Windows (PowerShell)</summary>

```powershell
$env:CGO_ENABLED = '0'
$env:GOOS = 'linux'
$env:GOARCH = 'amd64'
go build -trimpath -o debark-linux-amd64 ./cmd/debark
Remove-Item Env:GOOS, Env:GOARCH
```

</details>

Use `arm64` instead of `amd64` for an ARM64 target. You can check the target with
`dpkg --print-architecture`.

Copy the binary to the offline machine, then install it there:

```bash
sudo install -m 755 debark-linux-amd64 /usr/local/bin/debark
debark version
```

## What runs where

- **Snapshot and install:** on the Debian or Ubuntu target. Installation needs root.
- **Build bundles:** on the online computer. Use native apt when it matches the target release,
  or Docker / Podman for a different release.
- **Verify and inspect:** on any computer that can run the CLI.

Linux is the main platform. The CLI builds on Windows and macOS, but their container-based
build workflows have limited testing. They also need a Linux helper binary; see
[container setup](/docs/concepts/backends) and the [platform table](/docs/get-started/supported-systems#online-computer).

## Start a build

On the online computer, run `debark build --interactive` to choose a target and packages
through prompts. You can select a baseline OS without taking a snapshot first.

See the [interactive CLI guide](/docs/get-started/interactive), or
[build with a baseline OS](/docs/get-started/no-target-machine) using explicit options.

<NextSteps
  items={[
    {
      title: 'Quickstart',
      href: '/docs/get-started/quickstart',
      description: 'Build and install your first package bundle.',
    },
    {
      title: 'Desktop app',
      href: '/docs/get-started/desktop',
      description: 'Prepare bundles with the GUI on Linux.',
    },
  ]}
/>
