Documentation
Install the agent on Linux
Enroll a Linux host with the one-command install or the manual install, and check that the devicequest-agent service is running.
Overview
You install the agent on a Linux host with a command you copy from Admin → Enroll Agent. The command downloads the agent for the host’s architecture, installs it as the hardened systemd service devicequest-agent, and enrolls it with a one-time bootstrap credential. Use the one-command install when your deployment serves it, and the manual install script otherwise.
Before you start
- A Linux host with systemd, on x86-64 (
amd64) or ARM64 (arm64). - Root access on the host (
sudo). - Outbound access from the host to:
- your DeviceQuest URL on port 443, to download the agent;
- the agent gateway: your DeviceQuest host on port 443 for a Kubernetes deployment, or the control plane on port 50051 for a direct connection.
- The
admin:managepermission in DeviceQuest, to open the Enroll Agent page.
Screen tour
The Enroll Agent page (titled Host Agent Setup) walks you through four steps. The header shows whether the Agent gateway is Enabled and the Control-plane mode.
- Operating system: choose Linux or Windows. Use the arrow keys to move between options.
- Architecture: amd64 or arm64 for Linux. Run
uname -mon the host if you are not sure:x86_64is amd64 andaarch64is arm64.
- Download Linux agent (amd64): downloads the agent binary for the platform you chose. The label follows your choice.
- Verification checksum: downloads the SHA-256 checksum of the binary, so you can check the file before you run it.
- Agent gateway mode: the
-modevalue the install script uses. Expand Why not …? to see why it differs from the control plane’s own mode.
- Target name: a label for the credential, for example the host name. Required, up to 120 characters.
- Gateway: the agent gateway address,
host:port. It must be reachable from the host you are enrolling, not from your browser. When your deployment serves the one-command install, this field is set for you and reads Set by this deployment (agentGateway.external). - Portal download URL: the DeviceQuest URL the host downloads the agent from. It must be reachable from the host. If you clear it, a warning tells you the links will point at a placeholder domain.
- Credential lifetime (minutes): how long the credential can be used to enroll. Between 5 and 1440 minutes (24 hours); values outside the range are clamped. Default 60.
- Issue one-time credential: creates the credential. It is disabled until Target name and Gateway are filled in.
After you click Issue one-time credential, the Credential issued box shows the credential. Copy this value now — it is shown only once and cannot be retrieved later. Click Copy credential to copy it, then I’ve saved it to close the box. The install command in step 4 already contains it.
- Bash — Linux: the script language for the platform you chose.
- Copy script: copies the whole command or script to the clipboard. The button reads Copied for a moment.
- The command or script. It contains your gateway, the platform and the credential from step 3.
Below the steps, Active bootstrap credentials lists every credential you have issued. See Updates, revoke and uninstall.
Install with one command
When your deployment serves agent downloads (on Kubernetes, with agentGateway.external.enabled=true), step 4 shows a single command:
curl -fsSL 'https://dq.example.com/api/v1/agent/install.sh?token=<one-time-agent-credential>' | sudo bash
- Open Admin → Enroll Agent.
- Under Choose the target platform, select Linux.
- Enter a Target name and, if needed, change Credential lifetime (minutes).
- Click Issue one-time credential.
- Under Run the install script, click Copy script.
- On the Linux host, paste and run the command.
The installer:
- checks that it runs as root;
- picks the build for the host’s architecture (
x86_64oraarch64); - downloads the agent from your DeviceQuest URL and checks its SHA-256 against the value the server baked into the script, and stops if they differ;
- stops a running agent, if there is one;
- runs
devicequest-agent installwith your gateway,-mode saasand TLS, which installs and starts the service and enrolls the agent.
It ends with Installed. Follow the agent log with: sudo journalctl -u devicequest-agent -f.
Private certificate authority
If your DeviceQuest certificate is issued by a private CA, copy the CA certificate to the host as ca.pem, and tick The server certificate is from a private CA (I have its ca.pem on the host) before you copy the command. The command becomes:
curl -fsSL --cacert ca.pem 'https://dq.example.com/api/v1/agent/install.sh?token=<one-time-agent-credential>' | sudo DEVICEQUEST_AGENT_CA_FILE="$PWD/ca.pem" bash
Run it from the directory that holds ca.pem. The installer copies the CA to /etc/devicequest-agent/ca.pem and starts the agent with -ca-file /etc/devicequest-agent/ca.pem.
Installer messages
| Message | What to do |
|---|---|
error: run as root (pipe this script to 'sudo bash') | Run the command with sudo bash, as shown. |
error: unsupported architecture … | Use an x86-64 or ARM64 host. |
error: this server has no agent build for … | Ask your DeviceQuest operator to publish the agent build for that platform. |
error: download failed. The install command may have expired or been used; ask your admin for a new one. | Issue a new credential and copy the new command. |
error: checksum mismatch, not installing | The download was altered or incomplete. Run the command again. |
install command not found or expired; ask your admin for a new one | The credential in the URL is unknown, revoked or expired. Issue a new one. |
too many requests | Wait a minute and run the command again. |
Install with the manual script
When your deployment does not serve the one-command install, step 4 shows a script that downloads the agent from the Portal download URL and installs it:
#!/usr/bin/env bash
set -euo pipefail
# 1. Download the DeviceQuest agent
curl -fsSL -o devicequest-agent 'https://dq.example.com/downloads/agent-linux-amd64'
chmod +x devicequest-agent
# 2. Install as a systemd service. This creates the devicequest-agent system user,
# writes the hardened unit, enrolls with the one-time credential, then starts it.
sudo ./devicequest-agent install \
-gateway 'dq.example.com:50051' \
-mode 'hybrid' \
-enrollment-credential '<one-time-agent-credential>'
# 3. Verify
systemctl status devicequest-agent --no-pager
- On the Enroll Agent page, select Linux and the host’s Architecture.
- Check Gateway and Portal download URL. Both must be reachable from the host.
- Enter a Target name and click Issue one-time credential.
- Click Copy script and run the script on the host.
To check the binary yourself, click Verification checksum in step 2 and compare it with sha256sum devicequest-agent.
You can also run install directly with a binary you copied to the host. Add -tls when the gateway uses TLS with a publicly trusted certificate, or -ca-file <path> for a private CA:
sudo ./devicequest-agent install \
-gateway dq.example.com:50051 \
-mode hybrid \
-enrollment-credential '<one-time-agent-credential>'
To turn on GPU telemetry at install time, add -gpu-telemetry-interval <seconds>, for example -gpu-telemetry-interval 60. See CLI reference for every flag.
What the install does
devicequest-agent install must run as root. It:
- stops a running
devicequest-agentservice, if any; - copies itself to
/usr/local/bin/devicequest-agent; - creates the system user
devicequest-agentwith no home directory and no login shell, if it does not exist; - creates the data directory (
/var/lib/devicequest-agentby default) owned by that user; - when you pass a credential, writes it, and the GPU telemetry interval when set, to
/etc/devicequest-agent/agent.envwith mode0600; - removes an old
enrollment.jsonwhen you pass a new credential, so the agent enrolls again with it; - writes the unit
/etc/systemd/system/devicequest-agent.service; - runs
systemctl daemon-reload, then enables and restarts the service.
It prints devicequest-agent installed and started (systemctl status devicequest-agent).
The systemd unit
[Unit]
Description=DeviceQuest Asset Management Agent
Documentation=https://github.com/devicequest/platform
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
User=devicequest-agent
Group=devicequest-agent
SupplementaryGroups=video render
EnvironmentFile=-/etc/devicequest-agent/agent.env
ExecStart=/usr/local/bin/devicequest-agent run -gateway dq.example.com:50051 -mode hybrid -data-dir /var/lib/devicequest-agent -log-format json
Restart=always
RestartSec=5
StateDirectory=devicequest-agent
ReadWritePaths=/var/lib/devicequest-agent
NoNewPrivileges=true
ProtectSystem=strict
ProtectHome=true
PrivateTmp=true
[Install]
WantedBy=multi-user.target
- The service runs as the unprivileged
devicequest-agentuser and restarts 5 seconds after any exit. - The credential is read from
agent.env, so it never appears in the world-readable unit file. ExecStartadds-tlsor-ca-file …when you installed with them.SupplementaryGroups=video renderlets the agent read GPU devices for GPU telemetry.
agent.env
DEVICEQUEST_AGENT_ENROLLMENT_CREDENTIAL=<one-time-agent-credential>
DEVICEQUEST_AGENT_GPU_TELEMETRY_INTERVAL=60
The second line is present only when GPU telemetry is on. The directory /etc/devicequest-agent belongs to root; systemd reads the file before it starts the service as devicequest-agent.
Verify the installation
Check the service:
systemctl status devicequest-agentExpected:
active (running).Follow the log:
sudo journalctl -u devicequest-agent -fExpected, in JSON:
enrollment successfulwith theagent_id, thenagent started successfully.In DeviceQuest, open Admin → Host Agents. The new agent appears under Enrolled agents as
linux/amd64(orlinux/arm64) with the status online.After the first local inventory scan, the host’s asset shows its packages, services, users, open ports and disks.
If the agent does not enroll
| Log message | Cause and fix |
|---|---|
agent gateway not available in on-prem mode | The service runs without -mode hybrid or -mode saas. Re-run install with one of them. |
connect to gateway: … | The host cannot reach the gateway address. Check DNS, the port and firewalls between the host and the gateway. |
enrollment: … | The credential was expired, revoked or already used. Issue a new credential and re-run the install command. |
gateway rejected this agent (revoked or token invalid); re-run the install command to re-enroll | The agent was revoked. Issue a new credential and re-run the install command. |
Re-install or re-enroll
Run the install command again with a new credential. install stops the running service, replaces the binary, removes the previous enrollment, and starts the service, which enrolls with the new credential. Your data directory and service user stay in place.
Related pages
- Agent overview
- Kubernetes agent gateway
- CLI reference
- Updates, revoke and uninstall
- Administration → Enroll agent
- Administration → Host agents