Skip to content

Documentation

Host Agent Setup

Download the DeviceQuest agent, issue a one-time bootstrap credential, and install and enroll the agent on a Linux or Windows host.

Overview

Host Agent Setup walks you through installing the DeviceQuest agent on a managed Linux or Windows endpoint. You pick the platform, download the agent, issue a one-time bootstrap credential, and run an install script on the host. The agent enrolls with the credential, which is then used up, and from then on connects outbound to the agent gateway with its own token. Enrolled agents appear on Host agents.

Open it from Admin → Enroll Agent in the sidebar. The old address /admin/windows-agent opens the same page with Windows preselected. The page is for administrators: people without the admin:manage permission see the access-restricted page instead.

Screen tour

  1. Area, Agent gateway and Control-plane mode: whether the agent gateway runs on this deployment (Enabled or Disabled) and the control plane’s deployment mode, for example onprem, hybrid or saas.
  2. Choose the target platform: step 1, the operating system and architecture of the host.
  3. Download the agent: step 2, the agent binary and its checksum.
  4. Issue a bootstrap credential: step 3, the one-time secret the agent enrolls with.
  5. Run the install script: step 4, the script or command to run on the host.
  6. Active bootstrap credentials: credentials that have not been used or revoked yet.

Two notices can appear above the steps:

  • Agent gateway is not enabled for this deployment: you can still issue a credential and download the agent, but agents can enroll only after the deployment administrator enables the agent gateway for this control plane.
  • One-command installs are off for this deployment: the page shows the manual install script. On Kubernetes, one-command installs are turned on with the Helm value agentGateway.external.enabled=true, which needs ingress.tlsSecretName. See One-command install.

Choose the target platform

  1. Operating system: Linux or Windows.
  2. Architecture: amd64 or arm64 for Linux; amd64 for Windows.

Match the host you are enrolling. Every later step, the download and the script follow your choice.

Download the agent

  1. Download Linux agent (amd64): downloads the agent binary for the chosen platform. The label follows your choice, for example Download Windows agent (amd64).
  2. Verification checksum: downloads the SHA-256 checksum of the binary, so you can verify the file before you run it.
  3. File: the file name, for example agent-linux-amd64, agent-linux-arm64 or agent-windows-amd64.exe.
  4. Agent gateway mode: the mode the agent runs in, -mode hybrid or -mode saas.

The agent connects to the gateway in hybrid or saas mode. When the control plane runs in another mode, for example onprem with the agent gateway enabled, the page uses hybrid and explains why under Why not onprem?.

You need the separate download only for the manual install. The install script downloads the agent itself.

Issue a bootstrap credential

  1. Target name: a name for the host or group of hosts, for example web01. It labels the credential in the list.
  2. Gateway: the agent gateway address, host:port, as the target host reaches it, for example dq.example.com:50051.
  3. Portal download URL: the DeviceQuest address the target host downloads the agent from.
  4. Credential lifetime (minutes): how long the credential can be used to enroll.
  5. Issue one-time credential: creates the credential.
  1. Enter a Target name.
  2. Check the Gateway and Portal download URL. Both are filled in from the address you use, and both must be reachable from the target host, not just from your browser. When one-command installs are on, the deployment sets both and you cannot edit them.
  3. Set the Credential lifetime (minutes).
  4. Click Issue one-time credential.

The button stays disabled until you enter a target name and a gateway. If the Portal download URL is empty, a warning tells you that the download link and script point at the placeholder portal.example.com.

  1. Credential: the secret, shown once under Credential issued. It cannot be retrieved later.
  2. Copy credential: copies the secret.
  3. I’ve saved it: hides the secret; the script in step 4 reverts to the placeholder.

The install script in step 4 now contains the credential, so you can also copy the script instead of the credential alone. Copy the script before you click I’ve saved it.

Bootstrap credential lifetime

A bootstrap credential:

  • is valid for the Credential lifetime you chose: from 5 minutes to 1,440 minutes (24 hours), 60 minutes by default. Values outside this range are clamped.
  • enrolls one agent. When an agent enrolls with it, the credential is used up and leaves the Active bootstrap credentials list.
  • can only enroll. The enrolled agent receives its own token and no longer needs the credential, so the credential expiring later does not affect it.

Issue a new credential for every host, and keep the lifetime short: long enough to run the install, no longer.

Install

Step 4, Run the install script, shows what to run on the target host, for the platform you chose. Click Copy script to copy it. Issue the credential first: until you do, the script contains the placeholder <one-time-agent-credential>.

Linux

  1. Bash — Linux: the script language and platform.
  2. Copy script: copies the script.
  3. Script: the install script, with your gateway, mode and credential filled in.
  4. Note: where and how to run it.

Run the script on the target Linux host as a user who can use sudo. It:

  1. downloads the agent from the Portal download URL to devicequest-agent,
  2. runs sudo ./devicequest-agent install with your Gateway, the agent mode and the credential. This copies the agent to /usr/local/bin/devicequest-agent, creates the devicequest-agent system user, writes the settings to /etc/devicequest-agent/agent.env, installs a hardened systemd unit, enrolls the agent and starts the devicequest-agent service,
  3. shows the service status with systemctl status devicequest-agent --no-pager.

The agent keeps its state in /var/lib/devicequest-agent. To remove the agent later, run sudo devicequest-agent uninstall; it stops the service and removes the unit and the settings, and keeps the state directory.

Windows

  1. PowerShell — Windows: the script language and platform.
  2. Script: the install script, with your gateway, mode and credential filled in.

Run the script in PowerShell as Administrator on the target Windows machine. It:

  1. creates C:\ProgramData\DeviceQuest\Agent and downloads the agent there as devicequest-agent.exe, stopping an existing DeviceQuestAgent service first,
  2. registers the DeviceQuestAgent service (display name DeviceQuest Agent, automatic start) with your gateway, mode and credential, and starts it,
  3. waits up to 60 seconds for the agent to enroll, then removes the credential from the saved service command and restarts the service. It prints DeviceQuest Agent enrolled. Bootstrap credential removed from the service command.

If enrollment does not finish within 60 seconds, the script warns you to check that the host reaches the gateway and to read the service logs.

One-command install

When the deployment serves the agent itself, step 4 shows a single command instead of a script. The control plane bakes in its public address, the agent gateway and the SHA-256 of each agent build, so you do not enter or check them yourself, and Gateway and Portal download URL in step 3 are read-only.

Linux, run on the target host:

curl -fsSL 'https://dq.example.com/api/v1/agent/install.sh?token=<credential>' | sudo bash

When the DeviceQuest server certificate comes from a private certificate authority, tick The server certificate is from a private CA (I have its ca.pem on the host). The command then becomes:

curl -fsSL --cacert ca.pem 'https://dq.example.com/api/v1/agent/install.sh?token=<credential>' | sudo DEVICEQUEST_AGENT_CA_FILE="$PWD/ca.pem" bash

Windows, run in an elevated PowerShell:

[Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12; & ([scriptblock]::Create((Invoke-RestMethod -UseBasicParsing 'https://dq.example.com/api/v1/agent/install.ps1?token=<credential>')))

The command downloads an installer script from the control plane:

AddressWhat it returns
GET /api/v1/agent/install.sh?token=<credential>The Linux installer. It must run as root. It detects the architecture (linux-amd64 or linux-arm64), downloads the matching agent, verifies its SHA-256 checksum, stops an existing agent, then installs, enrolls and starts the devicequest-agent service over TLS. With DEVICEQUEST_AGENT_CA_FILE set, it stores the CA as /etc/devicequest-agent/ca.pem and trusts it for the download and the gateway.
GET /api/v1/agent/install.ps1?token=<credential>The Windows installer. It must run as Administrator. It downloads the agent to C:\Program Files\DeviceQuest Agent\devicequest-agent.exe, verifies its SHA-256 checksum, stops an existing DeviceQuestAgent service, then installs, enrolls and starts the service over TLS.
GET /api/v1/agent/download/<platform>?token=<credential>The agent binary for linux-amd64, linux-arm64 or windows-amd64, with its checksum in the X-Checksum-Sha256 header. The installers call it for you.

Every address needs a valid bootstrap credential in token. A credential that is unknown, revoked, already used or expired gets install command not found or expired; ask your admin for a new one. After the install, follow the Linux agent’s log with sudo journalctl -u devicequest-agent -f.

Active bootstrap credentials

  1. Count: how many credentials are in the list.
  2. Prefix: the first characters of the credential, to tell credentials apart without showing the secret.
  3. Expires: when the credential stops working.
  4. Status: Active or Expired.
  5. Revoke: revokes the credential.

The list shows every credential of your organisation that has not been used or revoked, newest first, with its Name, Prefix, Expires, Last used and Status. When there are none, it shows No active bootstrap credentials. If the list cannot be loaded, Could not load bootstrap credentials appears with a Retry button.

Revoke a bootstrap credential

Revoke a credential you issued but no longer need, or one that may have leaked, so nobody can enroll an agent with it.

  1. Revoke credential: the dialog names the credential to revoke.
  2. Cancel: closes the dialog without changes.
  3. Revoke: revokes the credential.
  1. Click Revoke on the credential’s row.
  2. Check the name in the dialog and click Revoke.

The credential leaves the list and can no longer enroll an agent or download the installer. Revoking cannot be undone; issue a new credential if you need one. Agents that already enrolled keep working: to disconnect one, revoke the agent on Host agents.

Issued and revoked credentials are recorded in the Audit log.

Fields

FieldDescriptionRules
Operating systemPlatform of the target host.Linux or Windows.
ArchitectureCPU architecture of the target host.amd64 or arm64 for Linux; amd64 for Windows.
Target nameName of the credential.Required. At most 120 characters. Default Managed host.
GatewayAgent gateway address as the host reaches it.Required. host:port. Read-only when one-command installs are on.
Portal download URLAddress the host downloads the agent from.Read-only when one-command installs are on.
Credential lifetime (minutes)How long the credential can enroll.5–1,440. Default 60.
The server certificate is from a private CA (I have its ca.pem on the host)Adds the CA file to the Linux one-command install.Linux one-command install only.

Statuses

StatusMeaningNext possible status
ActiveThe credential can enroll one agent until it expires.Expired; leaves the list when used or revoked
ExpiredThe lifetime has passed. The credential can no longer enroll.Leaves the list when revoked

Keyboard shortcuts

KeyAction
← → ↑ ↓In Operating system or Architecture, choose the previous or next option.
EscClose the Revoke credential dialog.