How wazuh/wazuh-docker works
1. What this repository is
- This repo does not contain the Wazuh product source code itself; it packages and deploys the Wazuh platform with Docker.
- Its main job is to define container images, Compose-based topologies, and deployment docs for running Wazuh as a stack.
2. Primary runtime stack
- The stack centers on four logical services:
- Wazuh manager: the core analysis and alerting component.
- Wazuh indexer: the search/index backend, based on OpenSearch.
- Wazuh dashboard: the user-facing UI, based on OpenSearch Dashboards.
- Wazuh agent: optional endpoint component for sending telemetry to the manager.
- The README explicitly describes the full platform as manager + dashboard + OpenSearch for indexing/search.
3. Deployment topologies
- The repo provides separate Compose definitions for:
- single-node deployment
- multi-node deployment
- agent-only deployment
- This means the architecture is split between “all-in-one” and “distributed” layouts, with the same product components arranged differently.
4. Container image build subsystem
- build-docker-images/ contains the Dockerfiles and build scripts for the stack images.
- There are dedicated image build contexts for:
- wazuh-manager
- wazuh-indexer
- wazuh-dashboard
- wazuh-agent
- This is the packaging boundary: images are produced here, then consumed by the Compose deployments.
5. Manager container internals
- The manager image has cont-init.d and services.d hooks, which indicates an init/service supervision pattern inside the container.
- It includes separate startup logic for manager initialization and log handling.
- permanent_data.env and permanent_data.sh indicate the manager container persists or restores state/configuration across restarts.
6. Indexer container internals
- The indexer image has custom startup/config scripts such as config.sh, entrypoint.sh, and securityadmin.sh.
- This suggests the indexer is responsible for bootstrapping search storage plus security configuration before becoming operational.
7. Dashboard container internals
- The dashboard image includes its own entrypoint.sh and wazuh_dashboard_config.sh.
- This image is responsible for configuring the UI service to connect to the backend indexer and start the dashboard process.
8. Agent container internals
- The agent image also uses init/service scripts and includes an ossec-logs service.
- This indicates the agent container is not just the endpoint agent binary; it also manages log collection/forwarding behavior inside the image.
9. Multi-node-specific infrastructure
- multi-node/ contains a docker-compose.yml plus an nginx/ configuration directory.
- That Nginx layer is the key extra boundary in the distributed deployment, likely used as a front-facing routing or proxy layer for the multi-node stack.
- volume-migrator.sh suggests multi-node upgrades or migrations need explicit data movement between persistent volumes.
10. Single-node-specific infrastructure
- single-node/docker-compose.yml defines the simpler topology where the stack runs without the multi-node routing/migration complexity.
- This is the compact deployment path for local testing or smaller installations.
11. Data persistence and state
- The repo emphasizes persistent volumes and configurable storage in the README.
- State is especially important for the manager and indexer, where alerts, configuration, and indexed data must survive container recreation.
- The presence of migration scripts and permanent data helpers shows persistence is a first-class architectural concern.
12. Documentation as part of the operational architecture
- The docs/ tree is extensive and includes installation, deployment modes, configuration, upgrade, backup/restore, performance, security, and uninstall docs.
- This repo is documentation-driven: the operational contract for the stack is codified alongside the Docker artifacts.
13. Automation and CI/CD
- .github/workflows/ contains workflows for repository bumping, PR checks, and Docker image publishing.
- There are also log-check scripts and a disk-space cleanup action, indicating CI validates image/build health and container logs before release.
14. Supporting tooling
- tools/repository_bumper.sh and tools/utils/deployment/certificates-conf.sh are support scripts for release management and deployment setup.
- These scripts sit on the repository-maintenance and deployment-prep boundary rather than in the runtime stack itself.
15. How the pieces fit together
- Build scripts produce the four container images.
- Compose files assemble those images into single-node, multi-node, or agent deployments.
- The manager receives and processes security events, the indexer stores/searches them, and the dashboard reads them for user access.
- Nginx in the multi-node setup adds a routing/proxy layer, while volumes and helper scripts preserve state across upgrades and redeployments.
Main entry points: multi-node/docker-compose.yml Multi node · build-images.sh Build images · Dockerfile Manager image · single-node/docker-compose.yml Single node
Components 21
Image builds
Docker image definitions and packaging scripts for the stack.
- Build images · Orchestrates building all Wazuh container images.
build-docker-images/build-images.sh - Manager image · Build context for the Wazuh manager container.
build-docker-images/wazuh-manager/Dockerfile - Indexer image · Build context for the Wazuh indexer container.
build-docker-images/wazuh-indexer/Dockerfile - Dashboard image · Build context for the Wazuh dashboard container.
build-docker-images/wazuh-dashboard/Dockerfile - Agent image · Build context for the Wazuh agent container.
build-docker-images/wazuh-agent/Dockerfile - Manager runtime · Manager container startup, log handling, and persistent state helpers.
build-docker-images/wazuh-manager/config/etc/cont-init.d/1-manager - Indexer runtime · Indexer startup, configuration, and security initialization.
build-docker-images/wazuh-indexer/config/entrypoint.sh - Dashboard runtime · Dashboard startup and backend connection configuration.
build-docker-images/wazuh-dashboard/config/entrypoint.sh - Agent runtime · Agent initialization and log forwarding service supervision.
build-docker-images/wazuh-agent/config/etc/services.d/ossec-logs/run - Persistent state · Manager persistence helpers for preserving config and state across restarts.
build-docker-images/wazuh-manager/config/permanent_data.sh
Deployments
Compose topologies for different runtime layouts.
- Single node · Compact all-in-one deployment for local or smaller installs.
single-node/docker-compose.yml - Multi node · Distributed deployment with extra routing and migration support.
multi-node/docker-compose.yml - Agent only · Deployment focused on running only the agent component.
wazuh-agent/docker-compose.yml - Nginx layer · Front-facing routing/proxy layer used in the multi-node stack.
multi-node/config/nginx/nginx.conf - Volume migrator · Explicit migration helper for multi-node persistent volumes.
multi-node/volume-migrator.sh
Docs
Operational documentation and runbooks for the stack.
- Docs tree · Primary documentation set for installation, deployment, and operations.
docs/README.md - Deploy docs · Getting started and deployment mode guides.
docs/ref/getting-started/deployment/deployment.md
Ops tooling
Repository maintenance, CI, and support scripts.
- CI workflows · GitHub Actions for checks, image publishing, and repository maintenance.
.github/workflows/5_pr_check.yml - Log checks · Workflow helpers that validate container logs for deployment modes.
.github/single-node-log-check.sh - Repo tools · Release and deployment helper scripts outside the runtime stack.
tools/repository_bumper.sh - Cert setup · Certificate configuration helper for deployment preparation.
tools/utils/deployment/certificates-conf.sh
Connections 25
- Build images → Manager image: builds · Build orchestration includes the manager image.
- Build images → Indexer image: builds · Build orchestration includes the indexer image.
- Build images → Dashboard image: builds · Build orchestration includes the dashboard image.
- Build images → Agent image: builds · Build orchestration includes the agent image.
- Manager image → Manager runtime: contains · Manager image packages init and log supervision logic.
- Manager image → Persistent state: persists · Manager image includes helpers for permanent data.
- Indexer image → Indexer runtime: contains · Indexer image packages bootstrap and security setup scripts.
- Dashboard image → Dashboard runtime: contains · Dashboard image packages startup configuration scripts.
- Agent image → Agent runtime: contains · Agent image packages init and log forwarding services.
- Single node → Manager image: uses · Single-node topology runs the manager image.
- Single node → Indexer image: uses · Single-node topology runs the indexer image.
- Single node → Dashboard image: uses · Single-node topology runs the dashboard image.
- Single node → Agent image: uses · Single-node topology can include the agent image.
- Multi node → Manager image: uses · Multi-node topology uses the manager image.
- Multi node → Indexer image: uses · Multi-node topology uses the indexer image.
- Multi node → Dashboard image: uses · Multi-node topology uses the dashboard image.
- Multi node → Nginx layer: adds · Multi-node deployment adds an Nginx routing layer.
- Multi node → Volume migrator: supports · Multi-node deployment includes explicit volume migration support.
- Agent only → Agent image: uses · Agent-only topology runs the agent image.
- Docs tree → Deploy docs: includes · Documentation tree includes deployment guides.
- CI workflows → Log checks: runs · CI workflows invoke log validation helpers.
- CI workflows → Build images: checks · CI validates image build and packaging behavior.
- Repo tools → Cert setup: includes · Support tooling includes deployment certificate setup.
- Docs tree → Persistent state: describes · Docs explain persistence and state handling.
- Multi node → Persistent state: depends on · Distributed deployments rely on persistent state and migration handling.