Install the Linux agent

Copy the one-line install command from the CloudStats UI, run it as root on a Linux host, and confirm the systemd service is active.

Updated Nov 7, 2026

On this page

Install from the CloudStats website. The site creates a one-time enrollment and shows a curl command. Downloading the script does not consume the token. Enrollment happens on the host after the binary is installed.

Placeholder command#

Copy the command from Add server. In this documentation the token is a placeholder only:

sh
curl -fsSL https://install.cloudstats.me/<ENROLLMENT_TOKEN> | sudo bash

<ENROLLMENT_TOKEN> is not a real token. Replace it with the value from the CloudStats UI, or paste the command the UI already filled in. These articles never ask you to send a token, credential, or agent.json file.

The UI command has no extra flags, API URL, organization id, or server id.

What the current installer does#

New installs pin agent v0.2.2. After you run the command as root, the script:

  1. Confirms Linux, root, and amd64 or arm64
  2. Downloads that version’s binary and SHA256SUMS over HTTPS
  3. Verifies SHA256 before installing
  4. Installs /usr/local/bin/cloudstats-agent
  5. Creates /etc/cloudstats and /var/lib/cloudstats (mode 0700)
  6. Installs /usr/local/lib/cloudstats/uninstall.sh and /usr/local/lib/cloudstats/update.sh
  7. Installs systemd units for the agent, uninstall path, and update path
  8. Enrolls using the environment variable CLOUDSTATS_ENROLL_TOKEN (not process arguments)
  9. Writes /etc/cloudstats/agent.json (mode 0600) only after enroll succeeds
  10. Enables cloudstats-agent-uninstall.path and cloudstats-agent-update.path
  11. Enables and starts cloudstats-agent.service

On success it prints Server connected successfully. plus:

text
systemctl status cloudstats-agent
journalctl -u cloudstats-agent

If enrollment fails, any existing agent.json is left unchanged and the script exits non-zero. The uninstall path unit is not enabled in that failure path.

Confirm the service#

sh
systemctl status cloudstats-agent
journalctl -u cloudstats-agent

systemctl is-active --quiet cloudstats-agent.service is the check the installer uses before it prints success.

You can also print the running binary’s version:

sh
/usr/local/bin/cloudstats-agent version

On a v0.2.2 install that prints v0.2.2.

Do not paste /etc/cloudstats/agent.json into tickets or chat. It holds the permanent agent credential. The enrollment token is not stored on disk.

Token errors#

GET of the install URL still returns a script when the token matches the expected format. The token is consumed only when enroll succeeds.

SituationWhat you see
Invalid, expired, or revoked tokenEnrollment fails with enrollment token is invalid, expired, or revoked
Token already usedEnrollment fails with enrollment token was already used
CloudStats API is not readyEnrollment fails with CloudStats API is not ready; retry shortly

Create a new install command from the website and run it again. See Troubleshooting and Reinstall and server identity.