# Install the collector

By the end of this lesson, a collector runs on your network and shows as online in Naoshift.

## The steps

1. Copy the command shown in the green banner of the **Integration** page, right after creating the token.

2. Paste it on the chosen machine. `sudo` is only for the installation: the collector then runs under its own system account, without root rights.

    ```bash
    curl -fsSL https://app.naoshift.io/collector/install.sh | sudo NAOSHIFT_TOKEN=<token> NAOSHIFT_SERVER=https://app.naoshift.io bash
    ```

3. Check the service on the machine.

    ```bash
    systemctl status naoshift-agent
    ```

4. Go back to **Integration**: the collector card switches to **Online**.

## What the script does

It downloads the binary, verifies its SHA-256 fingerprint, creates the dedicated system account, writes the configuration and starts the service, which enrolls itself at first start. The token is then consumed.

Updates then start from Naoshift, with no need to go back to the machine.

### The token has expired

It lasts one hour, and opening a firewall often takes longer. Click **New token** on the collector card, then run the new command.

### The machine cannot reach Naoshift

It must be able to go out over HTTPS, port 443. Check the firewall, the proxy and any TLS inspection. The installer message names the cause: read it, it tells an expired, used or replaced token apart.

### Your network goes through a proxy

The installer does not carry the proxy over to the service. Add `HTTPS_PROXY` with `systemctl edit naoshift-agent`, then restart the service.

### The collector stays offline

Follow what it writes with `journalctl -fu naoshift-agent`, and check that the machine is up and can still go out over HTTPS.
