Installing the Wazuh manager from sources
The Wazuh manager is the core component of the Wazuh server that processes and analyzes security data from Wazuh agents and other sources. It includes the analysis engine for log processing, rule evaluation, and alert generation, along with services for the Wazuh agent enrollment and connection.
This section covers installing dependencies, downloading and compiling the source code, running the installation wizard, and uninstalling the manager if needed.
Installing dependencies
Before compiling Wazuh from sources, install the build tools for your operating system. The build requires GCC 13 or later and CMake 3.22.1 or later. These commands are tested with the Wazuh 5.0.0 RC2 sources on Ubuntu 26.04, Ubuntu 24.04, CentOS Stream 10, and Amazon Linux 2023. Other systems and versions are likely to work, but we can't guarantee it.
Ubuntu 24.04 and Ubuntu 26.04
# apt-get update
# apt-get install gcc g++ make cmake curl procps policycoreutils
Amazon Linux 2023
# yum install make cmake gcc14 gcc14-c++ gcc14-libstdc++-static procps-ng policycoreutils tar gzip
# export CC=gcc14-gcc CXX=gcc14-g++
Amazon Linux 2023 includes GCC 11 by default. These commands install GCC 14 and select it for the build. Run the build and the install.sh script in the same shell, so that they use GCC 14.
CentOS Stream 10
# dnf install make cmake gcc gcc-c++ curl procps-ng policycoreutils dnf-plugins-core
# dnf config-manager --set-enabled crb
# dnf install libstdc++-static
Installing the Wazuh manager
This section covers downloading the Wazuh source code, compiling it, and running the installation wizard.
Install the Wazuh indexer from packages first, as the Installation guide describes. The Wazuh manager needs its password and certificates to start.
Download and extract the Wazuh source code:
# curl -Ls https://github.com/wazuh/wazuh/archive/v5.0.0-rc2.tar.gz | tar zx # cd wazuh-5.0.0-rc2
If you have previously compiled for another platform, clean the build using the Makefile in
src/:# make -C src clean # make -C src clean-deps
Download the external dependencies and build the Wazuh manager. The build takes several minutes:
# make -C src TARGET=manager deps # make -C src TARGET=manager -j$(nproc)
Create the
/etc/wazuh-manager/local.envfile:# install -d -m 0750 /etc/wazuh-manager # install -m 0600 /dev/null /etc/wazuh-manager/local.env
If the Wazuh indexer runs on another host, add the password of its
wazuh-manageruser. The password is theWAZUH_INDEXER_MANAGER_PASSWORDvalue in/etc/wazuh-indexer/export/credentials.envon a Wazuh indexer node. Replace<WAZUH_INDEXER_MANAGER_PASSWORD>with it:# echo "WAZUH_INDEXER_MANAGER_PASSWORD=<WAZUH_INDEXER_MANAGER_PASSWORD>" >> /etc/wazuh-manager/local.env
If Wazuh agents reach this node through an address it doesn't have, such as a load balancer or a NAT address, add
WAZUH_MANAGER_REMOTED_CERT_SANS. Include this node's own address too, because the list replaces the addresses the installer discovers:# echo "WAZUH_MANAGER_REMOTED_CERT_SANS=DNS:<LOAD_BALANCER_NAME>,IP:<NODE_IP>" >> /etc/wazuh-manager/local.env
Run the
install.shscript. The script starts a wizard that guides you through the installation:# ./install.shWhen the script asks what kind of installation you want, type
1to install the Wazuh manager:1- Installation type: 1) manager 2) agent Select an option [1-2]: 1
If the Wazuh indexer runs on another host, copy
ca.pem,manager-client.pem, andmanager-client-key.pemfrom/etc/wazuh-indexer/exporton a Wazuh indexer node. Then place them in/etc/wazuh-manager/certs:# install -m 0640 -o root -g wazuh-manager ca.pem /etc/wazuh-manager/certs/indexer-ca.pem # install -m 0640 -o root -g wazuh-manager manager-client.pem /etc/wazuh-manager/certs/indexer-connector.pem # install -m 0640 -o root -g wazuh-manager manager-client-key.pem /etc/wazuh-manager/certs/indexer-connector-key.pem
If the Wazuh indexer runs on another host, edit the
<indexer>block in/etc/wazuh-manager/wazuh-manager.conf. Replace127.0.0.1with the IP address of the Wazuh indexer:<indexer> <hosts> <host>https://<WAZUH_INDEXER_IP_ADDRESS>:9200</host> </hosts>
The installer doesn't start the Wazuh manager. Start the Wazuh manager and enable it to start at boot:
# systemctl daemon-reload # systemctl enable --now wazuh-manager
# service wazuh-manager start
Run the following command to check that the Wazuh manager daemons are running:
# /var/wazuh-manager/bin/wazuh-manager-control status
If the Wazuh manager doesn't start, run
journalctl -u wazuh-manager. The start-up check lists each missing or invalid password and certificate. To check the files without starting the Wazuh manager, run/var/wazuh-manager/bin/wazuh-manager-resolve-credentials --check. It printscheck: no problem foundwhen there is none, but it doesn't check the indexer password.
Installing other Wazuh components
After you install the Wazuh manager, install the Wazuh dashboard from packages, as the Installation guide describes. The Wazuh dashboard isn't available for installation from sources.
Uninstall
This section provides instructions for completely removing the Wazuh manager installation from your system.
To uninstall the Wazuh manager, set
WAZUH_HOMEto the installation path,/var/wazuh-managerby default. The configuration is in/etc/wazuh-manager, which the last step removes:# WAZUH_HOME="/WAZUH/INSTALLATION/PATH"
Stop the service:
# service wazuh-manager stop 2> /dev/null
Stop the daemon:
# $WAZUH_HOME/bin/wazuh-manager-control stop 2> /dev/null
Remove the installation folder and all its content:
# rm -rf $WAZUH_HOME
Delete the service:
# [ -f /etc/rc.local ] && sed -i'' '/wazuh-manager-control start/d' /etc/rc.local # find /etc/{init.d,rc*.d} -name "*wazuh-manager*" | xargs rm -f
# find /etc/systemd/system /usr/lib/systemd/system -name "wazuh-manager*" | xargs rm -f # systemctl daemon-reload
Remove the
wazuh-manageruser and group:# userdel wazuh-manager 2> /dev/null # groupdel wazuh-manager 2> /dev/null
Remove the Wazuh manager configuration directory. It holds the CA private key that the Wazuh agents trust, so back up
/etc/wazuh-manager/cafirst if you plan to reinstall:# rm -rf /etc/wazuh-manager