Skip to main content
To programmatically provision devices, Miru offers provisioning tokens. Provisioning tokens are only supported when installing miru-agent version v0.9.0 or later. If installing a version that precedes v0.9.0, continue to use the provisioning script. Unlike the dashboard, which requires manual interaction with the web interface for each device, provisioning tokens allow you to:
  • Provision multiple devices without manual intervention
  • Integrate with existing infrastructure management tools and workflows
  • Use in headless environments where a web browser isn’t available

Install the miru-agent package

Before provisioning a device via provisioning tokens, you must first install the miru-agent package onto the target machine. The recommended method is via apt (shown below). However, you can also manually download the package from GitHub. Visit the agent installation documentation for more information.
1

Set up

Set up Miru’s apt repository.
2

Install

After configuring the apt repository, install the agent.
Install a specific version with sudo apt-get install miru-agent=<version> (e.g. 0.7.0, 0.8.0, etc.).

Create a provisioning token

Provisioning tokens are created via the Platform API endpoint using API keys. Create the API key If you don’t have an API key, follow the instructions for creating an API key. The API key requires the devices:provision and provisioning_tokens:write scopes. Create the token Once you have an API key, you can create a token using the following code samples. Keep in mind that tokens are short-lived (expire in 5 minutes) and one-time use only.

Provision the device

After retrieving the provisioning token, run the following command. Make sure to replace <token> with the actual token.
The command can be broken into the following components:
  • sudo -u miru sets the command to run as the miru user.
  • MIRU_PROVISIONING_TOKEN=<token> authenticates the request.
  • /usr/sbin/miru-agent provision executes the miru-agent binary with the provision command.
Provisioning 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. Provisions the device - registers the agent with the Miru control plane.

Troubleshooting

If the machine you’re provisioning on has already been provisioned, the provisioning command is treated as a no-op and exits successfully. To reassociate the machine with an existing Miru device, follow the reprovisioning documentation. To provision the machine as a brand new Miru device (never been provisioned in Miru before), first uninstall the miru-agent package before continuing with the provisioning process.

Arguments

The provision command supports the following parameters to tune your installation:
--device-name
string
The name of the device in the Miru dashboard; defaults to $HOSTNAME.Default: $HOSTNAME

Verify installation

To verify the agent was successfully installed and provisioned, navigate to the Devices page. You should see your device listed with the status Activating before transitioning to Online.
The transition from Activating to Online may take up to 10 seconds, depending on your network connection.
Last modified on May 13, 2026