Install Wazuh components step by step
Run these steps on each offline host, in the directory where you copied the files in step 6 of Download the packages and configuration files.
All-in-one deployment
An all-in-one deployment doesn't use wazuh-install-files.tar. The Wazuh packages create the root CA, the certificates, and the passwords on the host. Follow these steps:
Decompress
wazuh-offline.tar.gzand check the package signatures, as Preparing the packages describes.Follow All-in-one deployment in the Installation guide with these changes: skip Adding the Wazuh repository and Disable Wazuh updates. Check that the listed dependencies are installed with
rpm -q(DEB:dpkg -s) instead of installing them, and bring any missing one as Prerequisites describes. Where the guide installs a package, runrpm -ivh ./wazuh-offline/wazuh-packages/wazuh-indexer*.rpm(DEB:dpkg -i ./wazuh-offline/wazuh-packages/wazuh-indexer*.deb), and the same forwazuh-managerandwazuh-dashboard.When the Wazuh dashboard runs, come back to this guide. Continue with Securing your Wazuh installation of this guide, instead of the section with the same name in the Installation guide, and then read Running Wazuh offline.
Preparing the packages
Decompress the installation files. For an all-in-one deployment, decompress only
wazuh-offline.tar.gz.# umask 022 # tar xf wazuh-offline.tar.gz # tar xf wazuh-install-files.tar
wazuh-install-files.tarholdsroot-ca.pem, the certificates of every node inconfig.yml, andcredentials.envwith the five passwords. Place them on each node before you install its package. The package then uses them instead of generating its own.Verify the package signatures with the Wazuh key that
wazuh-offline.tar.gzcarries,wazuh-offline/GPG-KEY-WAZUH. These commands needgnupg, andbinutilson DEB systems. Don't install a package that fails these checks.Check that the fingerprint of the key is
0DCF CA55 47B1 9D2A 6099 5060 96B3 EE5F 2911 1145:# gpg --show-keys --with-fingerprint wazuh-offline/GPG-KEY-WAZUH
Every package must show
Signature, key ID 29111145: OK.rpm -Kalone also passes on an unsigned package, so check the key ID.# rpm --import wazuh-offline/GPG-KEY-WAZUH # for p in wazuh-offline/wazuh-packages/*.rpm; do echo "$p"; rpm -Kv "$p" | grep -i signature; done
aptdoesn't check the signature embedded in a.debpackage. The following commands check the_gpgbuildermember withgpgvand compare the hashes it signs with the other members. Every package must showOK:# gpg --dearmor < wazuh-offline/GPG-KEY-WAZUH > wazuh.gpg # command -v ar >/dev/null || echo "Install binutils first: the check needs ar." # for p in wazuh-offline/wazuh-packages/*.deb; do ar p "$p" _gpgbuilder > _gpgbuilder gpgv --keyring ./wazuh.gpg --output signed _gpgbuilder 2>/dev/null || { echo "$p: not signed with the Wazuh key, or ar is missing"; continue; } awk 'NF == 4 && length($1) == 32 {print $2, $4}' signed | sort > signed-members for m in $(ar t "$p" | grep -v '^_gpg'); do echo "$(ar p "$p" "$m" | sha1sum | cut -d' ' -f1) $m"; done | sort > members cmp -s signed-members members && echo "$p: OK" || echo "$p: FAILED" done # rm -f wazuh.gpg _gpgbuilder signed signed-members members
Installing the Wazuh indexer
Install and configure the Wazuh indexer on each indexer node. Before installing it, install the following dependencies, if missing, from your local package mirror, installation media, or copied packages (see Prerequisites):
coreutils
diffutils
hostname
iproute
openssl
procps-ng
shadow-utils
util-linux
adduser
debconf
diffutils
iproute2
openssl
procps
Place the passwords, the root CA certificate, and the certificates of this node before installing the package. Replace
<INDEXER_NODE_NAME>with the name of the node as defined inconfig.yml, for example,indexer.# NODE_NAME=<INDEXER_NODE_NAME>
# install -d -m 0750 -o root -g root /etc/wazuh-indexer /etc/wazuh-indexer/ca # install -m 0640 wazuh-install-files/root-ca.pem /etc/wazuh-indexer/ca/root-ca.pem # install -m 0600 /dev/null /etc/wazuh-indexer/local.env # grep '^WAZUH_INDEXER_' wazuh-install-files/credentials.env > /etc/wazuh-indexer/local.env # install -d -m 0750 /etc/wazuh-indexer/certs # install -m 0640 wazuh-install-files/$NODE_NAME.pem /etc/wazuh-indexer/certs/indexer.pem # install -m 0640 wazuh-install-files/$NODE_NAME-key.pem /etc/wazuh-indexer/certs/indexer-key.pem # install -m 0600 wazuh-install-files/admin.pem /etc/wazuh-indexer/certs/admin.pem # install -m 0600 wazuh-install-files/admin-key.pem /etc/wazuh-indexer/certs/admin-key.pem
Install the Wazuh indexer package. The package uses the passwords and certificates you placed. It gives the node certificate, its key, and the root CA certificate to
root, with thewazuh-indexergroup. The admin certificate and its key stay readable byrootonly. Don't install it before placing them. Placing them afterwards doesn't configure the node.# rpm -ivh ./wazuh-offline/wazuh-packages/wazuh-indexer*.rpm
# dpkg -i ./wazuh-offline/wazuh-packages/wazuh-indexer*.deb
Edit
/etc/wazuh-indexer/opensearch.ymland replace the following values:network.host: Sets the address of this node for both HTTP and transport traffic. The node will bind to this address and will also use it as its publish address. Accepts an IP address or a hostname. Use the same node address set in theconfig.ymlfile to create the SSL certificates.node.name: Name of the Wazuh indexer node as defined in theconfig.ymlfile. For example,indexer.cluster.initial_cluster_manager_nodes: List of the names of the master-eligible nodes. These names are defined in theconfig.ymlfile. Replace thenode-1entry the package wrote, and add one line per node, according to yourconfig.ymlfile definitions.cluster.initial_cluster_manager_nodes: - "indexer" - "indexer-2" - "indexer-3"
discovery.seed_hosts: List of the addresses of the master-eligible nodes. Each element can be either an IP address or a hostname. You can leave this setting commented if you are configuring the Wazuh indexer as a single-node. For multi-node configurations, uncomment this setting and set your master-eligible node addresses.discovery.seed_hosts: - "10.0.0.1" - "10.0.0.2" - "10.0.0.3"
plugins.security.nodes_dn: List of the Distinguished Names of the certificates of all the Wazuh indexer cluster nodes. The package writes only one line. Replace it with one line per Wazuh indexer node, using the names from yourconfig.ymlfile in this order. Leaveplugins.security.authcz.admin_dnas the package wrote it.plugins.security.nodes_dn: - "C=US,L=California,O=Wazuh,OU=Wazuh,CN=indexer" - "C=US,L=California,O=Wazuh,OU=Wazuh,CN=indexer-2" - "C=US,L=California,O=Wazuh,OU=Wazuh,CN=indexer-3"
Set the Java heap of the Wazuh indexer. The package sets 1 GB, which isn't enough. The Wazuh dashboard then fails on its first start with
circuit_breaking_exception. Use half of the host memory on a dedicated Wazuh indexer node. Use one quarter when the Wazuh manager and Wazuh dashboard share the host, by changing/ 2to/ 4:# HEAP_MB=$(( $(free -m | awk 'NR == 2 {print $2}') / 2 )) # sed -i -e "s/^-Xms.*/-Xms${HEAP_MB}m/" -e "s/^-Xmx.*/-Xmx${HEAP_MB}m/" /etc/wazuh-indexer/jvm.options
Enable and start the Wazuh indexer service.
# systemctl daemon-reload # systemctl enable wazuh-indexer # systemctl start wazuh-indexer
Choose one option according to the operating system used.
RPM-based operating system:
# chkconfig --add wazuh-indexer # service wazuh-indexer start
Debian-based operating system:
# update-rc.d wazuh-indexer defaults 95 10 # service wazuh-indexer start
For multi-node clusters, repeat the previous steps on every Wazuh indexer node.
After all Wazuh indexer nodes are running, run
indexer-security-init.shonce, on any one of them. It loads the users of that node into the security index, which replaces the users of every other node, and starts the cluster.# /usr/share/wazuh-indexer/bin/indexer-security-init.shCheck that every Wazuh indexer node joined the cluster and that its status is
green. Replace<WAZUH_INDEXER_ADDRESS>with the address of a Wazuh indexer node. Whencurlasks for the password, enter theWAZUH_INDEXER_ADMIN_PASSWORDvalue that the first command shows.# grep '^WAZUH_INDEXER_ADMIN_PASSWORD=' /etc/wazuh-indexer/export/credentials.env | cut -d= -f2- # curl --cacert /etc/wazuh-indexer/export/ca.pem -u admin https://<WAZUH_INDEXER_ADDRESS>:9200/_cat/nodes?v # curl --cacert /etc/wazuh-indexer/export/ca.pem -u admin https://<WAZUH_INDEXER_ADDRESS>:9200/_cluster/health?pretty
Installing the Wazuh manager
Install and configure the Wazuh manager on each manager node. Before installing it, install the following dependencies, if missing:
coreutils
shadow-utils
libc6 (2.18 or later)
passwd
Place the passwords before installing the package. Replace
<MANAGER_NODE_NAME>with the name of the node as defined inconfig.yml, for example,manager.# NODE_NAME=<MANAGER_NODE_NAME>
# install -d -m 0750 -o root -g root /etc/wazuh-manager # install -m 0600 /dev/null /etc/wazuh-manager/local.env # grep -E '^(WAZUH_MANAGER_API_PASSWORD|WAZUH_MANAGER_WUI_PASSWORD|WAZUH_INDEXER_MANAGER_PASSWORD)=' wazuh-install-files/credentials.env > /etc/wazuh-manager/local.env
Optional: set the addresses that Wazuh agents use to reach this node. Without this setting, the package puts the node's host name and IP addresses in its agent listener certificate. Your list replaces them, so include this node's own address and any load balancer, NAT address, or public name that agents use. Separate the entries with commas, and write
IP:before an address andDNS:before a name:# echo 'WAZUH_MANAGER_REMOTED_CERT_SANS=IP:<WAZUH_MANAGER_ADDRESS>,DNS:<LOAD_BALANCER_NAME>' >> /etc/wazuh-manager/local.env
The package always adds
localhost,127.0.0.1, and::1. For the Wazuh manager API certificate, setWAZUH_MANAGER_APID_CERT_SANSthe same way. The address in theurlsetting of the Wazuh dashboard must be in that certificate.On each worker node of a Wazuh manager cluster, place the master node's root CA. Install the master node first. Every node then issues its certificates from the same root CA, so the Wazuh agents trust every node. Skip this step on the master node and on a single Wazuh manager. On the master node, pack the root CA and its private key:
# tar -cf manager-ca.tar -C /etc/wazuh-manager/ca root-ca.pem root-ca.key # chmod 600 manager-ca.tar
Copy
manager-ca.tarto the working directory of the worker node, and run these commands there:# install -d -m 0700 /etc/wazuh-manager/ca # tar -xf manager-ca.tar -C /etc/wazuh-manager/ca # chown root:root /etc/wazuh-manager/ca/root-ca.pem /etc/wazuh-manager/ca/root-ca.key # chmod 0644 /etc/wazuh-manager/ca/root-ca.pem # chmod 0400 /etc/wazuh-manager/ca/root-ca.key # rm -f manager-ca.tar
The file holds the root CA private key. Remove it from the master node too when every worker node has its copy. To add a Wazuh manager node to the cluster later, repeat this step on the new node before you install its package. Don't issue its certificates with the
-wmoption of the certificates tool. The tool signs them with the root CA of the archive, which isn't the root CA of this Wazuh manager cluster. Procedures that add a Wazuh manager node with the certificates tool apply only to assisted installations.Install the Wazuh manager package. The package uses the passwords you placed, and issues this node's agent listener and Wazuh manager API certificates.
# rpm -ivh ./wazuh-offline/wazuh-packages/wazuh-manager*.rpm
# dpkg -i ./wazuh-offline/wazuh-packages/wazuh-manager*.deb
Place the Wazuh indexer root CA and this node's client certificate for the Wazuh indexer. The installation printed
MISSINGlines for them, which is expected. Skip this step on a host with the Wazuh indexer:# install -m 0640 -o root -g wazuh-manager wazuh-install-files/root-ca.pem /etc/wazuh-manager/certs/indexer-ca.pem # install -m 0640 -o root -g wazuh-manager wazuh-install-files/$NODE_NAME.pem /etc/wazuh-manager/certs/indexer-connector.pem # install -m 0640 -o root -g wazuh-manager wazuh-install-files/$NODE_NAME-key.pem /etc/wazuh-manager/certs/indexer-connector-key.pem
Check the credentials. The check must end with
no problem found:# /var/wazuh-manager/bin/wazuh-manager-resolve-credentials --check -H /var/wazuh-manager
Check that the agent listener certificate comes from this node's root CA, the master node's root CA in a cluster. Agents reject a Wazuh manager node whose certificate fails this check:
# openssl verify -CAfile /etc/wazuh-manager/certs/root-ca.pem /etc/wazuh-manager/certs/remoted.pem
In the
<indexer>block of/etc/wazuh-manager/wazuh-manager.conf, replace127.0.0.1with the addresses of the Wazuh indexer nodes, one<host>entry per node. Do it on every Wazuh manager node, because the cluster doesn't synchronize this block. Leave the<ssl>settings as the package wrote them. The credentials aren't set here. The package stored them in the Wazuh manager keystore.<indexer> <hosts> <host>https://<WAZUH_INDEXER_1_IP_ADDRESS>:9200</host> <host>https://<WAZUH_INDEXER_2_IP_ADDRESS>:9200</host> </hosts> ... </indexer>
Enable and start the Wazuh manager service, first on the master node and then on the worker nodes. A fresh installation doesn't start the service by itself.
# systemctl daemon-reload # systemctl enable wazuh-manager # systemctl start wazuh-manager
Run the following commands to verify that the Wazuh manager status is active and that it reaches the Wazuh indexer:
# systemctl status wazuh-manager
# grep 'indexer is reachable' /var/wazuh-manager/logs/wazuh-manager.log | tail -1
Wazuh cluster configuration for multi-node deployment
After completing the installation of the Wazuh manager on every node, you must configure one manager node as the master and the rest as workers. If you have only one Wazuh manager node, skip this section and go to Installing the Wazuh dashboard. wazuh-install-files.tar holds a clusterkey file only when config.yml lists more than one Wazuh manager node.
On every node, the package writes a <cluster> block with its own random key, node_type master, and bind_addr 127.0.0.1. Replace the whole block on each node.
Configuring the Wazuh manager master node
Edit the following settings in the
/etc/wazuh-manager/wazuh-manager.confconfiguration file. Replace<CLUSTER_KEY>with the key inwazuh-install-files/clusterkey, which the following command shows, and<WAZUH_MASTER_ADDRESS>with the IP address of the master node.# cat wazuh-install-files/clusterkey
<cluster> <name>wazuh</name> <node_name>master-node</node_name> <node_type>master</node_type> <key><CLUSTER_KEY></key> <port>1516</port> <bind_addr>0.0.0.0</bind_addr> <nodes> <node><WAZUH_MASTER_ADDRESS></node> </nodes> <hidden>no</hidden> </cluster>
Parameters to be configured:
Parameter
Description
It indicates the name of the cluster.
It indicates the name of the current node.
It specifies the role of the node. It has to be set to
master.Key that is used to encrypt communication between cluster nodes. Use the key in
wazuh-install-files/clusterkey, the same on every node.It indicates the destination port for cluster communication.
It is the network IP to which the node is bound to listen for incoming requests (0.0.0.0 for any IP).
It is the address of the master node and can be either an IP or a DNS. This parameter must be specified in all nodes, including the master itself.
Reserved for hiding this node in cluster listings. In this version, no component reads it, and setting it has no effect.
Restart the Wazuh manager.
# systemctl restart wazuh-manager
Repeat these configuration steps for every Wazuh manager worker node in your cluster, with
<node_type>worker</node_type>, a unique<node_name>, the same<key>, and<WAZUH_MASTER_ADDRESS>in<nodes>.
Testing the Wazuh manager cluster
To verify that the Wazuh cluster is enabled and all the nodes are connected, run the following command:
# /var/wazuh-manager/bin/cluster_control -l
The command returns output similar to the following example:
NAME TYPE VERSION ADDRESS
master-node master 5.0.0 10.0.0.3
worker-node1 worker 5.0.0 10.0.0.4
worker-node2 worker 5.0.0 10.0.0.5
Note that 10.0.0.3, 10.0.0.4, 10.0.0.5 are example IPs.
Installing the Wazuh dashboard
Install and configure the Wazuh dashboard node.
Place the passwords, the root CA certificate, and the certificate of this node before installing the package. Replace
<DASHBOARD_NODE_NAME>with the name of the node as defined inconfig.yml, for example,dashboard.# NODE_NAME=<DASHBOARD_NODE_NAME>
# install -d -m 0750 -o root -g root /etc/wazuh-dashboard /etc/wazuh-dashboard/certs # install -m 0600 /dev/null /etc/wazuh-dashboard/local.env # grep -E '^(WAZUH_INDEXER_KIBANASERVER_PASSWORD|WAZUH_MANAGER_WUI_PASSWORD)=' wazuh-install-files/credentials.env > /etc/wazuh-dashboard/local.env # install -m 0640 wazuh-install-files/$NODE_NAME.pem /etc/wazuh-dashboard/certs/dashboard.pem # install -m 0640 wazuh-install-files/$NODE_NAME-key.pem /etc/wazuh-dashboard/certs/dashboard-key.pem # install -m 0640 wazuh-install-files/root-ca.pem /etc/wazuh-dashboard/certs/indexer-ca.pem
The root CA of the deployment signed the Wazuh indexer certificates, so it is placed as
indexer-ca.pem. The Wazuh dashboard verifies the Wazuh manager API withmanager-ca.pem, the root CA of the Wazuh manager master node. Onlyrootcan read that file. Run the following command on the master node, and save the output asmanager-ca.pemin the working directory of this node:# cat /etc/wazuh-manager/export/ca.pem
Then run this command on this node:
# install -m 0640 manager-ca.pem /etc/wazuh-dashboard/certs/manager-ca.pem
Install the Wazuh dashboard package.
# rpm -ivh ./wazuh-offline/wazuh-packages/wazuh-dashboard*.rpm
# dpkg -i ./wazuh-offline/wazuh-packages/wazuh-dashboard*.deb
Check the ownership of the certificates. The package gives the certificates you placed to
rootwith thewazuh-dashboardgroup, with mode0750for the directory and0640for the files. It keepslocal.envreadable by root only, with ownerroot:rootand mode0600. Don't give them to thewazuh-dashboarduser. The Wazuh dashboard refuses to start when a file in/etc/wazuh-dashboard/certsisn't owned byrootor is writable by its group or others.# ls -ld /etc/wazuh-dashboard/certs /etc/wazuh-dashboard/certs/*
Edit the
/etc/wazuh-dashboard/opensearch_dashboards.ymlfile. The package already configuresserver.host,server.port, andopensearch.ssl.verificationMode. Verify these values and update onlyopensearch.hostsandwazuh_core.hosts.default.url:server.host: 0.0.0.0 server.port: 443 opensearch.hosts: ["https://<WAZUH_INDEXER_1_IP_ADDRESS>:9200", "https://<WAZUH_INDEXER_2_IP_ADDRESS>:9200"] opensearch.ssl.verificationMode: full wazuh_core.hosts: default: url: https://<WAZUH_MASTER_ADDRESS> port: 55000 username: wazuh-internal-client run_as: true ca: '/etc/wazuh-dashboard/certs/manager-ca.pem'
server.host: This setting specifies the host of the Wazuh dashboard server. To allow remote users to connect, set the value to the IP address or DNS name of the Wazuh dashboard. The value0.0.0.0accepts all available IP addresses on the host.opensearch.hosts: The URLs of the Wazuh indexer nodes. Set this value to the Wazuh indexer node addresses, even when all components share the same host. The addresses of the nodes are separated by commas.wazuh_core.hosts: The Wazuh manager API that the dashboard queries.urlmust point to the Wazuh manager API on the master node, the only node that runs it. Use one of the addresses in the master node'sapid.pemcertificate. Don't set apassword. The package stored thewazuh-internal-clientpassword in the Wazuh dashboard keystore, and the keystore value takes precedence over a password in this file. Leaverun_asandcaas the package wrote them.
Enable and start the Wazuh dashboard service. The package neither enables nor starts it.
# systemctl daemon-reload # systemctl enable wazuh-dashboard # systemctl start wazuh-dashboard
On a host with firewalld, open port 443/TCP for the browsers:
# firewall-cmd --permanent --add-port=443/tcp # firewall-cmd --reload
Run the following command to verify the Wazuh dashboard service is active.
# systemctl status wazuh-dashboard
If the service fails to start, run the following command to see the cause:
# journalctl -u wazuh-dashboard -n 50
A
MISSINGline names a password or file that isn't in place. AnUNSAFEline names a file or directory with the wrong owner or mode. The service stops after three failed starts. After you fix the cause, run the following commands to reset the count and start the service again:# systemctl reset-failed wazuh-dashboard # systemctl start wazuh-dashboard
Access the Wazuh web interface.
URL:
https://<WAZUH_DASHBOARD_ADDRESS>Username:
adminPassword: the
WAZUH_INDEXER_ADMIN_PASSWORDvalue in/etc/wazuh-indexer/export/credentials.envon the first Wazuh indexer node.
When you first access the Wazuh dashboard, your browser displays a warning that a trusted authority didn't issue the certificate. You can add an exception in the browser's advanced options. For better security, import the deployment's root CA into the browser's certificate manager instead. It's
wazuh-install-files/root-ca.pem, the same file as/etc/wazuh-dashboard/certs/indexer-ca.pem. You can also configure a certificate from a trusted authority. The certificate names only the Wazuh dashboard addresses inconfig.yml. To reach the dashboard by another address or DNS name without the warning, add it to the dashboard node'sipordnslist inconfig.yml. Do this before you run-g.To check both connections from the Wazuh dashboard host, run the following commands. Replace
<WAZUH_DASHBOARD_ADDRESS>with the address of this node inconfig.yml. The certificate of this node comes from the deployment's root CA, which the Wazuh dashboard also keeps asindexer-ca.pem. Each command asks for theadminpassword:# curl --cacert /etc/wazuh-dashboard/certs/indexer-ca.pem -u admin https://<WAZUH_DASHBOARD_ADDRESS>/api/status # curl --cacert /etc/wazuh-dashboard/certs/indexer-ca.pem -u admin -H 'osd-xsrf: true' -H 'Content-Type: application/json' -X POST https://<WAZUH_DASHBOARD_ADDRESS>/api/check-api -d '{"id":"default"}'
The first output includes
"state":"green". The second includes the name of the Wazuh manager master node, for example"node":"master-node".