Overview
API key installation is ideal for automated deployments or provisioning multiple devices. Unlike the dashboard installation method, which requires manual interaction with the web interface for each device, API key installation allows you to:- Provision multiple devices at scale without manual intervention
- Integrate with existing infrastructure management tools and workflows
- Use in headless environments where a web browser isn’t available
Create the API Key
Navigate to the API Keys page in the dashboard and click New API Key in the top right corner. Give the key a descriptive name and select thedevices:provision
scope.

Copy your API key immediately after creation. Once you navigate away from this page, the key cannot be retrieved again.
Install
Set the API Key
Open a terminal on the device where you want to install the Miru Agent and set theMIRU_API_KEY
environment variable.
Provision the Device
Execute the provision script, which will create and activate a device using your API key.- Creates the device - optionally creates a new device in the Miru dashboard if a device with the provided name doesn’t already exist
- Downloads the agent - fetches the latest Miru Agent debian package
- Installs the service - installs the agent as a
systemd
service - Activates the device - registers the agent with Miru servers using the activation token
Script Parameters
The provision script supports the following parameters to tune your installation. For example, you may want to provided the device name or hardset the version of the agent to install.The name of the device in the Miru dashboard.
Allows reactivation of existing devices. Without this flag, only
inactive
devices can be activated. With this flag, devices which have been previously activated (status online
, offline
, etc.) may be reactivated.Specific agent version to install (e.g.,
v0.6.0
). Defaults to the latest release. See all available versions.The file path to the Miru Agent debian package to use for installation. Useful for installing the agent in poor connectivity scenarios.
Verify Installation
Upon successful installation, you’ll see a confirmation message in the terminal.Activating
before transitioning to Online
.
The transition from
Activating
to Online
typically takes 5-15 seconds depending on your network connection.