Enroll a device on your account
Enrollment is the one-time step that binds a device to your account. The install code is the primary path: create it in the panel, pass it to the installer, and the daemon exchanges it with the backend for a saved credential, which it reuses from then on. The backend assigns the device its identity at redemption, so one code can enroll several devices. The legacy per-device flow, an app ID plus a matching single-use code, still works unchanged. This page covers both.
The install code
Create an install code in the panel, under Install keys. It is shown once, so copy it right away, then pass it to the installer as an environment variable:
| Variable | Purpose |
|---|---|
PZ_ENROLL_CODE | The install code from the panel. On its own it is enough for a fresh enrollment. |
PZ_APP_ID | Legacy and optional: only needed together with an older per-device code (see below). |
curl -fsSL https://poisonzero.com/install.sh | sudo \ PZ_ENROLL_CODE="your-install-code" sh
What the installer writes
The installer drops a small enroll file, then runs the daemon's enroll command. The daemon writes the credential it will reuse from then on:
| File | Location | Contents |
|---|---|---|
enroll | Config dir (Linux /etc/poisonzero, macOS Application Support, Windows ProgramData) | JSON { code }, plus appId for the legacy pairing; mode 0600, consumed once at enroll |
credentials | Data dir (Linux /var/lib/poisonzero, macOS Application Support, Windows ProgramData) | The device identity and a refresh token, assigned by the backend at redemption; reused across restarts |
license.id | Data dir | The Enterprise device binding (seat); absent on Pro |
credentials file is what marks a device already enrolled. A plain upgrade that finds it skips enrollment and only swaps the binary.The enroll command
poisonzero enroll takes no flags; it reads the enroll file and drives the exchange:
- Reads the enroll file and requires the install code; an app ID, if present, is sent alongside it for the legacy pairing.
- Posts the code, the app ID (if given), platform and version to the backend enroll endpoint.
- On success, the backend assigns the device its identity; the daemon exchanges the returned token for a refresh token and writes it to
credentials. - Persists the device mode (cloud or private) and, on Enterprise, the license id.
Redemptions, seats and licenses
Two limits apply independently: how many times a code can be redeemed, and how many devices your account allows:
| Concept | Meaning |
|---|---|
| Redemption cap | The maximum number of devices one install code can enroll, set when you create it in the panel |
| Legacy code | Tied to a single app; marked used after the first successful enroll, exactly as before |
| Seat / device slot | Each enrolled device counts against your account's device limit, whichever code enrolled it |
| Pro device limit | Pro accounts are capped at a fixed number of active devices; enrolling past the limit is refused with a device-limit error |
| License id | Enterprise devices carry a license id (license.id); Pro devices carry none |
The legacy per-device flow
Creating a device in the panel still works exactly as before, for older installers or scripted integrations that expect an app ID:
- Creating a device in the panel mints an app ID and a matching single-use code.
- Pass both to the installer:
PZ_APP_IDandPZ_ENROLL_CODE. - The code is tied to that one app and is marked used after the first successful enroll.
Re-enrolling
Running the installer again with a fresh install code re-enrolls the device cleanly:
| Mode | Trigger | Effect |
|---|---|---|
| Fresh | No credentials file | Enrolls for the first time |
| Re-enroll | credentials present and a new PZ_ENROLL_CODE is passed | Replaces the credential cleanly; on failure the old credential is kept |
| Upgrade | credentials present, no PZ_ENROLL_CODE | Swaps the binary only; enrollment is skipped |
PZ_ENROLL_CODE is required to re-enroll. PZ_APP_ID on its own, with no code, is ignored and the run is treated as a plain upgrade.curl -fsSL https://poisonzero.com/install.sh | sudo \ PZ_ENROLL_CODE="a-fresh-code" sh
$env:PZ_ENROLL_CODE="a-fresh-code" iwr https://poisonzero.com/install.ps1 -UseBasicParsing | iex
Read next
Where the code is used at rollout: installing PoisonZero. What cloud versus private changes after enroll: cloud or private. Provision a fleet without hands: the management API.
An install code binds a device to your account.
Create it once in the panel, run one command, and enroll every device that code allows. Free for Linux, macOS and Windows.
Sign me up