Skip to content

Commit ee87c9c

Browse files
authored
Merge pull request #8793 from wazuh/enhancement/idr286-add-deployment-on-docker-rework
Add Wazuh deployment on Docker rework
2 parents 6b6f91b + f339ec5 commit ee87c9c

12 files changed

+578
-663
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ All notable changes to this project will be documented in this file.
4848
- **Post-release**: Changed the warning note on using the `$` and `&` characters when changing passwords in Docker deployments. ([#8694](https://github.com/wazuh/wazuh-documentation/pull/8694))
4949
- **Post-release**: Changed Windows commands in the backup guide to PowerShell. ([#8761](https://github.com/wazuh/wazuh-documentation/pull/8761))
5050
- **Post-release**: Updated 4.12.0 command output examples. ([#8779](https://github.com/wazuh/wazuh-documentation/pull/8779)) ([#8780](https://github.com/wazuh/wazuh-documentation/pull/8780))
51+
- **Post-release**: Updated the *Deployment on Docker* documentation. ([#8793](https://github.com/wazuh/wazuh-documentation/pull/8793))
5152

5253
### Fixed
5354

source/_static/js/redirects.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ newUrls['4.12'] = [
7575
'/development/packaging/generate-server-package.html',
7676
'/development/packaging/generate-agent-package.html',
7777
'/cloud-service/ai-analyst.html',
78+
'/deployment-options/docker/prerequisites.html',
79+
'/deployment-options/docker/build-docker-images-locally.html',
7880
]
7981

8082
/* Redirections from 4.9 to 4.10 */
@@ -125,6 +127,11 @@ redirections.push(
125127
'4.11': '/user-manual/capabilities/vulnerability-detection/offline-update.html',
126128
'4.12': '/user-manual/capabilities/vulnerability-detection/configuring-scans.html#offline-vulnerability-detection',
127129
},
130+
{
131+
'target': ['4.11=>4.12', '4.12=>4.11'],
132+
'4.11': '/deployment-options/docker/wazuh-container.html#build-docker-images-locally',
133+
'4.12': '/deployment-options/docker/build-docker-images-locally.html',
134+
},
128135
);
129136

130137
/* Pages no longer available in 4.12 */
@@ -138,6 +145,8 @@ removedUrls['4.12'] = [
138145
'/development/packaging/generate-hpux-package.html',
139146
'/development/packaging/generate-wpk-package.html',
140147
'/user-manual/capabilities/vulnerability-detection/offline-update.html',
148+
'/deployment-options/docker/docker-installation.html',
149+
'/deployment-options/docker/faq-wazuh-container.html',
141150
];
142151

143152
/* *** RELEASE 4.11 ****/
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
.. Copyright (C) 2015, Wazuh, Inc.
2+
3+
.. meta::
4+
:description: You can modify and build Docker images for the Wazuh central components. Learn more in this section of the documentation.
5+
6+
Build Docker images locally
7+
===========================
8+
9+
You can modify and build Docker images for the Wazuh central components (manager, indexer, and dashboard).
10+
11+
#. Clone the `Wazuh Docker repository <https://github.com/wazuh/wazuh-docker>`_ to your system:
12+
13+
.. code-block:: console
14+
15+
# git clone https://github.com/wazuh/wazuh-docker.git -b v|WAZUH_CURRENT_DOCKER|
16+
17+
#. Navigate to the ``wazuh-docker/build-docker-images/`` directory and run the build script:
18+
19+
.. code-block:: console
20+
21+
# build-docker-images/build-images.sh
22+
23+
This generates updated Docker images for all Wazuh components on your local system.
Lines changed: 122 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,20 @@
11
.. Copyright (C) 2015, Wazuh, Inc.
22
33
.. meta::
4-
:description: Check the tasks that help you benefit the most from the installation of Wazuh after the installation of the Wazuh-Docker.
5-
4+
:description: Perform several tasks to manage and customize your installation after deploying Wazuh with Docker.
5+
66
Wazuh Docker utilities
77
======================
88

9-
After installing the Wazuh-Docker containers, there are several tasks you can do to benefit the most from your Wazuh installation.
10-
11-
..
12-
.. contents::
13-
:local:
14-
:depth: 1
15-
:backlinks: none
9+
After deploying Wazuh with Docker, you can perform several tasks to manage and customize your installation. Wazuh components are deployed as separate containers built from their corresponding Docker image. You can access these containers using the service names defined in your ``docker-compose.yml`` file, which are specific to your deployment type.
1610

1711
Access to services and containers
1812
---------------------------------
1913

20-
#. Access the Wazuh dashboard using the Docker host IP address. For example, ``https://localhost``, if you are on the Docker host.
21-
22-
.. note::
23-
24-
In case you use a self-signed certificate, your browser will warn that it cannot verify its authenticity.
25-
26-
#. Enroll the agents by following the standard enrollment process and using the Docker host address as the manager address. For more information, see the :doc:`Wazuh agent enrollment </user-manual/agent/agent-enrollment/index>` documentation.
14+
This section explains how to interact with your Wazuh deployment by accessing service logs and shell instances of running containers.
2715

16+
#. Access the Wazuh dashboard using the Docker host IP address.
17+
#. Enroll agents through the standard :doc:`Wazuh agent enrollment </user-manual/agent/agent-enrollment/index>` process. Use the Docker host address as the Wazuh manager address.
2818
#. List the containers in the directory where the Wazuh ``docker-compose.yml`` file is located:
2919

3020
.. code-block:: console
@@ -39,42 +29,112 @@ Access to services and containers
3929
single-node-wazuh.indexer-1 "/entrypoint.sh open…" wazuh.indexer running 0.0.0.0:9200->9200/tcp
4030
single-node-wazuh.manager-1 "/init" wazuh.manager running 0.0.0.0:1514-1515->1514-1515/tcp, 0.0.0.0:514->514/udp, 0.0.0.0:55000->55000/tcp, 1516/tcp
4131
42-
#. Run the command below from the directory where the ``docker-compose.yml`` file is located to access the command line of each container:
32+
#. Run the command below from the directory where the ``docker-compose.yml`` file is located to open a shell inside the container:
4333

4434
.. code-block:: console
4535
4636
# docker-compose exec <SERVICE> bash
4737
38+
Tuning Wazuh services
39+
---------------------
40+
41+
You can tune the Wazuh indexer and Wazuh dashboard by replacing their default configuration with custom parameters. This allows you to adjust performance settings, change the dashboard interface, or override default options.
42+
43+
Tuning the Wazuh indexer
44+
^^^^^^^^^^^^^^^^^^^^^^^^
45+
46+
The Wazuh indexer uses a default internal configuration that is not exposed by default. Follow the steps below to override the default configuration:
47+
48+
#. Create a new configuration file:
49+
50+
.. code-block:: none
51+
52+
# touch config/wazuh_indexer/<new_wazuh_indexer>.yml
53+
54+
Replace ``<new_wazuh_indexer>`` with your new service name.
55+
56+
#. Map your configuration file inside the container in the ``docker-compose.yml`` file. Update the Wazuh indexer container declaration to:
57+
58+
.. code-block:: yaml
59+
:emphasize-lines: 4,5,7
60+
61+
<new_wazuh_indexer>:
62+
image: wazuh/wazuh-indexer:latest
63+
ports:
64+
- "9200:9200"
65+
- "9300:9300"
66+
environment:
67+
ES_JAVA_OPTS: "-Xms6g -Xmx6g"
68+
networks:
69+
- docker_wazuh
70+
71+
Tuning the Wazuh dashboard
72+
^^^^^^^^^^^^^^^^^^^^^^^^^^
73+
74+
The Wazuh dashboard reads its configuration from ``config/wazuh_dashboard/opensearch_dashboards.yml``. Edit this file to customize the Wazuh dashboard with your desired settings. After making changes, restart the Wazuh Docker container for the updates to take effect.
75+
76+
Refer to the OpenSearch documentation on `Modifying the YAML files <https://docs.opensearch.org/latest/security/configuration/yaml/>`__ for details about the available variables you can override in this configuration.
77+
4878
Wazuh service data volumes
4979
--------------------------
5080

51-
You can set Wazuh configuration and log files to exist outside their containers. This allows the files to persist after removing containers, and you can provision custom configuration files to your containers.
81+
You can set Wazuh configuration and log files to exist outside their containers. This allows the files to persist after containers are removed, and you can provision custom configuration files to your containers.
5282

53-
You need multiple volumes to ensure persistence on a Wazuh container. The following is an example of a ``docker-compose.yml`` with persistent volumes:
83+
Adding a persistent volume
84+
^^^^^^^^^^^^^^^^^^^^^^^^^^
5485

55-
.. code-block:: yaml
86+
You need multiple volumes to ensure persistence on a Wazuh container. Here’s an example of defining a persistent volume in your ``docker-compose.yml`` file:
87+
88+
.. code-block:: console
89+
:emphasize-lines: 4,5,7,8
5690
5791
services:
58-
wazuh:
92+
wazuh.manager:
5993
. . .
6094
volumes:
6195
- wazuh_api_configuration:/var/ossec/api/configuration
62-
96+
. . .
6397
volumes:
6498
wazuh_api_configuration:
6599
66-
You can list persistent volumes with ``docker volume ls``:
100+
Listing existing volumes
101+
^^^^^^^^^^^^^^^^^^^^^^^^
102+
103+
Run the following to see the persistent volumes on your Docker host:
104+
105+
.. code-block:: console
106+
107+
# docker volume ls
67108
68109
.. code-block:: none
69110
:class: output
70111
71-
DRIVER VOLUME NAME
72-
local single-node_wazuh_api_configuration
112+
DRIVER VOLUME NAME
113+
local single-node_wazuh_api_configuration
114+
115+
Wazuh indexer volumes
116+
^^^^^^^^^^^^^^^^^^^^^
117+
118+
By default, single‑node and multi‑node deployments include preconfigured volumes for the Wazuh indexer.
119+
120+
For example, in a multi-node deployment, the ``wazuh1.indexer`` service uses the following volume (as defined in ``wazuh-docker/multi-node/docker-compose.yml``):
121+
122+
.. code-block:: yaml
123+
:emphasize-lines: 4
124+
125+
wazuh1.indexer:
126+
...
127+
volumes:
128+
- wazuh-indexer-data-1:/var/lib/wazuh-indexer
129+
130+
This ensures that Wazuh indexer data remains available even if the container is restarted or rebuilt.
73131

74132
Storage volume for Wazuh indexer and dashboard
75133
----------------------------------------------
76134

77-
Attaching a volume for the storage of Wazuh indexer data is also possible. By default, the single-node and multi-node deployments already have volumes configured. An example of a single-node wazuh indexer volume is shown in the ``docker-compose.yml`` below:
135+
You can also attach volumes to store Wazuh indexer data. By default, single‑node and multi‑node Docker deployments include preconfigured volumes.
136+
137+
The example below shows a single-node Wazuh indexer volume in the ``docker-compose.yml`` file:
78138

79139
.. code-block:: yaml
80140
@@ -88,14 +148,47 @@ Attaching a volume for the storage of Wazuh indexer data is also possible. By de
88148
volumes:
89149
wazuh-indexer-data
90150
91-
92151
Custom commands and scripts
93152
---------------------------
94153

95-
To execute commands in the Wazuh manager container, you can execute a shell:
154+
Run the command below to execute commands inside the containers. We use the Wazuh manager ``single-node-wazuh.manager-1`` container in this example:
96155

97156
.. code-block:: console
98157
99158
# docker exec -it single-node-wazuh.manager-1 bash
100159
101-
Every change made on this shell persists as long as you have the data volumes configured correctly.
160+
Every change made on this shell persists if you properly configure data volumes.
161+
162+
Modifying the Wazuh configuration file
163+
--------------------------------------
164+
165+
To customize the Wazuh configuration file ``/var/ossec/etc/ossec.conf``, modify the appropriate configuration file on the Docker host according to your business needs. These local files are mounted into the containers at runtime, allowing your custom settings to persist across container restarts or rebuilds.
166+
167+
#. Run the following command in your deployment directory to stop the running containers:
168+
169+
.. code-block:: console
170+
171+
# docker-compose down
172+
173+
#. The following are the locations of the Wazuh configuration files on the Docker host that you can modify:
174+
175+
.. tabs::
176+
177+
.. group-tab:: Single-node deployment
178+
179+
``wazuh-docker/single-node/config/wazuh_cluster/wazuh_manager.conf``
180+
181+
.. group-tab:: Multi-node deployment
182+
183+
- **Manager**: ``wazuh-docker/multi-node/config/wazuh_cluster/wazuh_manager.conf``
184+
- **Worker**: ``wazuh-docker/multi-node/config/wazuh_cluster/wazuh_worker.conf``
185+
186+
Save the changes in the configuration files.
187+
188+
#. Restart the stack:
189+
190+
.. code-block:: console
191+
192+
# docker-compose up -d
193+
194+
These files are mounted into the container at runtime (``/wazuh-config-mount/etc/ossec.``), ensuring your changes take effect when the containers start.

0 commit comments

Comments
 (0)