5
6
## Limitations running the Agent in Docker
7
8
-We don’t officially support running our Docker images with the Docker CLI `--user` option or the Docker Compose
9
-`user:` parameter. Such usage will usually still work, but some features will not be available when run this
10
-way. Note that the Agent will drop privileges appropriately inside the container during startup, meaning that even
11
-when run without these options, almost nothing in the container will actually run with an effective UID of 0.
8
+We don’t officially support using Docker’s `--user` option or Docker Compose’s `user:` parameter with our images. While they may work, some features could be unavailable. The Agent drops privileges at startup, so most processes don’t run as UID 0 even without these options.
9
13
-Our POWER8+ Docker images don’t support our FreeIPMI collector. This is a technical limitation in FreeIPMI itself,
14
-and unfortunately, not something we can realistically work around.
10
+Additionally, our **POWER8+ Docker images** don’t support the **FreeIPMI collector** due to a technical limitation in FreeIPMI itself, which we can’t work around.
11
12
## Create a new Netdata Agent container
13
18
-You can create a new Agent container using either `docker run` or `docker-compose`. After using any method, you can
19
-visit the Agent dashboard `http://NODE:19999`.
14
+You can create a new Agent container with `docker run` or `docker-compose`, then access the dashboard at `http://NODE:19999`.
15
21
-The Netdata container requires different privileges and mounts to provide functionality similar to that provided by
22
-Netdata installed on the host. Below you can find a list of Netdata components that need these privileges and mounts,
23
-along with their descriptions.
16
+The Netdata container requires specific **privileges** and **mounts** to provide full monitoring capabilities equivalent to a direct host installation. Below is a list of required components and their purposes.
17
18
<details open>
19
<summary>Privileges</summary>
50
51
Both methods create a [volume](https://docs.docker.com/storage/volumes/) for Netdata's configuration files
52
_within the container_ at `/etc/netdata`.
60
-See the [configure section](#configure-agent-containers) for details. If you want to access the configuration files from
61
-your _host_ machine, see [host-editable configuration](#with-host-editable-configuration).
53
+See the [configure section](#configure-agent-containers) for details. If you want to access the configuration files from your _host_ machine, see [host-editable configuration](#with-host-editable-configuration).
54
55
<Tabs>
56
<TabItem value="docker_run" label="docker run">
254
255
### With SSL/TLS enabled HTTP Proxy
256
265
-For a permanent installation on a public server, you
266
-should [secure the Netdata instance](/docs/netdata-agent/securing-netdata-agents.md). This
267
-section contains an example of how to install Netdata with an SSL reverse proxy and basic authentication.
257
+Below is an example of installing Netdata with an **SSL reverse proxy** and **basic authentication** using Docker.
258
269
-You can use the following `docker-compose.yml` and Caddyfile files to run Netdata with Docker. Replace the domains and
270
-email address for [Let's Encrypt](https://letsencrypt.org/) before starting.
259
+#### Caddyfile Setup
260
272
-#### Caddyfile
273
-
274
-This file needs to be placed in `/opt` with name `Caddyfile`. Here you customize your domain, and you need to provide
275
-your email address to obtain a Let's Encrypt certificate. Certificate renewal will happen automatically and will be
276
-executed internally by the caddy server.
261
+Place the following `Caddyfile` in `/opt`, customizing the domain and adding your email for **Let’s Encrypt**. The certificate will renew automatically via the Caddy server.
262
263
```caddyfile
264
netdata.example.org {
328
329
### With Docker socket proxy
330
346
-> **Note**: Using Netdata with a Docker socket proxy might have some features not working as expected. It hasn't been fully tested by the Netdata team.
331
+> **Note:** Using Netdata with a Docker socket proxy may cause some features to not work as expected. It hasn't been fully tested by the Netdata team.
332
348
-Deploy a Docker socket proxy that accepts and filters out requests using something like
349
-[HAProxy](/docs/netdata-agent/configuration/running-the-netdata-agent-behind-a-reverse-proxy/Running-behind-haproxy.md) or
350
-[CetusGuard](https://github.com/hectorm/cetusguard) so that it restricts connections to read-only access to
351
-the `/containers` endpoint.
333
+For better security, deploy a **Docker socket proxy** with a tool like [HAProxy](/docs/netdata-agent/configuration/running-the-netdata-agent-behind-a-reverse-proxy/Running-behind-haproxy.md) or [CetusGuard](https://github.com/hectorm/cetusguard). This ensures the socket is **read-only** and restricted to the `/containers` endpoint.
334
353
-The reason it's safer to expose the socket to the proxy is because Netdata has a TCP port exposed outside the Docker
354
-network. Access to the proxy container is limited to only within the network.
335
+Exposing the socket to a proxy is safer because Netdata’s TCP port is accessible outside the Docker network, while the proxy container remains isolated within it.
336
337
#### HAProxy
338
438
439
Netdata can be run successfully in a non-root environment, such as [rootless Docker](https://docs.docker.com/engine/security/rootless/).
440
460
-However, it should be noted that Netdata's data collection capabilities are considerably restricted in rootless Docker
461
-due to its inherent limitations. While Netdata can function in a rootless environment, it can’t access certain
462
-resources that require elevated privileges. The following components don’t work:
441
+Netdata can run in a rootless Docker environment, but its data collection is limited due to restricted access to resources requiring elevated privileges.
442
+The following components won't work:
443
444
- container network interfaces monitoring (cgroup-network helper)
445
- disk I/O and file descriptors of applications and processes (apps.plugin)
451
452
This method creates a [volume](https://docs.docker.com/storage/volumes/) for Netdata's configuration files
453
_within the container_ at `/etc/netdata`.
474
-See the [configure section](#configure-agent-containers) for details. If you want to access the configuration files from
475
-your _host_ machine, see [host-editable configuration](#with-host-editable-configuration).
454
+See the [configure section](#configure-agent-containers) for details. If you want to access the configuration files from your _host_ machine, see [host-editable configuration](#with-host-editable-configuration).
455
456
<Tabs>
457
<TabItem value="docker_run" label="docker run">
502
| `vX.Y` | the major and minor version (for example, `v1.40`). |
503
| `vX` | just the major version (for example, `v1`). |
504
526
-The tags for minor and major versions are updated whenever a release that matches this tag is published (for example,
527
-if `v1.40.1` were to be published, the `v1.40` tag would be updated to it instead of pointing to `v1.40.0`).
505
+Minor and major version tags update with each matching release. For example, if `v1.40.1` is published, the `v1.40` tag moves from `v1.40.0` to `v1.40.1`.
506
529
-## Configure Agent containers
507
+## Configure Agent Containers
508
531
-If you started an Agent container using one of the [recommended methods](#create-a-new-netdata-agent-container), and you
532
-want to edit Netdata's configuration, you must first use `docker exec` to attach to the container. Replace `netdata`
533
-with the name of your container.
509
+If you started an Agent container using one of the [recommended methods](#create-a-new-netdata-agent-container) and need to edit its configuration, first attach to the container with `docker exec`, replacing `netdata` with your container’s name.
510
511
```bash
512
docker exec -it netdata bash
514
./edit-config netdata.conf
515
```
516
541
-You need to restart the Agent to apply changes. Exit the container if you haven't already, then use the `docker` command
542
-to restart the container: `docker restart netdata`.
517
+Restart the Agent to apply changes: exit the container if necessary, then run `docker restart netdata`.
518
519
### Change the default hostname
520
546
-You can change the hostname of a Docker container, and thus the name that appears in the local dashboard and in Netdata
547
-Cloud, when creating a new container. If you want to change the hostname of a Netdata container _after_ you started it,
548
-you can safely stop and remove it. Your configuration and metrics data reside in persistent volumes and are reattached
549
-to the recreated container.
521
+A container’s hostname appears in both the local dashboard and Netdata Cloud.
522
+
523
+To change it after creation, stop and remove the container—it’s safe! Your configuration and metrics stay intact in persistent volumes and will reattach when you recreate the container.
524
525
If you use `docker-run`, use the `--hostname` option with `docker run`.
526
541
hostname: my_docker_compose_netdata
542
```
543
570
-If you don't want to destroy and recreate your container, you can edit the Agent's `netdata.conf` file directly. See the
571
-above section on [configuring Agent containers](#configure-agent-containers) to find the appropriate method based on
572
-how you created the container.
544
+If you prefer not to recreate the container, edit the Agent’s `netdata.conf` file. See [configuring Agent containers](#configure-agent-containers) for the right method based on how you created it.
545
574
-Alternatively, you can directly use the hostname from the node running the container by mounting `/etc/hostname` from
575
-the host in the container. With `docker run`, this can be done by adding `--volume /etc/hostname:/host/etc/hostname:ro` to
576
-the options. If you’re using Docker Compose, you can add an entry to the container's `volumes` section
577
-reading `- /etc/hostname:/host/etc/hostname:ro`.
546
+Alternatively, use the **host’s hostname** by mounting `/etc/hostname` in the container:
547
579
-## Adding extra packages at runtime
548
+- **With `docker run`**, add:
549
+ ```sh
550
+ --volume /etc/hostname:/host/etc/hostname:ro
551
+ ```
552
+- **With Docker Compose**, add this to the `volumes` section:
553
+ ```yaml
554
+ - /etc/hostname:/host/etc/hostname:ro
555
+ ```
556
581
-By default, the official Netdata container images don’t include a number of optional runtime dependencies. You
582
-can add these dependencies, or any other APT packages, at runtime by listing them in the environment variable
583
-`NETDATA_EXTRA_DEB_PACKAGES`.
557
+## Adding extra packages at runtime
558
585
-Commonly useful packages include:
559
+By default, Netdata’s official container images exclude some optional runtime dependencies. You can install them at runtime by setting the `NETDATA_EXTRA_DEB_PACKAGES` environment variable.
560
587
-- `apcupsd`: For monitoring APC UPS devices.
588
-- `lm-sensors`: For monitoring hardware sensors.
589
-- `netcat-openbsd`: For IRC alert support.
561
+Commonly useful packages:
562
+- `apcupsd` – Monitors APC UPS devices.
563
+- `lm-sensors` – Monitors hardware sensors.
564
+- `netcat-openbsd` – Enables IRC alerts.
565
566
## Health Checks
567
593
-Our Docker image provides integrated support for health checks through the standard Docker interfaces.
594
-
595
-You can control how the health checks run by using the environment variable `NETDATA_HEALTHCHECK_TARGET` as follows:
568
+Netdata’s Docker image supports **health checks** via standard Docker interfaces. You can control them using the `NETDATA_HEALTHCHECK_TARGET` environment variable:
569
597
-- If left unset, the health check will attempt to access the `/api/v1/info` endpoint of the Agent.
598
-- If set to the exact value 'cli', the health check script will use `netdatacli ping` to determine if the Agent is
599
- running correctly or not. This is sufficient to ensure that Netdata didn’t hang during startup, but doesn’t provide
600
- a rigorous verification that the daemon is collecting data or is otherwise usable.
601
-- If set to anything else, the health check will treat the value as a URL to check for a 200 status code on. In most
602
- cases, this should start with `http://localhost:19999/` to check the Agent running in the container.
570
+- **Unset** – Defaults to checking `/api/v1/info`.
571
+- **`cli`** – Uses `netdatacli ping` to confirm the Agent is running (but not full data collection).
572
604
-In most cases, the default behavior of checking the `/api/v1/info` endpoint will be enough. If you’re using a
605
-configuration which disables the web server or restricts access to certain APIs, you will need to use a non-default
606
-configuration for health checks to work.
573
+The default `/api/v1/info` check is usually sufficient. However, if the web server is disabled or API access is restricted, you'll need to customize the health check configuration.
574
575
## Publish a test image to your own repository
576
577
At Netdata, we provide multiple ways of testing your Docker images using your own repositories.
611
-You may either use the command line tools available or take advantage of our GitHub Actions infrastructure.
578
+
579
+You may either use the command line tools available or take advantage of our GitHub Actions infrastructure.
\ No newline at end of file