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

# Provisioning script

The provisioning script is a legacy method for provisioning devices. The provisioning script only supports installing `miru-agent` versions that *precede* `v0.9.0`. To install Miru Agent `v0.9.0` or later, please use a different [provisioning method](/learn/devices/provision/overview).

## Create the API key

If you don't have an API key, follow the instructions for [creating an API key](/admin/apikeys#create-an-api-key). The API key requires the `devices:provision` and `provisioning_tokens:write` scopes.

## Provision the device

On the device you want to install the Miru Agent, set the `MIRU_API_KEY` environment variable to your API key.

```bash theme={null}
export MIRU_API_KEY=<api-key>
```

<Danger>
  The provisioning script is a legacy method that only supports installing versions that precede `v0.9.0`. If installing Miru Agent `v0.9.0` or later, please use a different [method](/learn/devices/provision/overview).
</Danger>

Execute the [provisioning script](https://github.com/mirurobotics/agent/blob/main/scripts/install/provision.sh) to create and provision a device using your API key.

```bash theme={null}
curl -fsSL https://raw.githubusercontent.com/mirurobotics/agent/main/scripts/install/provision.sh | sh -s -- \
  --device-name=$HOSTNAME \
  --allow-reactivation=true
```

The provision script performs the following actions:

1. **Creates the device** - creates a new device in the Miru dashboard if a device with the provided name doesn't already exist
2. **Downloads the agent** - fetches the latest Miru Agent Debian package
3. **Installs the service** - installs the agent as a `systemd` service
4. **Provisions the device** - registers the agent with the Miru control plane

### Arguments

The provision script supports the following parameters to tune your installation:

<ParamField path="--device-name" type="string">
  The name of the device in the Miru dashboard.

  Default: `$HOSTNAME`
</ParamField>

<ParamField path="--allow-reactivation" type="boolean">
  Allows reactivation of existing devices.

  Without this flag, only `inactive` devices can be activated. With this flag, devices that have been previously activated (status `online`, `offline`, etc.) may be reactivated.

  Default: `false`
</ParamField>

<ParamField path="--version" type="string">
  The agent version to install (e.g., `v0.6.0`).

  Defaults to the [latest release](https://github.com/mirurobotics/agent/releases/latest). See all [available versions](https://github.com/mirurobotics/agent/releases).
</ParamField>

## Verify installation

To verify the agent was successfully installed and provisioned, navigate to the [Devices page](https://app.mirurobotics.com/devices). You should see your device listed with the status `Activating` before transitioning to `Online`.

<Info>
  The transition from `Activating` to `Online` may take up to 10 seconds, depending on your network connection.
</Info>
