# Install and connect a server
Source: https://shld.app/docs/install · Updated 2026-11-30 · Synced from shld cb495f9f

> Install shld by hand. Check the signed release yourself, install the service, approve the server, and confirm monitoring works.


This guide installs shld step by step, so you can check each file before it runs. If you prefer one command that does the same checks, use [Install shld with one command](/guides/install-with-one-command). You need a shld account and the folder you want shld to watch.

## Prerequisites

You need:

- A Linux host with `sudo` access and outbound HTTPS access
- An `x86_64` host for amd64, or an `aarch64` or `arm64` host for arm64
- systemd 245 or later for the supplied service (Ubuntu 20.04 or later, Debian 11 or later), and systemd 247 or later for managed device authorization
- `curl`, OpenSSL, `sha256sum`, and `tar` for manual release verification
- An approved existing collection directory and authorization to enable the service
- A shld account for browser approval. Signing in at app.shld.app with a new email creates a free one.

Check the target and any existing binary before making changes:

```sh
uname -s
uname -m
command -v shld
shld version
shld --help
```

For an existing installation, record the running state, unit, drop-ins, watched folder, and physical state path. Preserve `/var/lib/private/shld` or a legacy `/var/lib/private/shld/state` tape. If an older binary lacks `auth` or `status`, move it to the current release with the reviewed installer upgrade first; see [Installer upgrades differ](/docs/updates#installer-upgrades-differ).

From `v0.1.0-pilot.20261109.1` onward, `sudo shld update --release VERSION` supports the verified binary-only update path. `v0.1.0-pilot.20261028.2` has no `update` command; releases with the earlier updater through `v0.1.0-pilot.20261103.1` refuse with exit 4 and require the reviewed installer upgrade. Each release lists the versions it updates from in `update_compatibility.from` of its signed `RELEASE.json`. `v0.1.0-pilot.20261125.1` accepts only `v0.1.0-pilot.20261123.3` on amd64. `v0.1.0-pilot.20261123.3` accepts only `v0.1.0-pilot.20261123.2`, which accepts only `v0.1.0-pilot.20261123.1`, on amd64 or arm64. `v0.1.0-pilot.20261123.1` accepts only `v0.1.0-pilot.20261120.1` on amd64, which accepts only `v0.1.0-pilot.20261113.1` on amd64, which accepts only `v0.1.0-pilot.20261112.1` on amd64. `v0.1.0-pilot.20261112.1` accepts no update source: its service unit adds resource limits, and `shld update` replaces only the binary. An arm64 host, or an amd64 host on a release before `v0.1.0-pilot.20261112.1`, moves to the current release once with the reviewed installer upgrade.

## Download and verify the release

Download from the immutable release prefix on `downloads.shld.app`. The current release is `v0.1.0-pilot.20261125.1` at `https://downloads.shld.app/prereleases/v0.1.0-pilot.20261125.1/` and the key `shld-release-rsa3072-20261109.pub.pem`.

Create a fresh private directory and download only the matching archive and verification files:

```sh
set -eu
umask 077
download_dir=$(mktemp -d)
cd "$download_dir"
case "$(uname -m)" in
  x86_64) arch=amd64 ;;
  aarch64|arm64) arch=arm64 ;;
  *) echo 'Unsupported architecture' >&2; exit 1 ;;
esac
release_url=https://downloads.shld.app/prereleases/v0.1.0-pilot.20261125.1
for name in SHA256SUMS SHA256SUMS.sig shld-release-rsa3072-20261109.pub.pem "shld-linux-$arch.tar.gz"; do
  curl --fail --proto '=https' --tlsv1.2 --connect-timeout 10 --max-time 120 --output "$name" "$release_url/$name"
done
```

The fingerprint below covers the public SPKI DER bytes. This page and the one-command installer publish the same value, and both come from shld.app, so they count as one source. If you received the fingerprint through another channel, compare that copy too.

```text
61438bf49a5b8aee940e0b55cdafe0888bd7d43f2f1251016edb9d4634bf1a42
```

Verify the key, its signature over the exact `SHA256SUMS` bytes, and the selected archive checksum:

```sh
openssl pkey -pubin -in shld-release-rsa3072-20261109.pub.pem -outform DER -out release-key.der
fingerprint=$(openssl dgst -sha256 release-key.der | sed 's/^.*= //')
test "$fingerprint" = 61438bf49a5b8aee940e0b55cdafe0888bd7d43f2f1251016edb9d4634bf1a42
openssl dgst -sha256 -verify shld-release-rsa3072-20261109.pub.pem -signature SHA256SUMS.sig SHA256SUMS
test -f "shld-linux-$arch.tar.gz"
grep -E "^[0-9a-f]{64}  shld-linux-$arch\\.tar\\.gz$" SHA256SUMS > selected-checksum.txt
test "$(wc -l < selected-checksum.txt | tr -d ' ')" = 1
sha256sum --check selected-checksum.txt
```

Stop on any mismatch. Before extraction, refuse links and special files, and refuse any member outside the versioned directory. The directory name carries the release, so this check also rejects an older signed archive served under the new address.

```sh
if tar -tvzf "shld-linux-$arch.tar.gz" | cut -c1 | grep -qv '^[-d]$'; then echo 'Archive holds links or special files' >&2; exit 1; fi
if tar -tzf "shld-linux-$arch.tar.gz" | grep -qv "^shld-v0.1.0-pilot.20261125.1-linux-$arch/"; then echo 'Unexpected archive member' >&2; exit 1; fi
tar -xzf "shld-linux-$arch.tar.gz"
cd "shld-v0.1.0-pilot.20261125.1-linux-$arch"
shld_version=$(./bin/shld version)
printf '%s\n' "$shld_version"
./bin/shld --help
```

Require `auth login`, `auth status`, and `status` in the command help. Installation needs no Python, Go compiler, or build tools.

## Install the service

Keep private state outside the watched folder. Review `scripts/install.sh` and `deploy/shld.service`, then run the installer from the extracted release directory:

```sh
sudo ./scripts/install.sh --binary ./bin/shld --systemd --root /srv/application
```

Replace `/srv/application` with the approved directory. A server with no app directory still needs a root: create an empty one with `sudo install -d -m 0755 /usr/local/share/shld/no-app-directory` and use it. shld checks installed OS packages, SSH logins, processes and connections outside the root. The installer copies the binary and unit, creates a mode-`0600` environment file for a new service, and reloads systemd. It preserves an existing `/etc/shld/shld.env`. It does not enable or start `shld.service`. On a new installation it turns on daily automatic updates (`shld-update.timer`); `sudo shld update auto disable` turns them off.

Review the effective unit, root, state, and loopback address. The supplied service uses `/usr/local/bin/shld`, state `/var/lib/private/shld`, and `127.0.0.1:8099`. After authorization for enablement and startup, run:

```sh
sudo systemctl enable --now shld.service
```

## Connect through browser approval

Start authorization on the server:

```sh
sudo shld auth login
```

Run `sudo shld auth login`; the request goes to `https://api.shld.app`, the service every account uses. Only a company with a dedicated instance names its own address, with `sudo shld auth login --server <address>`. Open the displayed URL, sign in, enter the server code, and review the server, company, recipients, and restart notice. Select **Connect server**.

The CLI saves a private host credential. A recognized running service restarts once, and a stopped service stays stopped. Watched folder, state, evidence settings, and enablement stay unchanged.

For a setup run by an AI assistant, use `sudo shld auth login --json --non-interactive`. `authorization_required` exits 2 and returns `verification_uri`, `user_code`, `expires_at`, and `next_action`. Run the same command after approval to redeem the pending request.

## Check the result

Check authorization and monitoring as separate facts:

```sh
sudo shld auth status --json
sudo shld status --json
```

Inspect service state, local API state, last scan, coverage limits, and notification state. A zero exit from `status` does not prove active monitoring. The first valid heartbeat queues a labeled connection-check email. Provider acceptance does not prove inbox receipt, so confirm the message with the intended recipient.

## Limits

Custom units, unknown state layouts, unsupported architectures, and missing verified releases require operator review. QA covered the earlier Linux arm64 unit on systemd 255; login and credential delivery under the current hardened unit, systemd 247, and custom units remain unverified. Real-inbox delivery also remains unverified.

## Related

- [Supported systems](/docs/supported-systems)
- [Update and roll back shld](/docs/updates)
- [CLI reference](/docs/cli)
- [Limits and coverage](/limits)
