cAdvisor and dockprom with Docker: Container Charts and Alerts (Linux, Windows, Mac)
Before you start
- 18 min read
Boxes marked Run in terminal are what you type; plain text explains why. Check what you need first

What you get in one minute#
cAdvisor collects resource measurements for Docker containers; dockprom combines it with Prometheus, Grafana, Node Exporter and Alertmanager so we can see CPU, RAM, network and supported disk metrics over time and receive alerts.

Logo: cAdvisor project (official logo), Apache-2.0.
At a glance:
- Container charts: find an app consuming CPU, growing in memory or transferring data.
- Host charts: Node Exporter adds Linux host capacity, including free filesystem space.
- Alerts: Prometheus evaluates rules; Alertmanager sends notifications to ntfy.
- Limits: disk I/O is not the total size of a container's volumes. Docker Desktop measurements describe its Linux VM.
| What | Value |
|---|---|
| Current cAdvisor | v0.61.1, released 18 November 2026; release |
| Image | ghcr.io/google/cadvisor:v0.61.1; GHCR package |
| dockprom snapshot | e7788b4fa60b0ed7b666205fbebdf41ead3cdce9, committed 6 March 2026 |
| Time needed | About 45–60 minutes; our estimate |
| Measured RAM/CPU/image size | Not measured for this guide |
| Ports | Grafana 3000 on localhost; HTTPS 443 after setup. Exporters and monitoring APIs remain unpublished |
| Licences | cAdvisor, Prometheus, Node Exporter and Alertmanager: Apache-2.0; dockprom: MIT; Grafana OSS: AGPL-3.0 |
| Official starting points | cAdvisor, dockprom |
Dockprom's latest commit is not a promise of the newest component releases. These are the exact pins in its Compose file:
| Service | Upstream pin | This walkthrough |
|---|---|---|
| Prometheus | prom/prometheus:v3.10.0 | Same |
| Grafana | grafana/grafana:12.4.0 | Same |
| cAdvisor | gcr.io/cadvisor/cadvisor:v0.55.1 | ghcr.io/google/cadvisor:v0.61.1 |
| Node Exporter | prom/node-exporter:v1.10.2 | Same |
| Alertmanager | prom/alertmanager:v0.31.1 | Same |
| Pushgateway | prom/pushgateway:v1.11.2 | Omitted; unnecessary for container collection |
| Caddy | caddy:2.11.2 | Optional HTTPS route below |
The cAdvisor README directs current releases to GHCR and versions before v0.53.0 to GCR. Its example version lags the release page; we checked the actual GHCR tag. We retain the other dockprom pins for reproducibility, not as a claim that they are current security releases.

Screenshot: dockprom project (official screenshot), MIT. This is an upstream illustration, not our test result.
How it fits together#
Prometheus scrapes cAdvisor and Node Exporter, saves their measurements, answers Grafana queries and sends firing alerts to Alertmanager.
Our diagram, drawn from the upstream configuration. Arrows show the flow of measurements and notifications.
Before you start#
Note: every configuration username, password, token, domain, email and address shown here is a made-up dummy to replace.
example.comis reserved for examples;127.0.0.1andlocalhostmean the local machine, not a private server. Compose service names are local examples. Official source and registry URLs identify the real projects.
| System | Requirements and limits |
|---|---|
| Linux | Rootful Docker Engine, Compose plugin and Git; conventional Linux host paths. amd64 or arm64 is our target |
| Windows (PowerShell) | A Windows version supported by Docker Desktop, Linux containers through WSL 2, Compose and Git |
| Mac (Terminal) | A macOS version supported by Docker Desktop, Intel or Apple Silicon, Compose and Git |
Allow roughly two spare CPU cores, 2 GB RAM and 10 GB SSD space as a starting planning estimate, not an upstream minimum or measured requirement. No GPU is needed.
Run these checks in your system's terminal:
docker --version
docker compose version
git --version
docker info --format 'Root={{.DockerRootDir}} Driver={{.Driver}} Cgroups={{.CgroupVersion}}'
- [ ] Back up any existing configuration before replacing files.
- [ ] Local port 3000 is free.
- [ ] An authenticated ntfy topic supports the built-in
alertmanagertemplate. - [ ] For public HTTPS only: a domain, correct DNS and reachable ports 80/443.
- [ ] Check the Docker data root; adapt the cAdvisor mount if it differs from
/var/lib/docker.
Tested on 2026-12-02: Linux = not run; Windows = not run; Mac = not run. We checked documentation and source, not a live monitoring deployment. Sources were independently rechecked on 3 December 2026; all expected checks below still need your own run.
Docker Desktop boundary. Linux containers run inside a Linux VM. cAdvisor can collect their available metrics when the VM's mounts and runtime are accessible; it cannot measure native Windows processes, macOS applications or physical host disks as if they were Linux containers. Node Exporter also sees the Linux environment. Device access, storage drivers and Desktop isolation settings can prevent collection. We do not claim the Linux recipe works unchanged on every Desktop version. See Docker's Desktop FAQ and containerd storage documentation.
Tip: Begin with one known container. A working Grafana login or
up == 1only proves connectivity; it does not prove cAdvisor discovered your containers.
Step 1: Prepare folders and credentials#
We keep everything in ~/docker_volumes/cadvisor-dockprom. The checkout supplies dockprom's dashboards; we write our own Compose and monitoring configuration outside it.
Linux#
mkdir -p ~/docker_volumes/cadvisor-dockprom/{data,config,logs,backups}
cd ~/docker_volumes/cadvisor-dockprom
mkdir -p data/{prometheus,grafana,alertmanager} config/{prometheus,alertmanager}
git clone https://github.com/stefanprodan/dockprom.git config/upstream
git -C config/upstream checkout e7788b4fa60b0ed7b666205fbebdf41ead3cdce9
cat > .env <<'EOF'
ADMIN_USER=change-me-admin
ADMIN_PASSWORD=change-me-to-a-long-random-password
GRAFANA_DOMAIN=grafana.example.com
EOF
printf '%s' '<your-token>' > config/alertmanager/ntfy_token
chmod 600 .env config/alertmanager/ntfy_token
Windows (PowerShell)#
$base = "$HOME\docker_volumes\cadvisor-dockprom"
foreach ($dir in "data","config","logs","backups","data\prometheus","data\grafana","data\alertmanager","config\prometheus","config\alertmanager") {
New-Item -ItemType Directory -Force "$base\$dir" | Out-Null
}
Set-Location $base
git clone https://github.com/stefanprodan/dockprom.git config/upstream
git -C config/upstream checkout e7788b4fa60b0ed7b666205fbebdf41ead3cdce9
@'
ADMIN_USER=change-me-admin
ADMIN_PASSWORD=change-me-to-a-long-random-password
GRAFANA_DOMAIN=grafana.example.com
'@ | Set-Content -Encoding ascii .env
Set-Content -NoNewline -Encoding ascii config\alertmanager\ntfy_token '<your-token>'
Mac (Terminal)#
Same commands as Linux.
Replace the dummy credentials before starting. Choose a unique Grafana password, not the upstream default pair. Quote literal passwords appropriately in .env; Compose treats dollar signs as interpolation syntax. Restrict Windows file access through the folder's Security properties.
Check it worked. git -C config/upstream rev-parse HEAD should print the SHA above. This is the expected result, not captured test output.
Step 2: Write the stack and monitoring files#
Save the following as compose.yaml in the main folder. The x-common anchor shares the restart policy, private Docker network and labels. Unlike upstream's proxy configuration, this publishes only Grafana to loopback.
name: cadvisor-dockprom
x-common: &common
restart: unless-stopped
networks: [monitor]
labels:
traefik.enable: "false"
org.label-schema.group: monitoring
services:
prometheus:
<<: *common
image: prom/prometheus:v3.10.0
volumes:
- ./config/prometheus:/etc/prometheus:ro
- ./data/prometheus:/prometheus
command:
- --config.file=/etc/prometheus/prometheus.yml
- --storage.tsdb.path=/prometheus
- --storage.tsdb.retention.time=7d
grafana:
<<: *common
image: grafana/grafana:12.4.0
ports:
- "127.0.0.1:3000:3000"
environment:
GF_SECURITY_ADMIN_USER: ${ADMIN_USER:?Set ADMIN_USER in .env}
GF_SECURITY_ADMIN_PASSWORD: ${ADMIN_PASSWORD:?Set ADMIN_PASSWORD in .env}
GF_USERS_ALLOW_SIGN_UP: "false"
volumes:
- ./data/grafana:/var/lib/grafana
- ./config/upstream/grafana/provisioning:/etc/grafana/provisioning:ro
cadvisor:
<<: *common
image: ghcr.io/google/cadvisor:v0.61.1
privileged: true
devices:
- /dev/kmsg:/dev/kmsg
volumes:
- /:/rootfs:ro
- /var/run:/var/run:ro
- /sys:/sys:ro
- /var/lib/docker:/var/lib/docker:ro
- /dev/disk:/dev/disk:ro
command:
- --docker_only=true
- --housekeeping_interval=15s
nodeexporter:
<<: *common
image: prom/node-exporter:v1.10.2
volumes:
- /proc:/host/proc:ro
- /sys:/host/sys:ro
- /:/rootfs:ro
command:
- --path.procfs=/host/proc
- --path.sysfs=/host/sys
- --path.rootfs=/rootfs
- --collector.filesystem.mount-points-exclude=^/(sys|proc|dev|host|etc)($$|/)
alertmanager:
<<: *common
image: prom/alertmanager:v0.31.1
volumes:
- ./config/alertmanager:/etc/alertmanager:ro
- ./data/alertmanager:/alertmanager
command:
- --config.file=/etc/alertmanager/config.yml
- --storage.path=/alertmanager
networks:
monitor:
driver: bridge
cAdvisor's mounts and privileged access follow its official Linux example. The bridge has outbound access for notifications; “private” here means no published monitoring ports. Node Exporter follows dockprom's mount arrangement; host network-interface coverage can differ from its own host-network deployment recipe.
Save config/prometheus/prometheus.yml:
global:
scrape_interval: 15s
evaluation_interval: 15s
rule_files:
- /etc/prometheus/alert.rules
scrape_configs:
- job_name: cadvisor
static_configs:
- targets: ["cadvisor:8080"]
- job_name: nodeexporter
static_configs:
- targets: ["nodeexporter:9100"]
- job_name: prometheus
static_configs:
- targets: ["localhost:9090"]
alerting:
alertmanagers:
- static_configs:
- targets: ["alertmanager:9093"]
Save config/prometheus/alert.rules. These are our starting thresholds: adjust them for your workloads.
groups:
- name: homelab
rules:
- alert: ExporterDown
expr: up{job=~"cadvisor|nodeexporter"} == 0
for: 2m
annotations:
summary: "Exporter unavailable: {{ $labels.instance }}"
- alert: ContainerHighCPU
expr: sum by (instance, name) (rate(container_cpu_usage_seconds_total{job="cadvisor",image!="",name!=""}[5m])) > 0.8
for: 10m
annotations:
summary: "Sustained CPU use: {{ $labels.name }}"
- alert: ContainerHighMemory
expr: container_memory_working_set_bytes{job="cadvisor",image!="",name!=""} > 1073741824
for: 10m
annotations:
summary: "Working set above 1 GiB: {{ $labels.name }}"
- alert: HostFilesystemLowSpace
expr: (node_filesystem_avail_bytes{job="nodeexporter",fstype!~"tmpfs|overlay|squashfs"} / node_filesystem_size_bytes{job="nodeexporter",fstype!~"tmpfs|overlay|squashfs"} < 0.15) and on(instance, device, mountpoint) (node_filesystem_readonly{job="nodeexporter"} == 0)
for: 10m
annotations:
summary: "Less than 15 percent free: {{ $labels.mountpoint }}"
Save config/alertmanager/config.yml, replacing the dummy domain and topic. The token file contains a token allowed to publish to that topic.
route:
receiver: ntfy
group_by: [alertname, instance, name]
group_wait: 30s
group_interval: 5m
repeat_interval: 4h
receivers:
- name: ntfy
webhook_configs:
- url: "https://ntfy.example.com/change-me-topic?template=alertmanager"
send_resolved: true
http_config:
authorization:
type: Bearer
credentials_file: /etc/alertmanager/ntfy_token
The current ntfy publishing docs explicitly support this template. Verify your own ntfy installation supports it; older deployments may need an upgrade or a relay. Alertmanager does not expand .env variables inside its YAML, which is why we use its documented credentials_file setting.
Linux#
Use a text editor to save the four files, then:
docker compose config -q docker compose config --images
Windows (PowerShell)#
Save the same files with a text editor, preferably UTF-8 without BOM and LF line endings. Run:
docker compose config -q docker compose config --images
Mac (Terminal)#
Same commands as Linux.
Check it worked. Expected: the first command exits successfully without output; the second lists five pinned images. It does not validate Prometheus or Alertmanager schemas.
Tip: Keep
localhostout of exporter targets. Inside Prometheus it means Prometheus itself; Compose service names reach the other containers.
Step 3: Set permissions, validate and start#
The image users need writable data directories. The account names in these ownership commands are the images' built-in service accounts, not login credentials. These one-time commands use the pinned images' own service accounts to set ownership; they do not run the monitoring daemons.
Linux#
docker compose run --rm --no-deps --user 0 --entrypoint sh prometheus -c 'chown -R nobody:nobody /prometheus' docker compose run --rm --no-deps --user 0 --entrypoint sh grafana -c 'chown -R grafana:root /var/lib/grafana' docker compose run --rm --no-deps --user 0 --entrypoint sh alertmanager -c 'chown -R nobody:nobody /alertmanager' docker compose run --rm --no-deps --user 0 --entrypoint sh -v ./config/alertmanager:/secret-setup alertmanager -c 'chown nobody:nobody /secret-setup/ntfy_token; chmod 600 /secret-setup/ntfy_token' docker compose run --rm --no-deps --entrypoint promtool prometheus check config /etc/prometheus/prometheus.yml docker compose run --rm --no-deps --entrypoint amtool alertmanager check-config /etc/alertmanager/config.yml docker compose up -d docker compose ps docker compose logs --tail=100 cadvisor prometheus alertmanager grafana
Windows (PowerShell)#
Run the same Docker commands above in PowerShell from $HOME\docker_volumes\cadvisor-dockprom. Docker executes sh inside Linux containers. Desktop bind mounts may handle ownership differently; stop and inspect any permission failure before continuing.
Mac (Terminal)#
Same commands as Linux, with the same Docker Desktop ownership caveat.
Check it worked. Expected from upstream tool source: promtool and amtool report SUCCESS. Services should remain running. We have no captured startup output.
Open http://localhost:3000 and sign in with your .env credentials. Select the provisioned Prometheus data source in Grafana Explore and run up. The three configured scrape targets should each return 1. Then run the container queries below. ExporterDown detects an unreachable exporter; it does not detect an individual application stopping.
On Desktop, a missing /dev/kmsg can prevent creation. Removing that device mapping is a diagnostic workaround that sacrifices that OOM-detection source; it does not prove disk or container discovery works. Missing /dev/disk, inaccessible VM paths or root-only metrics require investigation, not blank charts labelled “zero”.
Put it behind HTTPS with Traefik#
Local-only readers can keep localhost access. For a server with a domain, choose one HTTPS route; keep all exporter and Prometheus ports unpublished. Review security updates for the older dockprom pins before enabling remote access.
With Traefik#
Use an existing Traefik installation configured with entrypoint https and certificate resolver le. Inspect proxy with docker network inspect proxy; if absent, run docker network create proxy.
In compose.yaml, remove Grafana's ports block, replace its inherited labels and networks with these, and add the environment entry alongside the existing ones:
networks: [monitor, proxy]
environment:
GF_SECURITY_ADMIN_USER: ${ADMIN_USER:?Set ADMIN_USER}
GF_SECURITY_ADMIN_PASSWORD: ${ADMIN_PASSWORD:?Set ADMIN_PASSWORD}
GF_USERS_ALLOW_SIGN_UP: "false"
GF_SERVER_ROOT_URL: https://${GRAFANA_DOMAIN}/
labels:
org.label-schema.group: monitoring
traefik.enable: "true"
traefik.docker.network: proxy
traefik.http.routers.grafana.rule: Host(`${GRAFANA_DOMAIN}`)
traefik.http.routers.grafana.entrypoints: https
traefik.http.routers.grafana.tls: "true"
traefik.http.routers.grafana.tls.certresolver: le
traefik.http.services.grafana.loadbalancer.server.port: "3000"
Add proxy: {external: true} under the existing top-level networks mapping. Do not create a second mapping. Run docker compose up -d on Linux, PowerShell or Mac. The Traefik Docker reference explains these labels.
Without Traefik: Caddy#
For all three systems, add this service to our Compose file:
caddy:
image: caddy:2.11.2
restart: unless-stopped
networks: [monitor]
ports:
- "80:80"
- "443:443"
volumes:
- ./config/Caddyfile:/etc/caddy/Caddyfile:ro
- ./data/caddy:/data
- ./data/caddy-config:/config
labels:
traefik.enable: "false"
Create config/Caddyfile:
grafana.example.com {
tls {
issuer acme {
dir https://acme-v02.api.letsencrypt.org/directory
}
}
reverse_proxy grafana:3000
}
Replace the dummy domain. Remove Grafana's published port and add GF_SERVER_ROOT_URL: https://${GRAFANA_DOMAIN}/ to its environment. Run docker compose up -d. Caddy obtains and renews the Let's Encrypt certificate. If Caddy instead runs natively on the same host, retain Grafana's loopback binding and use reverse_proxy localhost:3000.
For home-only HTTPS, resolve your chosen example hostname locally and replace the whole tls block with tls internal. Caddy's local HTTPS instructions require trusting its root on each client:
docker compose cp caddy:/data/caddy/pki/authorities/local/root.crt config/caddy-root.crt
On Debian/Ubuntu, copy it into /usr/local/share/ca-certificates/ and run sudo update-ca-certificates. On Windows, import it into the current user's Trusted Root Certification Authorities store. On Mac, import it into Keychain Access and trust it for SSL. Trust only the public root certificate from your own Caddy, never its private key.
Check either route with curl -I https://grafana.example.com, or curl.exe -I https://grafana.example.com in PowerShell. Expect a valid certificate and an HTTP response, possibly a login redirect.
Security and testing#
cAdvisor is a privileged host observer. Read-only bind mounts do not make the Docker API read-only. Keep access to Docker and Grafana administration restricted; never forward ports 8080 or 9090 through your router. Node Exporter 9100 and Alertmanager 9093 also remain internal. This matches the Prometheus security model.
Protect .env with chmod 600 .env on Linux/Mac and restricted Windows ACLs. Environment values remain visible to Docker administrators. Grafana's initial admin settings do not reset an existing database password; change it through Grafana after first setup.
Test the complete alert path. Temporarily add this fifth rule to the existing rules list in alert.rules:
- alert: GuideNotificationTest
expr: vector(1)
for: 1m
annotations:
summary: "Dummy test alert from the monitoring guide"
Run docker compose exec prometheus promtool check rules /etc/prometheus/alert.rules, then docker compose restart prometheus. Subscribe to the protected ntfy topic. After the rule delay and grouping wait, expect a firing notification. Change the expression to vector(0) > 0, validate and restart again; wait for the resolved notification, then remove the test rule. No message means this test has not passed.
Tip: A working notification test is essential. If this entire Docker host loses power, its own Alertmanager cannot report the outage; use an independent monitor for that.
What the numbers mean#
Dockprom provisions Docker Host, Docker Containers and Monitor Services dashboards. The container dashboard excludes the monitoring group; the service dashboard covers it. Some panels use historical metric or filesystem filters. The queries below include monitoring containers and help distinguish a dashboard mismatch from absent collection.
In Grafana Explore, select Prometheus and use these three queries. Each produces a series per container, identified by instance and name:
1. CPU percentage, where 100% means one logical CPU:
100 * sum by (instance, name) (
rate(container_cpu_usage_seconds_total{job="cadvisor",image!="",name!=""}[5m])
)
A multithreaded container can exceed 100%. Our CPU alert means sustained use above 0.8 cores, not 80% of an assigned CPU limit.
2. Memory working set in bytes:
max by (instance, name) (
container_memory_working_set_bytes{job="cadvisor",image!="",name!=""}
)
Choose a bytes unit in Grafana. Working set is not application heap; Docker's own display can use different cache accounting.
3. Network receive plus transmit, bytes per second:
sum by (instance, name) (
rate(container_network_receive_bytes_total{job="cadvisor",image!="",name!="",interface!="lo"}[5m])
)
+
sum by (instance, name) (
rate(container_network_transmit_bytes_total{job="cadvisor",image!="",name!="",interface!="lo"}[5m])
)
Use the two halves separately for receive/transmit panels. Shared network namespaces and host networking prevent clean per-container attribution; these totals are not your internet bill.
Add a disk panel: supported read/write throughput is:
sum by (instance, name) (
rate(container_fs_reads_bytes_total{job="cadvisor",image!="",name!=""}[5m])
)
+
sum by (instance, name) (
rate(container_fs_writes_bytes_total{job="cadvisor",image!="",name!=""}[5m])
)
container_fs_usage_bytes measures supported filesystem usage, not every mounted volume's contents. Use Node Exporter for host free space and separate storage accounting for shared volumes. Missing disk series mean “unavailable”, not zero usage. The cAdvisor metric catalogue defines these counters and gauges.
Create a dashboard panel from each query, select time-series visualization, set CPU to percent and memory to bytes, and save your own dashboard copy. Compare names with docker ps. If an expected container is missing, inspect unfiltered metrics before trusting the overview.
Common mistakes#
These are exact error fragments from issues we opened. Historical reports describe particular environments, not guaranteed failures in v0.61.1.
| Mistake | Why it happens | Do this instead |
|---|---|---|
| An AI assistant reuses an old cAdvisor image from a cached tutorial | An obsolete Docker client produced client version 1.41 is too old in issue 3749 | Verify GHCR and the release tag. The issue documents the failure, not AI authorship; copying that recipe is the AI pitfall |
| Ignoring Docker socket permissions | dial unix /var/run/docker.sock: connect: permission denied appears in issue 3184 | Check mounts and the process identity; do not make the socket world-writable |
| Dropping required device access without checking consequences | open /dev/kmsg: no such file or directory in issue 2155 | Use the documented Linux device mapping; on Desktop verify what remains available |
| Applying an old cgroup recipe to a different host | Failed to create a manager: mountpoint for cpu not found in issue 3658 | Inspect docker info, current image and /sys mount before changing the host's cgroup mode |
| Starting upstream's proxy alongside existing services | bind: address already in use in dockprom issue 308 | Use this guide's restricted port mapping; inspect conflicts instead of exposing another monitoring port |
| Treating missing disk data as zero | failed to collect filesystem stats in issue 3943 | Check logs, storage driver and stale-container reports before interpreting a chart |
Troubleshooting#
| Problem | Solution |
|---|---|
| No container names | docker compose logs --tail=100 cadvisor; inspect Docker API errors and mounts |
| Grafana has no data | Check up in Explore; confirm its data source URL is http://prometheus:9090 |
| Data directory denied | Rerun the scoped ownership command for that service; avoid blanket writable permissions |
| No ntfy alert | docker compose logs --tail=100 alertmanager; verify topic permissions, token and template support |
| Only root-cgroup metrics | Check docker info and docker compose config --images; a successful scrape is insufficient |
client version 1.41 is too old#
Issue 3749 involved Docker 29 with cAdvisor v0.49.1. Check the running image with docker inspect $(docker compose ps -q cadvisor) --format '{{.Config.Image}}' in Linux, PowerShell or Mac, then recreate using the verified pin.
Failed to create a manager: mountpoint for cpu not found#
Issue 3658 used an older image on Amazon Linux. On Linux inspect findmnt /sys/fs/cgroup and docker info. Do not infer that cgroup v2 is unsupported or downgrade the kernel from this error alone.
Known bugs#
Issue 3943 remains open: filesystem collectors reportedly continue after container removal, reproduced with v0.60.6. Restarting cAdvisor may temporarily clear stale collectors; we have not verified a v0.61.1 fix.
Issue 3976 reports a containerd snapshotter path problem with a custom Docker data root. A matching read-only mount of that actual host path is the reported workaround; verify the path before adding it. We cannot guarantee disk collection across storage drivers.
Updates and backups#
Read release notes, back up, then change explicit pins. Diun can notify about releases. After editing, run these separately in any terminal:
docker compose pull docker compose up -d
Keep the previous Compose file and data backup together. A Grafana database migration can make an image-only rollback insufficient.
For Linux/Mac, save this as backup.sh in the stack folder and make it executable. Stopping services gives a consistent offline copy but interrupts monitoring. A temporary container reads the service-owned files as root; a plain user-level tar could miss the protected token or databases.
#!/usr/bin/env bash set -eu cd "$HOME/docker_volumes/cadvisor-dockprom" stamp=$(date +%Y%m%d-%H%M%S) trap 'docker compose start' EXIT docker compose stop docker run --rm --user 0 --entrypoint sh \ --env ARCHIVE_UID="$(id -u)" --env ARCHIVE_GID="$(id -g)" \ --mount "type=bind,src=$PWD,dst=/source,readonly" \ --mount "type=bind,src=$PWD/backups,dst=/backup" \ prom/prometheus:v3.10.0 \ -c 'umask 077; tar -czf "/backup/$1" -C /source compose.yaml .env config data && chown "$ARCHIVE_UID:$ARCHIVE_GID" "/backup/$1"' \ sh "monitoring-$stamp.tgz"
Schedule at 03:00 with crontab -e; use your actual home path and a PATH containing Docker:
0 3 * * * /bin/bash "$HOME/docker_volumes/cadvisor-dockprom/backup.sh"
On Windows, save backup.ps1 and schedule it daily at 03:00 in Task Scheduler under the account running Docker Desktop:
Set-Location "$HOME\docker_volumes\cadvisor-dockprom"
$stamp = Get-Date -Format "yyyyMMdd-HHmmss"
try {
docker compose stop
if ($LASTEXITCODE -ne 0) { throw "Stop failed; backup cancelled" }
docker run --rm --user 0 --entrypoint sh --mount "type=bind,src=$PWD,dst=/source,readonly" --mount "type=bind,src=$PWD/backups,dst=/backup" prom/prometheus:v3.10.0 -c 'umask 077; tar -czf "/backup/$1" -C /source compose.yaml .env config data' sh "monitoring-$stamp.tgz"
if ($LASTEXITCODE -ne 0) { throw "Archive failed" }
} finally {
docker compose start
}
The computer must be awake and Docker running. Protect archives: they contain passwords and the ntfy token. Copy them to separate storage.
Restore test: on an isolated test machine, extract an archive into an empty stack folder using tar -xzf '<backup-file.tgz>' (PowerShell supports the same command). Reapply Step 3's ownership setup after extraction. Disable notification delivery during the test, review proxy settings, validate configuration and start the stack. Confirm Grafana login, saved dashboards and historical Prometheus data. Do not overwrite the live stack for this test. We have not performed a restore.
Performance and resources#
We measured no RAM or CPU figures. Check your deployment with docker stats --no-stream or lazydocker.
Our 15-second housekeeping/scrape intervals and seven-day retention are starting choices. Increasing intervals reduces detail and collection frequency. The runtime options document --docker_only, --housekeeping_interval and metric exclusions.
Do not disable disk, diskIO or network if their charts matter. Turning off --store_container_labels without an allowlist breaks dashboard filters using Docker labels; preserve org.label-schema.group through --whitelisted_container_labels when tuning. Measure each change.
FAQ#
Does this monitor every container automatically?
cAdvisor discovers local Docker containers; our queries include ones with Docker names and image metadata. Unsupported runtime paths or failed discovery can leave gaps. Check against docker ps.
Does it measure all my volume sizes?
No. Disk throughput, writable-layer usage, host free space and application data size are different measurements.
Can we run just cAdvisor?
Yes, if we already have Prometheus. Its built-in history defaults to two minutes. Keep its UI and metrics private.
Can one instance monitor several Docker hosts?
Run exporters on each Linux host and add private scrape targets. A remote Docker socket alone does not give cAdvisor the other host's kernel and filesystems.
Is there a simpler option?
Our Beszel guide covers a smaller monitoring setup. Dockprom suits readers who want to write PromQL and control dashboards and alerts.
Sources#
Official sources for this December 2026 guide; snapshot dated 2 December, independently rechecked 3 December 2026:
- cAdvisor release v0.61.1, image package, Linux installation, licence — December 2026.
- dockprom pinned Compose, dashboards and configuration, MIT licence — December 2026.
- Prometheus alert rules, Alertmanager configuration at v0.31.1, ntfy templates — December 2026.
- Grafana Docker configuration, Grafana licence, Docker runtime metrics, Node Exporter container deployment — December 2026.
- Traefik Docker routing, Caddy deployment, Caddy automatic HTTPS — December 2026.
- GitHub reports linked in Common mistakes and Troubleshooting were read directly, including comments where cited — December 2026.
Checked against the official docs on 2026-12-02.