Deploying Wazuh SIEM on a VPS: Comprehensive Security Monitoring and Threat Detection
TL;DR
In this detailed guide, we will set up Wazuh SIEM (Security Information and Event Management) step-by-step on your own VPS. You will get a powerful platform for collecting, analyzing, and correlating security logs, detecting intrusions, monitoring file integrity, and assessing vulnerabilities. This will significantly enhance the security level of your servers and applications, providing proactive protection against cyber threats.
- Installation and configuration of all Wazuh components: Manager, Indexer (OpenSearch), and Dashboard (OpenSearch Dashboards).
- Basic server preparation, including SSH setup, firewall configuration, and system updates.
- Configuration examples for secure HTTPS access using Certbot and Nginx.
- Recommendations for choosing a suitable VPS configuration and scaling.
- Backup and maintenance strategies for long-term system stability.
- Answers to frequently asked questions and solutions to common problems.
What we are setting up and why
We will be deploying Wazuh — a free and open-source security monitoring platform that combines SIEM, XDR (Extended Detection and Response), and SOAR (Security Orchestration, Automation and Response) functionalities. Wazuh allows you to collect, index, and analyze security data from various sources, such as operating system logs, applications, network devices, as well as real-time security events. At its core, Wazuh features a powerful engine for threat detection, file integrity monitoring, vulnerability analysis, incident response, and compliance.
Ultimately, you will get a centralized system that will monitor the security of your VPS or even an entire infrastructure. Wazuh will help you to:
- Detect intrusions: identify suspicious activity, brute-force attempts, and anomalies in user and process behavior.
- Monitor file integrity: track unauthorized changes in critical system files and configurations.
- Assess vulnerabilities: scan installed software for known vulnerabilities (CVEs).
- Collect and analyze logs: centralize logs from all your systems for easy searching, analysis, and auditing.
- Respond to incidents: automatically perform actions in response to detected threats, such as blocking IP addresses.
- Comply with standards: simplify the auditing process and compliance with standards such as PCI DSS, GDPR, HIPAA.
There are various approaches to deploying SIEM systems. You can choose cloud-managed solutions (e.g., Splunk Cloud, Azure Sentinel) or self-hosted deployment. Cloud solutions offer convenience and scalability without the need for infrastructure management, but often come with high costs and less control over data. Self-hosting Wazuh on a VPS, on the other hand, provides full control over your data and infrastructure, significantly reduces operational costs, and allows deep customization of the system to your unique requirements. This is an ideal option for VPS/dedicated server owners who want to build a reliable security system with minimal investment and maximum flexibility.
What VPS configuration is needed for this task
Choosing the right VPS configuration for Wazuh is critical, as the system can be quite resource-intensive, especially the Indexer (OpenSearch), which stores and indexes all logs. Requirements heavily depend on the volume of logs generated and the number of monitored agents.
Minimum requirements for a single VPS (Wazuh Manager, Indexer, Dashboard on one machine) for small environments (up to 20-30 agents)
- CPU: 4 vCPU (virtual cores). This will provide sufficient performance for indexing and event processing.
- RAM: 8-12 GB RAM. OpenSearch is the primary memory consumer; it will require at least 4-6 GB for stable operation, with the rest for Wazuh Manager and the operating system.
- Disk: 100-200 GB NVMe SSD. Disk speed is critical for OpenSearch. The volume depends on the log retention period. NVMe SSD significantly outperforms regular SSDs in terms of performance.
- Network: 1 Gbit/s. For log transmission and dashboard access.
Specific VPS plan for the task (for 30-50 agents)
For more active use, monitoring 30-50 agents, and storing logs for several weeks, we recommend the following basic configuration:
- CPU: 6-8 vCPU
- RAM: 16 GB RAM
- Disk: 200-300 GB NVMe SSD
- Network: 1 Gbit/s
A VPS with the specified characteristics will ensure comfortable Wazuh operation for most small and medium-sized projects. It is important to remember that these figures are a starting point, and actual needs may change depending on your workload.
When a dedicated server is needed, not a VPS
If you plan to monitor more than 100-200 agents, store logs for a long period (several months), or process a very large volume of data (e.g., logs from high-load web servers), then you should consider a dedicated server. Dedicated servers offer guaranteed resources, higher disk subsystem performance, and often a better price/performance ratio for heavy workloads. For example, a large deployment might require a server with 16+ physical cores, 64+ GB RAM, and several TB of NVMe SSD in a RAID array. In such cases, you should consider a suitable dedicated server to ensure the necessary performance and reliability.
Location: what it affects
The choice of VPS location affects several factors:
- Latency: The closer the server is to your agents and dashboard users, the lower the latency and faster the response.
- Legislation: Choose a location that complies with your data storage requirements and privacy laws (e.g., EU for GDPR).
- Cost: VPS prices can vary depending on the region.
It is generally recommended to choose a location that is geographically close to most of your monitored systems.
Server preparation
Before installing Wazuh, you need to perform basic preparation of your Ubuntu 24.04 LTS-based VPS. This includes creating a secure user, configuring SSH, the firewall, and updating the system.
1. Connecting via SSH
First, connect to your new VPS as the root user (or the one provided by your provider):
ssh root@ВАШ_IP_АДРЕС
2. Creating a new user with sudo privileges
Working as root is insecure. Let's create a new user and add them to the sudo group.
adduser wazuhadmin
usermod -aG sudo wazuhadmin
Replace wazuhadmin with your chosen username. You will be prompted to set a password and enter additional information (which can be skipped).
3. Configuring SSH keys for the new user (recommended)
For increased security, it is recommended to use SSH keys instead of passwords. Copy your public SSH key to the server.
su - wazuhadmin
mkdir -p ~/.ssh
chmod 700 ~/.ssh
exit
Now, copy your public key (which is on your local machine, usually in ~/.ssh/id_rsa.pub) to the server:
cat ~/.ssh/id_rsa.pub | ssh wazuhadmin@ВАШ_IP_АДРЕС "cat >> ~/.ssh/authorized_keys"
Make sure the permissions for authorized_keys are set correctly:
ssh wazuhadmin@ВАШ_IP_АДРЕС "chmod 600 ~/.ssh/authorized_keys"
4. Disabling password login for SSH (optional, but recommended)
Edit the SSH server configuration file to allow key-only login.
sudo nano /etc/ssh/sshd_config
Find and change the following lines:
#PasswordAuthentication yes
PasswordAuthentication no
#PermitRootLogin prohibit-password
PermitRootLogin no
Save changes (Ctrl+O, Enter) and exit (Ctrl+X). Restart the SSH service:
sudo systemctl restart sshd
Before disconnecting from root, ensure you can log in as wazuhadmin using your SSH key in a new terminal.
ssh wazuhadmin@ВАШ_IP_АДРЕС
If the login is successful, you can close the root session.
5. Configuring the firewall (UFW)
We will install and configure UFW (Uncomplicated Firewall) to allow only necessary ports.
sudo apt update && sudo apt install ufw -y
Allow SSH (port 22), Wazuh Manager (1514/TCP, 55000/TCP), OpenSearch (9200/TCP), and OpenSearch Dashboards (443/TCP for HTTPS).
sudo ufw allow 22/tcp comment 'SSH'
sudo ufw allow 1514/tcp comment 'Wazuh Agent communication'
sudo ufw allow 55000/tcp comment 'Wazuh API'
sudo ufw allow 9200/tcp comment 'OpenSearch REST API'
sudo ufw allow 443/tcp comment 'HTTPS for OpenSearch Dashboards'
sudo ufw enable
sudo ufw status verbose
Confirm firewall activation by typing y.
6. Installing Fail2Ban (recommended)
Fail2Ban will help protect against brute-force attacks on SSH and other services.
sudo apt install fail2ban -y
sudo systemctl enable fail2ban
sudo systemctl start fail2ban
sudo cp /etc/fail2ban/jail.conf /etc/fail2ban/jail.local
sudo nano /etc/fail2ban/jail.local
In the jail.local file, find the [sshd] section and ensure it is enabled (enabled = true). You can also configure bantime (block duration) and maxretry (number of attempts).
[sshd]
enabled = true
port = ssh
logpath = %(sshd_log)s
backend = %(sshd_backend)s
Save and exit. Restart Fail2Ban.
sudo systemctl restart fail2ban
sudo fail2ban-client status sshd
7. Updating the system and installing basic utilities
Ensure all packages are updated and install necessary utilities.
sudo apt update && sudo apt upgrade -y
sudo apt install curl wget apt-transport-https gnupg2 -y
Your server is now ready for Wazuh installation.
Software Installation — Step-by-Step
We will install Wazuh 5.0 (current version for 2026) in a unified architecture (Manager, Indexer, Dashboard on a single server) using official repositories.
1. Java Development Kit (JDK) Installation
OpenSearch (Indexer) requires Java. We will install OpenJDK 17.
sudo apt install openjdk-17-jdk -y # Install OpenJDK 17
java -version # Check Java version
2. Adding the Wazuh Repository
We will add the official Wazuh repository and its GPG key.
curl -s https://packages.wazuh.com/key/GPG-KEY-WAZUH | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/wazuh.gpg > /dev/null # Add Wazuh GPG key
echo "deb https://packages.wazuh.com/5.x/apt/ stable main" | sudo tee -a /etc/apt/sources.list.d/wazuh.list # Add Wazuh 5.x repository
sudo apt update # Update package list
3. Wazuh Indexer (OpenSearch) Installation
We will install Wazuh Indexer, which is a fork of OpenSearch. Wazuh 5.0 will use OpenSearch 2.x.
sudo apt install wazuh-indexer -y # Install Wazuh Indexer
After installation, it is necessary to generate certificates for secure communication between components. Wazuh provides a utility for this.
sudo /usr/share/wazuh-indexer/bin/indexer-cert-tool.sh # Run certificate generation utility
This utility will create the necessary certificate files (admin-key.pem, admin.pem, node-key.pem, node.pem, ca.pem) in the current directory. We will move them to the required locations.
sudo mkdir /etc/wazuh-indexer/certs
sudo mv ~/admin-key.pem ~/admin.pem ~/node-key.pem ~/node.pem ~/ca.pem /etc/wazuh-indexer/certs/ # Move certificates
sudo chown -R wazuh-indexer:wazuh-indexer /etc/wazuh-indexer/certs # Set correct permissions
sudo chmod -R 500 /etc/wazuh-indexer/certs # Restrict access to certificates
sudo chmod 400 /etc/wazuh-indexer/certs/key.pem # Restrict access to private keys
Now, edit the Indexer configuration to use these certificates. Open the file /etc/wazuh-indexer/opensearch.yml.
sudo nano /etc/wazuh-indexer/opensearch.yml
Add or modify the following lines:
# ---------------------------------- Network -----------------------------------
network.host: 0.0.0.0 # Allow access from all interfaces
http.port: 9200 # Standard HTTP port
# --------------------------------- Security ---------------------------------
plugins.security.ssl.http.enabled: true
plugins.security.ssl.http.pemcert_filepath: /etc/wazuh-indexer/certs/node.pem
plugins.security.ssl.http.pemkey_filepath: /etc/wazuh-indexer/certs/node-key.pem
plugins.security.ssl.http.rootcas_filepath: /etc/wazuh-indexer/certs/ca.pem
plugins.security.ssl.transport.enabled: true
plugins.security.ssl.transport.pemcert_filepath: /etc/wazuh-indexer/certs/node.pem
plugins.security.ssl.transport.pemkey_filepath: /etc/wazuh-indexer/certs/node-key.pem
plugins.security.ssl.transport.rootcas_filepath: /etc/wazuh-indexer/certs/ca.pem
plugins.security.ssl.transport.enforce_hostname_verification: false
plugins.security.allow_unsafe_democertificates: true # Temporarily for simplification, in production it's better to use your own CAs
plugins.security.nodes_dn:
- "CN=.wazuh-indexer.local" # Replace with your FQDN if you are using one
Save and exit. Now you can start and check the Indexer.
sudo systemctl daemon-reload # Reload systemd units
sudo systemctl enable wazuh-indexer # Enable Indexer autostart
sudo systemctl start wazuh-indexer # Start Indexer
sudo systemctl status wazuh-indexer # Check Indexer status
Wait a few minutes for the Indexer to fully start. You can check its functionality by accessing the API:
curl -XGET https://localhost:9200 -u admin:admin -k # Check OpenSearch API availability (default login/password admin:admin)
You should receive a JSON response with cluster information.
4. Wazuh Manager Installation
Wazuh Manager is the core of the system, which processes, analyzes, and correlates data from agents.
sudo apt install wazuh-manager -y # Install Wazuh Manager
After installation, you need to configure the Manager to communicate with the Indexer. Edit the file /etc/wazuh/wazuh_indexer.yaml.
sudo nano /etc/wazuh/wazuh_indexer.yaml
Specify the IP address or FQDN of your Indexer (in this case, localhost).
# Configuration for connection to Wazuh Indexer
# This file is managed by the wazuh-manager package.
# Do not edit this file directly, use the /etc/wazuh/wazuh_indexer.yaml.template file instead.
---
nodes:
- address: "localhost" # Change to the IP address or FQDN of your Indexer
port: 9200
# SSL configuration
# If using custom certificates for the Wazuh Indexer, specify the path to the CA certificate.
# Otherwise, the default certificates generated by the Wazuh Indexer will be used.
ssl_certificate_authorities:
- "/etc/wazuh-indexer/certs/ca.pem" # Path to the Indexer's CA certificate
Save and exit. Now start the Manager.
sudo systemctl enable wazuh-manager # Enable Manager autostart
sudo systemctl start wazuh-manager # Start Manager
sudo systemctl status wazuh-manager # Check Manager status
5. Wazuh Dashboard (OpenSearch Dashboards) Installation
Wazuh Dashboard provides a web interface for visualizing and managing security data.
sudo apt install wazuh-dashboard -y # Install Wazuh Dashboard
Similar to the Indexer, the Dashboard also needs certificates for secure operation. We will use the same certificates as for the Indexer.
sudo mkdir /etc/wazuh-dashboard/certs
sudo cp /etc/wazuh-indexer/certs/ca.pem /etc/wazuh-indexer/certs/node.pem /etc/wazuh-indexer/certs/node-key.pem /etc/wazuh-dashboard/certs/ # Copy certificates
sudo chown -R wazuh-dashboard:wazuh-dashboard /etc/wazuh-dashboard/certs # Set correct permissions
sudo chmod -R 500 /etc/wazuh-dashboard/certs # Restrict access to certificates
sudo chmod 400 /etc/wazuh-dashboard/certs/key.pem # Restrict access to private keys
Edit the Dashboard configuration file /etc/wazuh-dashboard/opensearch_dashboards.yml.
sudo nano /etc/wazuh-dashboard/opensearch_dashboards.yml
Add or modify the following lines:
server.host: "0.0.0.0" # Allow access from all interfaces
server.port: 443 # Use standard HTTPS port 443
opensearch.hosts: ["https://localhost:9200"] # Specify Indexer address
opensearch.ssl.verificationMode: none # Temporarily disable SSL verification, as we are using self-signed certificates
opensearch.ssl.certificate: /etc/wazuh-dashboard/certs/node.pem
opensearch.ssl.key: /etc/wazuh-dashboard/certs/node-key.pem
opensearch.ssl.certificateAuthorities: ["/etc/wazuh-dashboard/certs/ca.pem"]
# Wazuh API configuration
wazuh.manager.host: "https://localhost" # Wazuh Manager address
wazuh.manager.port: 55000 # Wazuh API port
wazuh.manager.ssl.verify: false # Disable SSL verification for Wazuh API
Save and exit. Now start the Dashboard.
sudo systemctl enable wazuh-dashboard # Enable Dashboard autostart
sudo systemctl start wazuh-dashboard # Start Dashboard
sudo systemctl status wazuh-dashboard # Check Dashboard status
Wait a few minutes for the Dashboard to fully start. After that, you will be able to access the web interface at https://YOUR_IP_ADDRESS. The default login and password for OpenSearch Dashboards are admin:admin.