Deployment variables for Linux
Pass the variables to the package manager command. Run the command as root, or put the variables after sudo, because sudo doesn't pass on your environment variables. Download the package as described in the Linux installation guide. For more variables, such as WAZUH_AGENT_GROUP, see the Deployment variables table.
Debian-based endpoints:
# WAZUH_ENROLLMENT_TOKEN='<TOKEN>' WAZUH_AGENT_NAME='web-server-01' dpkg -i wazuh-agent_*.deb
RPM-based endpoints, such as Red Hat Enterprise Linux, Amazon Linux, and SUSE Linux Enterprise Server. The first command imports the Wazuh GPG key, so that
rpmdoesn't warn that the key is missing (NOKEY):# rpm --import https://packages.wazuh.com/key/GPG-KEY-WAZUH # WAZUH_ENROLLMENT_TOKEN='<TOKEN>' WAZUH_AGENT_NAME='web-server-01' rpm -ivh wazuh-agent-*.rpm
Then start the Wazuh agent:
# systemctl daemon-reload
# systemctl enable --now wazuh-agent
To check that the Wazuh agent enrolled, search its log for the Token bootstrap: enrollment succeeded message. The Wazuh agent also shows as Active in Agents management > Summary on the Wazuh dashboard.
# grep "enrollment succeeded" /var/ossec/logs/ossec.log