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

# Add device

This page explains the two supported ways to register a new device (agent) with your Insaion workspace:

* Manual pairing using a short-lived pairing token (good for single devices and testing).
* Enrollment keys created under Settings > Enrollment Keys (persistent keys for automated and bulk installs).

Both methods use the same Linux installation flow: you run the dashboard-generated install command on the target machine, the installer sets up the `insaion-agent` systemd service, and the device either registers automatically or waits for a pairing token. Choose the approach that fits your deployment: use pairing tokens for one-off or developer machines, and enrollment keys for production fleets and automated installs.

## Pairing token

The pairing token is a short-lived token generated from the dashboard when you choose Manual Pairing on the Add new device page. It is intended for interactive, single-device registration and expires after a short period. Treat pairing tokens like one-time secrets: copy and paste them only into the device UI and do not store them in public locations.

**When to use**

* Setting up a single robot or test device.
* Demonstrations and debugging where you want to manually confirm the device identity.

**Steps**

1. In the Insaion dashboard go to Devices → Add Device and choose Pairing Token.
2. Copy the generated Linux installation command and run it on the target machine.

```bash theme={null}
curl -fsSL https://get.insaion.com/setup.sh | sudo bash
```

3. Wait for the installer to finish. It installs and starts the `insaion-agent` systemd service automatically.
4. Open the agent's local web UI on the device at `http://localhost:9090` or from another machine at `http://[ROBOT_IP]:9090`.
5. Back in the dashboard, click Generate Pairing Token and copy the token that appears. Note: tokens are time-limited.
   <img src="https://mintcdn.com/insaion/dkLh615XOmGRTVSX/assets/devices/add-device-pairing-token.png?fit=max&auto=format&n=dkLh615XOmGRTVSX&q=85&s=c55642829fbb85a0255eb34f65c191e4" alt="Pairing token dialog" width="2940" height="1050" data-path="assets/devices/add-device-pairing-token.png" />
   <img src="https://mintcdn.com/insaion/_EjWRpi818l6Nv0B/assets/agent/agent-web-server.png?fit=max&auto=format&n=_EjWRpi818l6Nv0B&q=85&s=a1306763b57fd1b8f28c31f13e75d036" alt="Agent local UI" width="823" height="622" data-path="assets/agent/agent-web-server.png" />
6. Paste the pairing token into the pairing field and click Register.
7. If the token is valid the agent will register and the device will appear on the Devices page.

**Security notes**

* Pairing tokens are ephemeral and should be used only interactively. They are not suitable for automated deployments.
* If a token is accidentally exposed, it will expire quickly; there is no additional secret to rotate for this method.

## Enrollment key

Enrollment keys are persistent secrets that you create and manage under Settings → Enrollment Keys. They are designed for automated and bulk device registration during agent install or startup (for example, as part of a bootstrap script or container environment). Enrollment keys are treated like API keys: protect them, rotate them periodically, and scope or label them so you can audit which batch of devices used which key.

**When to use**

* Automated provisioning of many devices or robots.
* CI/CD or image-based installs where the agent should register itself without human intervention.

**Steps**

1. In the Insaion dashboard go to Settings → Enrollment Keys and create a new enrollment key. Optionally add a descriptive name to track its purpose.
2. Copy the key value (store it securely; treat it as a secret). Note that the key will only be shown once at creation.
   <img src="https://mintcdn.com/insaion/dkLh615XOmGRTVSX/assets/devices/add-device-enrollment-key.png?fit=max&auto=format&n=dkLh615XOmGRTVSX&q=85&s=7995bee9f0c8b43a97ea876d28cdb245" alt="Create enrollment key" width="2940" height="1606" data-path="assets/devices/add-device-enrollment-key.png" />
3. In Devices → Add Device choose Enrollment Key, paste the key into the wizard, and copy the generated Linux installation command.

Example:

```bash theme={null}
curl -fsSL https://get.insaion.com/setup.sh | sudo ENROLLMENT_KEY="your-enrollment-key-here" bash
```

4. Run the command on the target Linux machine.
5. The installer writes the enrollment key to `/etc/default/insaion-agent`, installs the `insaion-agent` systemd service, and starts it.
6. The agent uses the enrollment key to authenticate and register automatically. The device should appear in the Devices page shortly after successful registration.

## Troubleshooting

* Enrollment key rejected: verify you copied the key exactly and that the key is still active (not revoked or expired).
* Automated install not registering: confirm the `ENROLLMENT_KEY` is present in `/etc/default/insaion-agent` and that the device can reach the Insaion backend over the network.
* Pairing page not opening: verify the service is running with `sudo systemctl status insaion-agent`.
* Check agent logs for detailed error messages about enrollment or connectivity with `sudo journalctl -u insaion-agent -f`.

## Security and lifecycle

* Treat enrollment keys like secrets. Store them in a secrets manager or environment variables that are not checked into source control.
* Rotate keys periodically and revoke keys that are no longer needed. After revocation, devices that registered with a revoked key will continue to operate normally; revocation prevents new enrollments with that key.
* Use descriptive names when creating keys so you can identify which deployment or image used each key.

## Differences at a glance

* Pairing token: short-lived, single-use style flow. Best for manual, interactive registration and debugging.
* Enrollment key: persistent, intended for automated or bulk registration. Best for production fleets and scripted installs.

## Best practices

* Use enrollment keys for production deployments; label and rotate them regularly.
* Use pairing tokens for development, testing, or when you must avoid embedding a secret on the device.
* Limit distribution of keys and tokens. Prefer ephemeral tokens when handing a device temporarily to an external contractor.
* Monitor and audit the Devices page and enrollment key usage regularly.

<div className="insaion-footer" role="contentinfo">
  <div className="insaion-footer__card">
    <div className="insaion-footer__content">
      <span className="insaion-footer__icon" aria-hidden="true">
        <svg viewBox="0 0 24 24" width="20" height="20" aria-hidden="true" focusable="false" className="insaion-footer__svg" role="img">
          <path fill="currentColor" d="M21 6.5A3.5 3.5 0 0 0 17.5 3h-11A3.5 3.5 0 0 0 3 6.5v5A3.5 3.5 0 0 0 6.5 15H8v3l3-3h6.5A3.5 3.5 0 0 0 21 11.5v-5zM7 8.5a1 1 0 1 1 0 2 1 1 0 0 1 0-2zm4 0a1 1 0 1 1 0 2 1 1 0 0 1 0-2zm4 0a1 1 0 1 1 0 2 1 1 0 0 1 0-2z" />
        </svg>
      </span>

      <div>
        If something's unclear or you hit a blocker, contact us on

        <a href="https://discord.gg/ZJMPfMmu3S" target="_blank" rel="noopener">
          Discord
        </a>

        or <a href="mailto:contact@insaion.com">[contact@insaion.com](mailto:contact@insaion.com)</a>
      </div>
    </div>
  </div>
</div>
