# wazuh/wazuh-docker architecture

> Architecture diagram of the GitHub repository wazuh/wazuh-docker, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-04-10). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/wazuh/wazuh-docker
- Repository: https://github.com/wazuh/wazuh-docker

## Overview

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`](https://github.com/wazuh/wazuh-docker/blob/main/multi-node/docker-compose.yml) (Multi node), [`build-docker-images/build-images.sh`](https://github.com/wazuh/wazuh-docker/blob/main/build-docker-images/build-images.sh) (Build images), [`build-docker-images/wazuh-manager/Dockerfile`](https://github.com/wazuh/wazuh-docker/tree/main/build-docker-images/wazuh-manager/Dockerfile) (Manager image), [`single-node/docker-compose.yml`](https://github.com/wazuh/wazuh-docker/blob/main/single-node/docker-compose.yml) (Single node)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_build["Image builds"]
  node_build_images["Build images<br/>build scripts<br/>[build-images.sh]"]
  node_manager_image["Manager image<br/>container image"]
  node_indexer_image["Indexer image<br/>container image"]
  node_dashboard_image["Dashboard image<br/>container image"]
  node_agent_image["Agent image<br/>container image"]
  node_manager_runtime["Manager runtime<br/>service init<br/>[1-manager]"]
  node_indexer_runtime["Indexer runtime<br/>bootstrap scripts<br/>[entrypoint.sh]"]
  node_dashboard_runtime["Dashboard runtime<br/>bootstrap scripts<br/>[entrypoint.sh]"]
  node_agent_runtime["Agent runtime<br/>service init<br/>[run]"]
  node_persistent_state["Persistent state<br/>state helpers<br/>[permanent_data.sh]"]
end

subgraph group_deploy["Deployments"]
  node_single_node["Single node<br/>compose topology<br/>[docker-compose.yml]"]
  node_multi_node["Multi node<br/>compose topology<br/>[docker-compose.yml]"]
  node_agent_only["Agent only<br/>compose topology<br/>[docker-compose.yml]"]
  node_nginx_layer["Nginx layer<br/>proxy config<br/>[nginx.conf]"]
  node_migrate_script["Volume migrator<br/>migration script<br/>[volume-migrator.sh]"]
end

subgraph group_docs["Docs"]
  node_docs_home["Docs tree<br/>documentation<br/>[README.md]"]
  node_deploy_docs["Deploy docs<br/>docs section<br/>[deployment.md]"]
end

subgraph group_ops["Ops tooling"]
  node_ops_ci["CI workflows<br/>automation<br/>[5_pr_check.yml]"]
  node_log_checks["Log checks<br/>ci script"]
  node_repo_tools["Repo tools<br/>support scripts"]
  node_cert_setup["Cert setup<br/>deployment helper"]
end

node_build_images -->|"builds"| node_manager_image
node_build_images -->|"builds"| node_indexer_image
node_build_images -->|"builds"| node_dashboard_image
node_build_images -->|"builds"| node_agent_image
node_manager_image -->|"contains"| node_manager_runtime
node_manager_image -->|"persists"| node_persistent_state
node_indexer_image -->|"contains"| node_indexer_runtime
node_dashboard_image -->|"contains"| node_dashboard_runtime
node_agent_image -->|"contains"| node_agent_runtime
node_single_node -->|"uses"| node_manager_image
node_single_node -->|"uses"| node_indexer_image
node_single_node -->|"uses"| node_dashboard_image
node_single_node -->|"uses"| node_agent_image
node_multi_node -->|"uses"| node_manager_image
node_multi_node -->|"uses"| node_indexer_image
node_multi_node -->|"uses"| node_dashboard_image
node_multi_node -->|"adds"| node_nginx_layer
node_multi_node -->|"supports"| node_migrate_script
node_agent_only -->|"uses"| node_agent_image
node_docs_home -->|"includes"| node_deploy_docs
node_ops_ci -->|"runs"| node_log_checks
node_ops_ci -->|"checks"| node_build_images
node_repo_tools -->|"includes"| node_cert_setup
node_docs_home -.->|"describes"| node_persistent_state
node_multi_node -.->|"depends on"| node_persistent_state

click node_build_images "https://github.com/wazuh/wazuh-docker/blob/main/build-docker-images/build-images.sh"
click node_manager_image "https://github.com/wazuh/wazuh-docker/tree/main/build-docker-images/wazuh-manager/Dockerfile"
click node_indexer_image "https://github.com/wazuh/wazuh-docker/tree/main/build-docker-images/wazuh-indexer/Dockerfile"
click node_dashboard_image "https://github.com/wazuh/wazuh-docker/tree/main/build-docker-images/wazuh-dashboard/Dockerfile"
click node_agent_image "https://github.com/wazuh/wazuh-docker/tree/main/build-docker-images/wazuh-agent/Dockerfile"
click node_single_node "https://github.com/wazuh/wazuh-docker/blob/main/single-node/docker-compose.yml"
click node_multi_node "https://github.com/wazuh/wazuh-docker/blob/main/multi-node/docker-compose.yml"
click node_agent_only "https://github.com/wazuh/wazuh-docker/blob/main/wazuh-agent/docker-compose.yml"
click node_nginx_layer "https://github.com/wazuh/wazuh-docker/blob/main/multi-node/config/nginx/nginx.conf"
click node_manager_runtime "https://github.com/wazuh/wazuh-docker/blob/main/build-docker-images/wazuh-manager/config/etc/cont-init.d/1-manager"
click node_indexer_runtime "https://github.com/wazuh/wazuh-docker/blob/main/build-docker-images/wazuh-indexer/config/entrypoint.sh"
click node_dashboard_runtime "https://github.com/wazuh/wazuh-docker/blob/main/build-docker-images/wazuh-dashboard/config/entrypoint.sh"
click node_agent_runtime "https://github.com/wazuh/wazuh-docker/blob/main/build-docker-images/wazuh-agent/config/etc/services.d/ossec-logs/run"
click node_docs_home "https://github.com/wazuh/wazuh-docker/blob/main/docs/README.md"
click node_deploy_docs "https://github.com/wazuh/wazuh-docker/blob/main/docs/ref/getting-started/deployment/deployment.md"
click node_ops_ci "https://github.com/wazuh/wazuh-docker/blob/main/.github/workflows/5_pr_check.yml"
click node_log_checks "https://github.com/wazuh/wazuh-docker/blob/main/.github/single-node-log-check.sh"
click node_repo_tools "https://github.com/wazuh/wazuh-docker/blob/main/tools/repository_bumper.sh"
click node_cert_setup "https://github.com/wazuh/wazuh-docker/blob/main/tools/utils/deployment/certificates-conf.sh"
click node_migrate_script "https://github.com/wazuh/wazuh-docker/blob/main/multi-node/volume-migrator.sh"
click node_persistent_state "https://github.com/wazuh/wazuh-docker/blob/main/build-docker-images/wazuh-manager/config/permanent_data.sh"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_build_images,node_manager_image,node_indexer_image,node_dashboard_image,node_agent_image,node_manager_runtime,node_indexer_runtime,node_dashboard_runtime,node_agent_runtime,node_persistent_state toneBlue
class node_single_node,node_multi_node,node_agent_only,node_nginx_layer,node_migrate_script toneAmber
class node_docs_home,node_deploy_docs toneMint
class node_ops_ci,node_log_checks,node_repo_tools,node_cert_setup toneRose
```

## Components

### Image builds

Docker image definitions and packaging scripts for the stack.

- [Build images](https://github.com/wazuh/wazuh-docker/blob/main/build-docker-images/build-images.sh): build scripts · Orchestrates building all Wazuh container images. · `build-docker-images/build-images.sh`
- [Manager image](https://github.com/wazuh/wazuh-docker/tree/main/build-docker-images/wazuh-manager/Dockerfile): container image · Build context for the Wazuh manager container. · `build-docker-images/wazuh-manager/Dockerfile`
- [Indexer image](https://github.com/wazuh/wazuh-docker/tree/main/build-docker-images/wazuh-indexer/Dockerfile): container image · Build context for the Wazuh indexer container. · `build-docker-images/wazuh-indexer/Dockerfile`
- [Dashboard image](https://github.com/wazuh/wazuh-docker/tree/main/build-docker-images/wazuh-dashboard/Dockerfile): container image · Build context for the Wazuh dashboard container. · `build-docker-images/wazuh-dashboard/Dockerfile`
- [Agent image](https://github.com/wazuh/wazuh-docker/tree/main/build-docker-images/wazuh-agent/Dockerfile): container image · Build context for the Wazuh agent container. · `build-docker-images/wazuh-agent/Dockerfile`
- [Manager runtime](https://github.com/wazuh/wazuh-docker/blob/main/build-docker-images/wazuh-manager/config/etc/cont-init.d/1-manager): service init · Manager container startup, log handling, and persistent state helpers. · `build-docker-images/wazuh-manager/config/etc/cont-init.d/1-manager`
- [Indexer runtime](https://github.com/wazuh/wazuh-docker/blob/main/build-docker-images/wazuh-indexer/config/entrypoint.sh): bootstrap scripts · Indexer startup, configuration, and security initialization. · `build-docker-images/wazuh-indexer/config/entrypoint.sh`
- [Dashboard runtime](https://github.com/wazuh/wazuh-docker/blob/main/build-docker-images/wazuh-dashboard/config/entrypoint.sh): bootstrap scripts · Dashboard startup and backend connection configuration. · `build-docker-images/wazuh-dashboard/config/entrypoint.sh`
- [Agent runtime](https://github.com/wazuh/wazuh-docker/blob/main/build-docker-images/wazuh-agent/config/etc/services.d/ossec-logs/run): service init · Agent initialization and log forwarding service supervision. · `build-docker-images/wazuh-agent/config/etc/services.d/ossec-logs/run`
- [Persistent state](https://github.com/wazuh/wazuh-docker/blob/main/build-docker-images/wazuh-manager/config/permanent_data.sh): state helpers · 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](https://github.com/wazuh/wazuh-docker/blob/main/single-node/docker-compose.yml): compose topology · Compact all-in-one deployment for local or smaller installs. · `single-node/docker-compose.yml`
- [Multi node](https://github.com/wazuh/wazuh-docker/blob/main/multi-node/docker-compose.yml): compose topology · Distributed deployment with extra routing and migration support. · `multi-node/docker-compose.yml`
- [Agent only](https://github.com/wazuh/wazuh-docker/blob/main/wazuh-agent/docker-compose.yml): compose topology · Deployment focused on running only the agent component. · `wazuh-agent/docker-compose.yml`
- [Nginx layer](https://github.com/wazuh/wazuh-docker/blob/main/multi-node/config/nginx/nginx.conf): proxy config · Front-facing routing/proxy layer used in the multi-node stack. · `multi-node/config/nginx/nginx.conf`
- [Volume migrator](https://github.com/wazuh/wazuh-docker/blob/main/multi-node/volume-migrator.sh): migration script · Explicit migration helper for multi-node persistent volumes. · `multi-node/volume-migrator.sh`

### Docs

Operational documentation and runbooks for the stack.

- [Docs tree](https://github.com/wazuh/wazuh-docker/blob/main/docs/README.md): documentation · Primary documentation set for installation, deployment, and operations. · `docs/README.md`
- [Deploy docs](https://github.com/wazuh/wazuh-docker/blob/main/docs/ref/getting-started/deployment/deployment.md): docs section · Getting started and deployment mode guides. · `docs/ref/getting-started/deployment/deployment.md`

### Ops tooling

Repository maintenance, CI, and support scripts.

- [CI workflows](https://github.com/wazuh/wazuh-docker/blob/main/.github/workflows/5_pr_check.yml): automation · GitHub Actions for checks, image publishing, and repository maintenance. · `.github/workflows/5_pr_check.yml`
- [Log checks](https://github.com/wazuh/wazuh-docker/blob/main/.github/single-node-log-check.sh): ci script · Workflow helpers that validate container logs for deployment modes. · `.github/single-node-log-check.sh`
- [Repo tools](https://github.com/wazuh/wazuh-docker/blob/main/tools/repository_bumper.sh): support scripts · Release and deployment helper scripts outside the runtime stack. · `tools/repository_bumper.sh`
- [Cert setup](https://github.com/wazuh/wazuh-docker/blob/main/tools/utils/deployment/certificates-conf.sh): deployment helper · Certificate configuration helper for deployment preparation. · `tools/utils/deployment/certificates-conf.sh`

## Connections

- 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.
