> ## Documentation Index
> Fetch the complete documentation index at: https://docs.corporatelabs.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Linux systemd

> Keep clabs discover running on a Linux host with systemd.

Use systemd when a machine should keep reporting without an interactive shell.
Installers still **only place** the binary — you enable the unit yourself.

Published units and a longer checklist live at
[install.corporatelabs.ai/LINUX.md](https://install.corporatelabs.ai/LINUX.md).

## User service (no root)

```bash theme={null}
curl -fsSL https://install.corporatelabs.ai/install.sh | sh
mkdir -p ~/.config/clabs ~/.config/systemd/user

cat > ~/.config/clabs/env <<'EOF'
CLABS_ACCESS_KEY=clt_…
EOF
chmod 600 ~/.config/clabs/env

curl -fsSL https://install.corporatelabs.ai/systemd/clabs-user.service \
  -o ~/.config/systemd/user/clabs.service

systemctl --user daemon-reload
systemctl --user enable --now clabs.service
systemctl --user status clabs.service
```

Optional: `loginctl enable-linger "$USER"` so the service survives logout.

## System service (root)

```bash theme={null}
curl -fsSL https://install.corporatelabs.ai/install.sh \
  | CLABS_INSTALL_DIR=/usr/local/bin sudo -E sh

sudo install -d -m 0755 /etc/clabs
sudo tee /etc/clabs/env >/dev/null <<'EOF'
CLABS_ACCESS_KEY=clt_…
EOF
sudo chmod 600 /etc/clabs/env

curl -fsSL https://install.corporatelabs.ai/systemd/clabs.service \
  | sudo tee /etc/systemd/system/clabs.service >/dev/null

sudo systemctl daemon-reload
sudo systemctl enable --now clabs.service
```

## Notes

* These units run **`clabs run`** (discover loop).
* **Intercept** (MITM) is meant for a job or session — do not put it in a standing unit.
* After start, confirm rows in console **Events** / **Hosts**.
