# Install prontaro CLI on Linux

Source: https://prontaro.com/docs/cli/linux/

Get prontaro CLI running on Linux servers and workstations with automatic or manual SHA256 verification and shell completion.

The binary is statically linked for `amd64` and `arm64`, so it runs on both glibc (Ubuntu, Debian, Fedora, RHEL, Arch) and musl (Alpine) distributions.

## Quick install

Run the official installer ([install.sh](https://prontaro.com/install.sh)):

```bash
curl -fsSL https://prontaro.com/install.sh | sh
```

The script verifies the SHA256 checksum and installs `prontaro` into `/usr/local/bin` or `~/.local/bin` (set `PRONTARO_INSTALL_DIR` to choose another directory). If that directory is not on your `PATH`, the script offers to add it to your shell profile and to install shell completion.

To pin a specific release, choose a custom install path, or install for all users into `/usr/local/bin`:

```bash
# Pin a version (use a version from latest.json)
curl -fsSL https://prontaro.com/install.sh | PRONTARO_VERSION=0.2.0 sh

# Custom directory without touching shell profiles (CI / automation)
curl -fsSL https://prontaro.com/install.sh | PRONTARO_INSTALL_DIR=/opt/bin PRONTARO_NO_MODIFY_PATH=1 sh

# Install as root into /usr/local/bin (needed for --system services installed directly as root)
curl -fsSL https://prontaro.com/install.sh | sudo sh
```

If you use Homebrew on Linux (Linuxbrew), you can also install via the official tap:

```bash
brew install prontaro/tap/prontaro
```

## Manual download and SHA256 verification

If you prefer not to pipe the downloaded script directly into `| sh`, fetch the current version from [latest.json](https://dl.prontaro.net/cli/latest.json), download the archive (`amd64` or `arm64`) with `SHA256SUMS`, and verify before extracting:

```bash
VERSION="$(curl -fsSL https://dl.prontaro.net/cli/latest.json | sed -n 's/.*"version"[[:space:]]*:[[:space:]]*"\([^"]*\)".*/\1/p')"
ARCH="amd64" # or arm64

curl -fsSLO "https://dl.prontaro.net/cli/v${VERSION}/prontaro_linux_${ARCH}.tar.gz"
curl -fsSLO "https://dl.prontaro.net/cli/v${VERSION}/SHA256SUMS"
sha256sum -c SHA256SUMS --ignore-missing
```

Expected output: `prontaro_linux_amd64.tar.gz: OK`. Extract and place the binary on your `PATH`:

```bash
mkdir -p ~/.local/bin
tar -xzf "prontaro_linux_${ARCH}.tar.gz" prontaro
install -m 0755 prontaro ~/.local/bin/prontaro
rm prontaro "prontaro_linux_${ARCH}.tar.gz" SHA256SUMS
```

## Sign in and verify

Sign in with `prontaro login` (on a desktop it opens your browser; over SSH or on a headless server it prints a one-time code and approval URL), then check your account and connectivity:

```bash
prontaro version
prontaro login --label prod-edge-1
prontaro status
prontaro doctor
```

Until you open your first tunnel, `Servers :443` in `prontaro doctor` may show `not checked` — that is expected.

See [CLI overview](https://prontaro.com/docs/cli/overview.md) for manual `--token` login, `PRONTARO_KEY` in CI, and [Diagnostics and error codes](https://prontaro.com/docs/cli/errors.md) for every `doctor` check.

## Run as a `systemd` service

To keep tunnels alive after closing SSH and start them automatically on boot, install a user unit and enable linger:

```bash
prontaro service install -- http 3000 --name api
sudo loginctl enable-linger "$USER"
```

See [Background services (Linux & macOS)](https://prontaro.com/docs/cli/service.md) for `--system` units, `--dry-run`, `journalctl`, zero-downtime `systemctl reload`, and multi-tunnel `run` services.

## Update and uninstall

### Update

Update a standalone install in place with `prontaro update`. On Linuxbrew, run `brew upgrade prontaro/tap/prontaro`.

```bash
# Check for a newer version without installing
prontaro update --check

# Update in place (use sudo if installed into /usr/local/bin)
prontaro update
```

Running tunnels and `systemd` units keep the old binary until reloaded or restarted. To switch a `systemd` tunnel service to the new binary without dropping active connections:

```bash
systemctl --user reload prontaro-api
```

### Uninstall

Remove any installed services first (`prontaro service uninstall -- <command>`), then sign out and remove the binary, state directory, and completions:

```bash
prontaro logout
rm -f ~/.local/bin/prontaro
# If installed for all users with sudo:
# sudo rm -f /usr/local/bin/prontaro
rm -rf "${XDG_CONFIG_HOME:-$HOME/.config}/prontaro"
rm -f "${XDG_DATA_HOME:-$HOME/.local/share}/bash-completion/completions/prontaro"
rm -f "${XDG_CONFIG_HOME:-$HOME/.config}/fish/completions/prontaro.fish"
```

## Troubleshooting

- **`prontaro: command not found` after installing without `sudo`:** `~/.local/bin` is not on your `PATH`. Add `export PATH="$HOME/.local/bin:$PATH"` to `~/.bashrc` or `~/.zshrc` and reload your shell.
- **`API :443` fails behind a corporate firewall:** Test with your outbound HTTP proxy: `HTTPS_PROXY=http://proxy.example.com:3128 prontaro doctor`.
- **State directory permissions in `prontaro doctor`:** `prontaro` refuses to read `account.json` or saved tunnel files (`bindings/`) if they are readable by other users. Fix directory (`bindings/`, `locks/` need `+x`) and file modes separately:
  ```bash
  find ~/.config/prontaro -type d -exec chmod 700 {} +
  find ~/.config/prontaro -type f -exec chmod 600 {} +
  ```
- **System service rejected when installed directly as `root` (exit code `7`):** when `service install --system` runs directly as `root` (without `sudo`), `prontaro` requires a binary that non-root users cannot overwrite. Install it into `/usr/local/bin/prontaro` and re-run:
  ```bash
  curl -fsSL https://prontaro.com/install.sh | sudo sh
  ```

## Next steps

- [Open your first HTTPS tunnel in 2 minutes](https://prontaro.com/docs/start/tunnel.md) — expose a local web server over a permanent HTTPS address.
- [Background services (Linux & macOS)](https://prontaro.com/docs/cli/service.md) — full guide to `systemd` units, `journalctl`, `--system`, and updates.
- [prontaro CLI command reference](https://prontaro.com/docs/cli/commands.md) — every subcommand and global flag with terminal examples.
- [Diagnostics and error codes](https://prontaro.com/docs/cli/errors.md) — troubleshooting with `prontaro doctor` and CLI exit codes.
