Installing the Wazuh dashboard step-by-step
Install and configure the Wazuh dashboard following step-by-step instructions. The Wazuh dashboard is a web interface for mining and visualizing security data.
Note
You need root user privileges to run all the commands described below.
Wazuh dashboard installation
Follow these steps to install the Wazuh dashboard.
Installing package dependencies
Install the following packages if missing. Amazon Linux 2023 already has the
curlcommand, so don't install thecurlpackage there:# apt-get install -y tar curl
# yum -y install tar
# dnf -y install tar
Adding the Wazuh repository
Note
If the Wazuh repository is already configured and enabled on this host (for example on the Wazuh indexer host), skip these steps.
Install the following packages if missing:
# apt-get update && apt-get install -y gnupg apt-transport-https curl
Install the GPG key:
# curl -s https://packages-staging.xdrsiem.wazuh.info/key/GPG-KEY-WAZUH | gpg --no-default-keyring --keyring gnupg-ring:/usr/share/keyrings/wazuh.gpg --import && chmod 644 /usr/share/keyrings/wazuh.gpg
Add the repository:
# echo "deb [signed-by=/usr/share/keyrings/wazuh.gpg] https://packages-staging.xdrsiem.wazuh.info/pre-release/5.x/apt/ unstable main" | tee /etc/apt/sources.list.d/wazuh.list
Update the package information:
# apt-get update
Import the GPG key:
# rpm --import https://packages-staging.xdrsiem.wazuh.info/key/GPG-KEY-WAZUH
Add the repository:
# echo -e '[wazuh]\ngpgcheck=1\ngpgkey=https://packages-staging.xdrsiem.wazuh.info/key/GPG-KEY-WAZUH\nenabled=1\nname=EL-$releasever - Wazuh\nbaseurl=https://packages-staging.xdrsiem.wazuh.info/pre-release/5.x/yum/\nprotect=1' | tee /etc/yum.repos.d/wazuh.repo
Import the GPG key:
# rpm --import https://packages-staging.xdrsiem.wazuh.info/key/GPG-KEY-WAZUH
Add the repository:
# echo -e '[wazuh]\ngpgcheck=1\ngpgkey=https://packages-staging.xdrsiem.wazuh.info/key/GPG-KEY-WAZUH\nenabled=1\nname=EL-$releasever - Wazuh\nbaseurl=https://packages-staging.xdrsiem.wazuh.info/pre-release/5.x/yum/\npriority=1' | tee /etc/yum.repos.d/wazuh.repo
Deploying certificates and passwords
Do this before installing the package. The package then uses these passwords and CA certificates instead of generating its own, and issues this node's certificate.
Note
If the Wazuh indexer and Wazuh manager are already installed on this host, skip this section. Do not extract the archive or place any files manually. The Wazuh dashboard package retrieves the passwords and certificates from their export directories during installation and issues its own certificate.
Make sure that a copy of the wazuh-certificates.tar file, created in the Wazuh indexer Certificate creation stage, is placed in your working directory.
Extract the archive, and place the passwords, the Wazuh indexer root CA, and the Wazuh manager CA. The archive's
root-ca.pemis the Wazuh indexer root CA, the same certificate as/etc/wazuh-indexer/export/ca.pemon the first Wazuh indexer node:# umask 022 # mkdir wazuh-certificates # tar -xf wazuh-certificates.tar -C wazuh-certificates # install -d -m 0750 /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-certificates/credentials.env > /etc/wazuh-dashboard/local.env # install -m 0640 wazuh-certificates/root-ca.pem /etc/wazuh-dashboard/certs/indexer-ca.pem # rm -rf wazuh-certificates
The Wazuh dashboard uses
manager-ca.pemto verify the Wazuh manager API. It's the root CA of the Wazuh manager master node,/etc/wazuh-manager/export/ca.pemon that 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
The
wazuh-dashboarduser does not exist yet. When the package is installed, it keeps these files and gives them their owner.Optional: set the addresses that browsers use to reach this node. Without this setting, the package puts the host name and the IP addresses of this host in the certificate. Your list replaces them. Separate the entries with commas, and write
IP:before an address andDNS:before a name:# echo 'WAZUH_DASHBOARD_CERT_SANS=IP:<WAZUH_DASHBOARD_ADDRESS>,DNS:<WAZUH_DASHBOARD_NAME>' >> /etc/wazuh-dashboard/local.env
The package always adds
localhost,127.0.0.1, and::1. It issues the certificate from a root CA that it creates in/etc/wazuh-dashboard/ca, and publishes that CA as/etc/wazuh-dashboard/export/ca.pemfor the browsers.Recommended action: If no other Wazuh components will be installed on this node, remove the
wazuh-certificates.tarfile.# rm -f ./wazuh-certificates.tar
Installing the Wazuh dashboard
Install the Wazuh dashboard package:
# apt-get -y install wazuh-dashboard=5.0.0-1
# yum -y install wazuh-dashboard-5.0.0-1
# dnf -y install wazuh-dashboard-5.0.0-1
Release candidate packages carry the version of the final release,
5.0.0-1. Only their file names show the RC stage, for examplewazuh-dashboard_5.0.0-rc2_amd64.deb, sodpkg -landrpm -qshow5.0.0-1.
Configuring the Wazuh dashboard
Edit the
/etc/wazuh-dashboard/opensearch_dashboards.ymlfile. The package ships it pre-filled with single-host values, so change onlyopensearch.hostsandwazuh_core.hosts.default.url, and leave the rest of the file as shipped:server.host: The package sets0.0.0.0, which accepts connections on every address of the host. You don't need to change it.opensearch.hosts: The package setshttps://localhost:9200. Replace it with the URL of the Wazuh indexer node, using the address you set innetwork.hostin Configuring the Wazuh indexer. If you setnetwork.hostto one IP address, the Wazuh indexer listens only on that address. Thenlocalhostfails, even when the Wazuh indexer runs on this host. If you left the package default,https://localhost:9200works.server.host: 0.0.0.0 server.port: 443 opensearch.hosts: https://<WAZUH_INDEXER_ADDRESS>:9200 opensearch.ssl.verificationMode: full
Keep the
opensearch.ssl.certificateAuthoritiesvalue that the package ships,/etc/wazuh-dashboard/certs/indexer-ca.pem.For a Wazuh indexer cluster, list every node:
opensearch.hosts: ["https://10.0.0.2:9200", "https://10.0.0.3:9200", "https://10.0.0.4:9200"]
wazuh_core.hosts.default.url: The Wazuh manager master node. Replace<WAZUH_MASTER_ADDRESS>with the IP address or DNS name of the master node. If the Wazuh manager master node is on this host, keep the shipped value,https://localhost.Edit the block that the package shipped, and don't add a second one or a password line. The host in
urlmust be in the Wazuh manager API certificate. To list its addresses, run this command on the master node:# openssl x509 -in /etc/wazuh-manager/certs/apid.pem -noout -ext subjectAltName
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'
On a host with firewalld, open port 443/TCP for the browsers:
# firewall-cmd --permanent --add-port=443/tcp # firewall-cmd --reload
Note
Firewalls can block communication between Wazuh components on different hosts. Refer to the Required ports section and make sure the necessary ports are open.
Starting the Wazuh dashboard service
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
Run the following command to verify the Wazuh dashboard status. Check that the output shows
Active: active (running):# systemctl status wazuh-dashboard
If the service fails to start, see Troubleshooting Wazuh dashboard installation and startup.
Get the
adminpassword. On the Wazuh indexer node where you ranindexer-security-init.sh, run the following command:# grep '^WAZUH_INDEXER_ADMIN_PASSWORD=' /etc/wazuh-indexer/export/credentials.env | cut -d= -f2-
Access the Wazuh web interface with your
adminuser credentials. This is the default administrator account for the Wazuh indexer, and it allows you to access the Wazuh dashboard.URL:
https://<WAZUH_DASHBOARD_ADDRESS>Username:
adminPassword: the password from step 3
The browser warns that the certificate wasn't issued by a trusted authority, because Wazuh creates its own certificate authority. Add an exception in the browser, or, for better security, import the CA that issued the certificate into the browser's certificate manager. The Wazuh dashboard package issued the certificate, and its CA is
/etc/wazuh-dashboard/export/ca.pem. Onlyrootcan read this file. To copy it, run the following command on this host:# cat /etc/wazuh-dashboard/export/ca.pem
Save the output as
ca.pemon the computer that runs the browser. You can also configure a certificate from a trusted authority.
Troubleshooting Wazuh dashboard installation and startup
If the Wazuh dashboard service fails to start, run the following command to see the cause:
# journalctl -u wazuh-dashboard -n 50
A
MISSING WAZUH_INDEXER_KIBANASERVER_PASSWORDorMISSING WAZUH_MANAGER_WUI_PASSWORDline means that the password isn't in/etc/wazuh-dashboard/local.env.A
MISSING /etc/wazuh-dashboard/certs/indexer-ca.pemline means that the CA isn't there. Repeat Deploying certificates and passwords to place it.An
UNSAFEline names a file or directory that the start check refuses, and the reason, for exampleUNSAFE /etc/wazuh-dashboard/certs: it is not owned by root. The check runs as root and accepts only files and directories that root owns and no other user can write. The Wazuh dashboard reads its certificates through thewazuh-dashboardgroup, so keeprootas the owner even if the service can't read a file. Run the following commands to restore the owner and permissions of the certificates directory:# chown -R root:wazuh-dashboard /etc/wazuh-dashboard/certs # chmod 0750 /etc/wazuh-dashboard/certs # chmod 0640 /etc/wazuh-dashboard/certs/*.pem
If the line names the
/etc/wazuh-dashboard/caor/etc/wazuh-dashboard/exportdirectory, run the following commands:# chown -R root:root /etc/wazuh-dashboard/ca /etc/wazuh-dashboard/export # chmod -R go-w /etc/wazuh-dashboard/ca /etc/wazuh-dashboard/export # chmod 0700 /etc/wazuh-dashboard/ca /etc/wazuh-dashboard/export # chmod 0400 /etc/wazuh-dashboard/ca/root-ca.key
For the other messages, see Wazuh dashboard does not start. 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
Securing your Wazuh installation
Once every component is installed and running, each component stores the passwords it needs in its own keystore or database. The components don't need local.env or export/credentials.env after installation, and deleting them doesn't affect running or restarted components. If you keep them, keep them readable by root only. The components check them at every start and refuse to start if one has the wrong owner or permissions. Every node got its passwords from the credentials.env file you created in Creating the passwords. The first Wazuh indexer node read it directly, and the other nodes got it through wazuh-certificates.tar.
Log in to the Wazuh dashboard. A successful login shows that the Wazuh dashboard reaches the Wazuh indexer. Then open the menu and go to Dashboard management > Server API. In the API connection card, the Host is the address of the Wazuh manager master node, and the Status is Online. This shows that the Wazuh dashboard reaches the Wazuh manager. If the Status is Offline, check that the
wazuh-managerservice runs on the master node and that the Wazuh dashboard host reaches port55000/TCP. Also check that the Wazuh manager API certificate lists the address in the Host field. To list the addresses in the certificate, run this command on the master node:# openssl x509 -in /etc/wazuh-manager/certs/apid.pem -noout -ext subjectAltName
Also check that
/etc/wazuh-dashboard/certs/manager-ca.pemexists on the Wazuh dashboard host. To see the cause, run the following command on that host, then click Refresh:# journalctl -u wazuh-dashboard -n 50
You can also check both connections on the Wazuh dashboard host. Each command asks for the
adminpassword:# curl --cacert /etc/wazuh-dashboard/export/ca.pem -u admin https://localhost/api/status # curl --cacert /etc/wazuh-dashboard/export/ca.pem -u admin -H 'osd-xsrf: true' -H 'Content-Type: application/json' -X POST https://localhost/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".Securely store the five passwords. The
credentials.envfile in the working directory of the first Wazuh indexer node holds all five.Remove the
credentials.envyou created on the first Wazuh indexer node and anywazuh-certificates.tarleft behind, on every node. The passwords of each component stay inlocal.envandexport/credentials.envin its configuration directory, readable byrootonly:# rm -f ./credentials.env ./wazuh-certificates.tar
On each Wazuh dashboard node, remove the two passwords from
/etc/wazuh-dashboard/local.env. The Wazuh dashboard keeps them in its keystore. KeepWAZUH_DASHBOARD_CERT_SANSif you set it. Skip this step on a host without that file, such as an all-in-one host:# sed -i -E '/^(WAZUH_INDEXER_KIBANASERVER_PASSWORD|WAZUH_MANAGER_WUI_PASSWORD)=/d' /etc/wazuh-dashboard/local.env
Only the first Wazuh indexer node must hold the Wazuh indexer root CA private key, in
/etc/wazuh-indexer/ca. Back up this directory securely: you need the key to add nodes or renew certificates. Every Wazuh manager node and every Wazuh dashboard node also keeps the root CA private key of its package, in/etc/wazuh-manager/caor/etc/wazuh-dashboard/ca. Back them up too. Keep each/etc/wazuh-manager/cadirectory owned byroot:root, back it up with its node, and never copy it to a Wazuh dashboard node. With the Wazuh dashboard CA, a new certificate is trusted by the browsers that already importedexport/ca.pem, and removing the RPM package deletes it. Run the following command on every Wazuh indexer node to check:# ls -A /etc/wazuh-indexer/ca 2>/dev/null
If the command lists
root-ca.keyon a Wazuh indexer node other than the first one, remove the key there. Never run this on the first Wazuh indexer node:# rm -f /etc/wazuh-indexer/ca/root-ca.key
Editing local.env after installation doesn't change any password. To change a password after installation, see the password management documentation.
Disable Wazuh updates
After all Wazuh components on this host are installed, disable the Wazuh repository to prevent accidental upgrades:
# sed -i "s/^deb /#deb /" /etc/apt/sources.list.d/wazuh.list
# apt update
# sed -i "s/^enabled=1/enabled=0/" /etc/yum.repos.d/wazuh.repo
# sed -i "s/^enabled=1/enabled=0/" /etc/yum.repos.d/wazuh.repo
Next steps
All the Wazuh central components are successfully installed and secured.
The Wazuh environment is now ready, and you can proceed with installing the Wazuh agent on the endpoints to be monitored. To perform this action, see the Wazuh agent section.
If you want to uninstall the Wazuh dashboard, see Uninstall the Wazuh dashboard.