VPS Tutorials
Wazuh SIEM on a VPS (2026): Docker, agents, HTTPS and recovery
Deploy single-node Wazuh on Ubuntu with Docker and Caddy. Restrict management ports, replace credentials, enroll compatible Linux agents, verify FIM, and plan backups and safe upgrades.

When you manage several website servers, databases, jump hosts and employee endpoints, CPU and uptime metrics leave important questions unanswered. Who is repeatedly trying to log in through SSH? Have system files changed? Which host runs a package with a known vulnerability? Can a serious alert be traced to a particular machine and time?
Wazuh is an open-source SIEM/XDR platform for agent security events, file integrity monitoring, vulnerability detection, security configuration assessment, log analysis and active response. This full tutorial uses Wazuh 4.14.7, Ubuntu 24.04, single-node Docker Compose and Caddy to deploy central components, restrict ports, configure HTTPS, enroll Linux agents, test alerts, prepare backups and plan upgrades. The version context comes from the source's September 2026 review. Its description of Wazuh 5.0 as prerelease belongs to that date; check current official release and security notices before choosing a production version today.
These tools focus on different questions and can complement one another:
| Tool | Main question | Typical data | Best fit |
|---|---|---|---|
| Wazuh | Is a host attacked, altered or at risk? | Security logs, file changes, vulnerabilities, baselines | SIEM, XDR, compliance and endpoint security |
| Zabbix | Are servers and services healthy? | CPU, RAM, disk, ports, SNMP | Infrastructure availability and capacity |
| Sentry | Why does the application fail, and which release caused it? | Exceptions, stacks, traces, releases | Application errors and performance |
For capacity and device health, start with the Zabbix deployment guide; for code exceptions, see self-hosted Sentry. A production combination can use Zabbix for system health, Sentry for application faults and Wazuh for security events.
The official single-node Docker minimum is 4 CPU cores, 8 GB RAM and 50 GB disk. That is a small-deployment floor rather than a capacity guarantee. Log volume, agent count, index retention and rules all affect resource use.
| Scope | Suggested starting resources | Notes |
|---|---|---|
| Test, 1–5 agents | 4 vCPU, 8 GB RAM, 80 GB NVMe | Limit logs and validate the complete workflow |
| Small production, 5–30 agents | 8 vCPU, 16 GB RAM, 200 GB NVMe | Headroom for index growth and upgrades |
| More agents or high log volume | Measure first; consider multiple nodes | Agent count alone is insufficient |
The source architecture routes browser HTTPS through Caddy to the local Dashboard. Internal components use the container network; agents reach Manager event/enrollment ports:
浏览器 -> Caddy :443 -> Wazuh Dashboard :5601(仅本机)
|
+-> Wazuh Indexer(内部网络)
+-> Wazuh Manager(内部网络)
Linux Agent -> Wazuh Manager :1514(事件)
Linux Agent -> Wazuh Manager :1515(注册)
Keep Manager API 55000/TCP, Indexer API 9200/TCP and direct Dashboard access off the public Internet. Open 514/UDP only for an intentional traditional Syslog receiver. Prefer WireGuard, Tailscale or a private network for agents. If public connectivity is required, restrict 1514/1515 to agent egress addresses in the provider firewall and verify Docker forwarding restrictions as described below.
Point a domain such as wazuh.example.com to the VPS. Do not add an AAAA record without working IPv6. Install the Ubuntu prerequisites:
sudo apt update
sudo apt full-upgrade -y
sudo apt install -y git curl ca-certificates caddy
docker --version
docker compose version
Docker Engine and the Compose plugin must already be installed. Use Docker's official Ubuntu repository if they are absent, and make sure the deployment account can run the commands: use sudo consistently or deliberately grant Docker access, which is effectively root access. Install python3 for the structured configuration check below and netcat-openbsd on agents for connectivity tests. Review the production Compose checklist for log rotation, health checks, resource limits and rollback.
Wazuh Indexer uses OpenSearch and needs the host memory-mapping limit set persistently:
sudo sysctl -w vm.max_map_count=262144
printf 'vm.max_map_count=262144\n' | sudo tee /etc/sysctl.d/99-wazuh.conf
sudo sysctl --system
sysctl vm.max_map_count
The final result should be vm.max_map_count = 262144. An unchanged low limit commonly causes Indexer to exit or fail initialization.
Use the official release tag rather than the moving default branch:
sudo git clone https://github.com/wazuh/wazuh-docker.git \
-b v4.14.7 /opt/wazuh-docker
sudo chown -R "$USER":"$USER" /opt/wazuh-docker
cd /opt/wazuh-docker/single-node
git describe --tags --exact-match
Expect v4.14.7. The single-node configuration starts Manager, Indexer and Dashboard and persists configuration, logs, queues and indexes in named volumes. Review relevant security fixes before using this historical version in a new production deployment.
Generate the internal TLS certificates:
cd /opt/wazuh-docker/single-node
docker compose -f generate-indexer-certs.yml run --rm generator
find config/wazuh_indexer_ssl_certs -maxdepth 1 -type f -print
Verify that certificates and required private keys exist. Keep private keys out of public repositories and support tickets; ensure the component users can read the files they need without granting broad access.
The official configuration publishes Dashboard, Indexer, Manager API and Syslog ports for initial use. Create a separate production copy and apply the original transformations:
cd /opt/wazuh-docker/single-node
cp docker-compose.yml docker-compose.production.yml
sed -i 's/"9200:9200"/"127.0.0.1:9200:9200"/' docker-compose.production.yml
sed -i 's/55000:55000/127.0.0.1:55000:55000/' docker-compose.production.yml
sed -i 's/514:514\/udp/127.0.0.1:514:514\/udp/' docker-compose.production.yml
sed -i 's/- 443:5601/- "127.0.0.1:5601:5601"/' docker-compose.production.yml
docker compose -f docker-compose.production.yml config > /tmp/wazuh-compose-rendered.yml
grep -nE '127\.0\.0\.1|1514|1515|514|55000|9200|5601' \
/tmp/wazuh-compose-rendered.yml
Do not save expanded credentials in a shared temporary file. Use a private file with restrictive permissions or inspect port-only JSON output. Successful sed execution is not proof that the resulting bindings are correct. Confirm:
- Dashboard
5601, Indexer9200, Manager API55000and optional Syslog514/UDPbind only to127.0.0.1. 1514/TCPand1515/TCPare reachable by agents through the chosen restricted network.- No
0.0.0.0:443publication remains to conflict with Caddy.
If Syslog is unused, remove the 514/UDP mapping. Keep docker-compose.production.yml as local deployment configuration and compare it with each target release during upgrades.
Docker-published ports can bypass ordinary UFW input rules. A source-IP allow rule in UFW is not sufficient evidence of restriction. Prefer replacing the Manager ports list with explicit bindings to your real VPN/private address, for example:
ports:
- "10.66.0.1:1514:1514"
- "10.66.0.1:1515:1515"
- "127.0.0.1:55000:55000"
Here 10.66.0.1 is only an example of an address already assigned to the host. Edit the existing list rather than merging an override that might retain public bindings. Ensure the private interface exists before starting. For public agent ports, enforce restrictions in the provider security group and an appropriate Docker forwarding policy, and test from an unauthorized external address as well as an allowed agent.
Inspect the effective bindings without printing environment secrets:
docker compose -f docker-compose.production.yml config --format json | python3 -c '
import json, sys
data = json.load(sys.stdin)
for name in ("wazuh.manager", "wazuh.indexer", "wazuh.dashboard"):
for port in data["services"][name].get("ports", []):
print(name, port.get("host_ip", "all interfaces"), port.get("published"), port.get("target"), port.get("protocol", "tcp"))
'
Keep the new Dashboard restricted to the intended administrator while default credentials exist. Pull and start:
cd /opt/wazuh-docker/single-node
docker compose -f docker-compose.production.yml pull
docker compose -f docker-compose.production.yml up -d
docker compose -f docker-compose.production.yml ps
The three Wazuh images should all use 4.14.7. Dashboard may initially report that Indexer is unavailable while components initialize. Give startup time before repeatedly recreating services; never delete data volumes to cure a transient warning. Inspect components in order:
docker compose -f docker-compose.production.yml logs --tail=100 wazuh.indexer
docker compose -f docker-compose.production.yml logs --tail=100 wazuh.manager
docker compose -f docker-compose.production.yml logs --tail=100 wazuh.dashboard
curl -kI https://127.0.0.1:5601/
ss -lntup | grep -E ':1514|:1515|:514|:55000|:9200|:5601'
curl -k is a local diagnostic for the internal self-signed certificate, not permission to ignore browser TLS errors. 5601/9200/55000/514 should be bound to loopback where published. Also test actual access from another host; socket listings alone do not check provider or Docker forwarding rules.
The Dashboard uses internal self-signed HTTPS on 5601. Caddy connects locally and terminates trusted browser HTTPS. Configure /etc/caddy/Caddyfile:
wazuh.example.com {
encode zstd gzip
reverse_proxy https://127.0.0.1:5601 {
transport http {
tls_insecure_skip_verify
}
}
header {
Strict-Transport-Security "max-age=31536000; includeSubDomains"
X-Content-Type-Options "nosniff"
Referrer-Policy "strict-origin-when-cross-origin"
}
}
tls_insecure_skip_verify affects only Caddy's loopback connection to the internal upstream. External clients still validate the public certificate normally. For stronger upstream verification, configure Caddy to trust the internal CA and match the upstream certificate's server name. Enable HSTS includeSubDomains only after considering every affected subdomain.
Validate and reload after replacing default credentials and restricting bootstrap access:
sudo caddy validate --config /etc/caddy/Caddyfile
sudo systemctl reload caddy
curl -I https://wazuh.example.com/
Certificate failures call for checking DNS, provider rules for 80/443, UFW, AAAA records and port conflicts. Consult the UFW recovery guide and keep an authenticated SSH session open while changing rules.
The initial Dashboard login is admin / SecretPassword. Use it only for controlled initialization; replace defaults before allowing general Internet access.
Indexer admin, Dashboard service account kibanaserver and Manager API account wazuh-wui have different configuration references. Log out, take a protected backup of single-node/config/, and stop the stack before changing Indexer passwords. Generate compatible password hashes, update config/wazuh_indexer/internal_users.yml and every corresponding Compose reference. For wazuh-wui, update both config/wazuh_dashboard/wazuh.yml and Manager/Dashboard environment settings. Escape a literal $ as $$ when placing it directly in Compose YAML.
Generate each Indexer password hash interactively with the pinned image:
docker run --rm -it wazuh/wazuh-indexer:4.14.7 \
bash /usr/share/wazuh-indexer/plugins/opensearch-security/tools/hash.sh
Do not include passwords in shell history, screenshots or Git. Preserve any custom users in internal_users.yml; applying an incomplete security configuration can delete them. Follow the official password procedure one Indexer user at a time, keeping service references synchronized.
Changing a hash file alone does not update the running Indexer security index. Start the private stack, wait for Indexer readiness, then apply the reviewed security configuration with the provided admin certificate:
docker compose -f docker-compose.production.yml up -d
docker compose -f docker-compose.production.yml exec -T wazuh.indexer bash -e <<'SECURITY'
export JAVA_HOME=/usr/share/wazuh-indexer/jdk
config_dir=/usr/share/wazuh-indexer/config
bash /usr/share/wazuh-indexer/plugins/opensearch-security/tools/securityadmin.sh \
-cd "$config_dir/opensearch-security/" -nhnv \
-cacert "$config_dir/certs/root-ca.pem" \
-cert "$config_dir/certs/admin.pem" \
-key "$config_dir/certs/admin-key.pem" -p 9200 -icl
SECURITY
This applies the complete security configuration directory, so review roles and custom users before running it. The official API password requirement is 8–64 characters containing uppercase, lowercase, a number and a symbol; an invalid API password can prevent Manager startup. Recreate containers after updating API references. Confirm old defaults no longer authenticate and component connections still work. Use individual administrator accounts, minimum privileges and VPN or fixed-IP restrictions for the dashboard.
Allow current administrative SSH access first, then web traffic. Replace the documentation address 203.0.113.10 with the actual agent egress address or private range:
sudo ufw allow OpenSSH
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
sudo ufw allow from 203.0.113.10 to any port 1514 proto tcp
sudo ufw allow from 203.0.113.10 to any port 1515 proto tcp
sudo ufw enable
sudo ufw status numbered
Do not use unrestricted ufw allow 9200 or ufw allow 55000. Combine UFW with the Docker/provider restrictions above. For changing agent addresses, a VPN is usually preferable to a public enrollment port. Restrict enrollment further after provisioning and review authentication/certificate options; network reachability is not itself a trusted enrollment policy. See the VPS hardening checklist.
Install an agent on the operating system being monitored. The official documentation explains that an ordinary containerized agent cannot directly monitor the host; placing it in Docker does not provide host visibility automatically.
The source's Ubuntu 24.04 setup is:
sudo apt-get update
sudo apt-get install -y gnupg apt-transport-https curl
curl -s https://packages.wazuh.com/key/GPG-KEY-WAZUH \
| sudo gpg --no-default-keyring \
--keyring gnupg-ring:/usr/share/keyrings/wazuh.gpg --import
sudo chmod 644 /usr/share/keyrings/wazuh.gpg
echo "deb [signed-by=/usr/share/keyrings/wazuh.gpg] https://packages.wazuh.com/4.x/apt/ stable main" \
| sudo tee /etc/apt/sources.list.d/wazuh.list
sudo apt-get update
sudo WAZUH_MANAGER="WAZUH_MANAGER_IP" apt-get install -y wazuh-agent
sudo systemctl daemon-reload
sudo systemctl enable --now wazuh-agent
sudo systemctl status wazuh-agent --no-pager
Replace WAZUH_MANAGER_IP with the Manager address reachable over the agent's VPN/private network, not the Manager host's 127.0.0.1. Manager must be at least as new as its agents. The unversioned install above can select a newer agent. After adding the repository, use this versioned install before starting an agent for the pinned Manager:
apt-cache madison wazuh-agent
sudo WAZUH_MANAGER="WAZUH_MANAGER_IP" apt-get install -y wazuh-agent=4.14.7-1
sudo systemctl daemon-reload
sudo systemctl enable --now wazuh-agent
The official amd64 repository contains 4.14.7-1; verify availability and architecture on your target rather than silently installing another release. If the manager changes, select the compatible agent package accordingly. Hold the package to avoid accidental incompatibility:
echo "wazuh-agent hold" | sudo dpkg --set-selections
dpkg --get-selections | grep wazuh-agent
In the server Dashboard, open Agents management → Summary. If the agent is absent, inspect it:
sudo tail -n 100 /var/ossec/logs/ossec.log
sudo grep -n '<address>' /var/ossec/etc/ossec.conf
nc -vz WAZUH_MANAGER_IP 1514
nc -vz WAZUH_MANAGER_IP 1515
Review wazuh.manager logs on the server and firewall counters. Common causes include the wrong Manager address, blocked provider ports, mismatched source whitelist, changed NAT egress or an agent newer than Manager.
Active agent status proves a connection, not the detection pipeline. On a test agent create:
sudo mkdir -p /opt/wazuh-fim-test
echo "baseline" | sudo tee /opt/wazuh-fim-test/example.txt
Add the directory inside <syscheck> in /var/ossec/etc/ossec.conf:
<directories realtime="yes" report_changes="yes">/opt/wazuh-fim-test</directories>
Test the FIM configuration with sudo /var/ossec/bin/wazuh-syscheckd -t, restart and wait for the initial scan to establish a baseline. Only then change the test file. The source commands are:
sudo /var/ossec/bin/wazuh-control restart
echo "changed $(date -Is)" | sudo tee -a /opt/wazuh-fim-test/example.txt
Search Dashboard file-integrity events by agent and path. Use report_changes only in the test directory initially. Reporting file-content differences from secret-bearing or frequently changing directories can leak data and generate excessive alerts.
Vulnerability detection depends on software inventory, platform support and Indexer health. Inspect a result in Vulnerability Detection and verify package, version, CVE and host. Use it to prioritize investigation; it does not replace distribution advisories, patch planning or human validation. A detected CVE does not prove exploitability in this environment.
Sending every rule to email or chat creates alert fatigue. Separate:
- High-confidence urgent events requiring immediate notification.
- Medium-priority events routed to tickets or daily summaries.
- Low-priority events retained for search without paging.
First verify the FIM test and a controlled failed SSH login reach the event view; then configure email, Slack, webhooks or custom integrations. Include agent, rule ID, severity, timestamp, source address and a Dashboard query link, without forwarding complete logs that may contain secrets.
Active response can block sources or run scripts, but false positives may lock out administrators. Observe in alert-only mode first, define allowlists, automatic expiry and out-of-band access, and enable a few high-confidence rules gradually. For accidental blocks, see the Fail2Ban unban and allowlist guide.
Named volumes survive docker compose down; that is persistence, not backup. Volume deletion, disk failure or host loss can destroy all local data. Cover:
- Certificates and component configuration under
/opt/wazuh-docker/single-node/config/. - Manager configuration, registration keys, queue databases, custom rules, decoders and integrations.
- Indexer indexes and cluster state using a supported snapshot procedure.
- Production Compose, Caddyfile, Git tag/commit and exact running image references.
- An off-host copy with verified checksums.
The source records deployment information with:
cd /opt/wazuh-docker/single-node
date -Is | sudo tee /var/backups/wazuh-backup-time.txt
git describe --tags --exact-match | sudo tee /var/backups/wazuh-version.txt
docker compose -f docker-compose.production.yml config --images \
| sudo tee /var/backups/wazuh-images.txt
docker compose -f docker-compose.production.yml config --volumes \
| sudo tee /var/backups/wazuh-volumes.txt
Use a root-owned private backup directory with mode 700 rather than loose public records. Capture actual container mount names: docker compose config --volumes prints logical names, which may differ from the existing Docker volume names. Discover mounts from running containers and verify each volume exists before using an archive helper; a mistyped volume can create an empty substitute. Save bind-mounted configuration and certificates as well as volumes, without printing credentials.
For indexes, configure and test Wazuh/OpenSearch's supported snapshot repository, complete a snapshot, verify its status and preserve the repository configuration and data offsite. Copying a live Indexer directory is not a supported substitute. For Manager databases, stop Manager before copying so writes and new registrations cannot race the backup. If Dashboard configuration volumes are included, pause their writers too. Keep a restart trap and verify service health after maintenance. Map the central-component backup scope to the Docker mounts rather than assuming package-installation paths exist on the host.
Back up before password, rule, integration or version changes. Restore regularly to an isolated VPS with matching images, certificates, volume mapping and keys. Prevent duplicate live enrollment or response actions during the drill. Verify all three components, administrator login, agent reconnection, historical searches and a new FIM event. See the VPS recovery strategy for offsite retention and recovery targets.
Pinning 4.14.7 does not mean never upgrading. Read target release notes and the Docker upgrade procedure; changing tags to latest and restarting is insufficient.
- Verify the offsite backup and sample a restore.
- Save differences between
docker-compose.production.ymland the official files, plus any local tracked modifications. - Stop the stack with
docker compose -f docker-compose.production.yml down, preserving volumes. - Run
git fetch --all --tagsand check out an explicit reviewed target tag. - Reapply restricted ports and password references to the target configuration.
- Run
docker compose configwith-f docker-compose.production.ymlto inspect the actual production ports, volumes and images, protecting expanded secrets. - Start and verify Dashboard, Indexer, Manager, agents and test alerts.
Mounted certificates and data persist, but persistence cannot replace a backup. Index/schema changes can make an old image incompatible; plan rollback around the pre-upgrade snapshot and Manager/configuration backups, not just image tags. Upgrade Manager before agents, then release agent holds and update in observed batches.
Check sysctl vm.max_map_count is 262144, then inspect memory and logs:
free -h
df -h
docker compose -f docker-compose.production.yml logs --tail=200 wazuh.indexer
Do not disable safety checks to hide memory pressure. Reduce colocated services, add RAM or reassess retention.
Check that Dashboard is running and responds to local HTTPS:
curl -kI https://127.0.0.1:5601/
sudo journalctl -u caddy -n 100 --no-pager
sudo caddy validate --config /etc/caddy/Caddyfile
If local curl fails, investigate Wazuh or bindings. If local access succeeds, examine Caddy, DNS and firewall rules.
Check the address, 1514/1515 reachability, provider security rules, Docker forwarding, UFW sources, clocks and agent logs. Do not open everything to 0.0.0.0/0 to restore connectivity.
Verify agent Active status, Manager event reception, Indexer health and the selected time range. Allow initialization time after startup or restart.
Identify the actual growing volume, then inspect agent logging, rule noise and index retention. Never delete a live Indexer directory. Snapshot and test recovery before using supported retention or cleanup procedures.
- Reviewed release tags are pinned, without
latest. - The official 4-core/8 GB/50 GB minimum is met with suitable growth headroom.
-
vm.max_map_count=262144is persistent. - Dashboard, Indexer and Manager APIs are private or tightly controlled.
-
1514/1515accepts only intended private/allowlisted sources, verified beyond ordinary UFW rules. - Default
admin / SecretPasswordno longer authenticates. - Administrators have individual accounts and minimum privileges.
- Agent connection, FIM and notification delivery have been tested.
- Off-host backups have passed an isolated restore.
- Upgrade notes, configuration differences and recovery-based rollback are reviewed before changes.
It is not recommended. The official Docker floor is 4 CPU cores, 8 GB RAM and 50 GB disk. A partial 2 GB startup can fail during Indexer initialization or queries.
Not fully. Wazuh focuses on security events, vulnerabilities, baselines and endpoint detection; Zabbix focuses on infrastructure metrics, capacity, availability and network devices. They can run together.
Agents initiate connections to Manager 1514/1515 in this topology. The agent host normally needs no Wazuh inbound Internet port; Manager must accept the intended agent network.
They should remain on the container network, loopback, VPN or a tightly controlled management segment. Unusual port numbers do not protect high-value management APIs.
The default Dashboard certificate is self-signed. The example skips only local upstream verification; browser HTTPS remains verified. Trusting the internal CA with a matching server name is stronger.
Ordinary down preserves named volumes; down -v removes them. Retained volumes still require offsite backup of configuration, Manager data, Indexer state and restore instructions.
An ordinary container agent cannot directly access the host as a native agent does. Install the agent in the VPS operating system for host monitoring.
Wazuh's value comes from collection, detection, notification, response and recovery working together. Pin versions and restrict ports first; then replace credentials, enroll a few compatible agents, verify FIM and notifications, and expand coverage gradually.
Single-node Docker can meet initial small-team needs after workload validation. Growth in agents, logs and retention calls for measured index sizing and possibly multiple nodes. Private management interfaces, tested recovery and manageable alerts remain essential at every scale.