docker.recipes

Netdata

beginner

Real-time performance monitoring with beautiful dashboards.

Overview

Netdata is a high-performance, real-time monitoring system that collects thousands of metrics per second with unprecedented granularity. Originally created by Costa Tsaousis in 2016, Netdata revolutionized system monitoring by providing zero-configuration deployment and beautiful web-based dashboards that update every second. Unlike traditional monitoring solutions that sample data every few minutes, Netdata captures and visualizes metrics with 1-second precision, making it invaluable for troubleshooting performance issues and understanding system behavior in real-time. This Docker deployment leverages Netdata's ability to monitor both the host system and containerized applications through strategic volume mounts that expose system directories like /proc, /sys, and Docker socket information. The configuration includes necessary security capabilities (SYS_PTRACE) and AppArmor exceptions that allow Netdata to access low-level system metrics while maintaining container isolation for data storage and configuration management. System administrators and developers benefit from this setup because Netdata automatically discovers and monitors running services, databases, web servers, and other applications without requiring complex configuration files or agent installations. The real-time nature of Netdata makes it particularly valuable for DevOps teams who need immediate visibility into system performance during deployments, load testing, or incident response situations.

Key Features

  • Real-time metrics collection with 1-second granularity for over 5,000 system and application metrics
  • Zero-configuration auto-discovery of Docker containers, databases, web servers, and system services
  • Interactive web dashboard with drill-down capabilities and historical data visualization
  • Built-in alerting system with customizable health checks and notification integrations
  • Low overhead monitoring agent consuming less than 1% CPU and minimal memory footprint
  • Distributed monitoring architecture with optional Netdata Cloud integration for multi-node visibility
  • Machine learning-powered anomaly detection for automatic baseline establishment and deviation alerts
  • Comprehensive Docker container monitoring including per-container CPU, memory, network, and disk metrics

Common Use Cases

  • 1Development teams monitoring application performance during local development and testing phases
  • 2Production server monitoring for real-time visibility into system health and resource utilization
  • 3Docker container fleet monitoring to track resource consumption and performance across multiple services
  • 4Database performance monitoring with automatic detection of MySQL, PostgreSQL, MongoDB, and Redis instances
  • 5Web server monitoring for Apache, Nginx, and other HTTP services with response time and throughput metrics
  • 6Network infrastructure monitoring including bandwidth utilization, packet loss, and connection tracking
  • 7Homelab enthusiasts seeking comprehensive monitoring for personal servers and self-hosted applications

Prerequisites

  • Docker Engine 20.10+ and Docker Compose V2 for proper container capabilities and security options support
  • Minimum 512MB RAM available for Netdata container, with 1GB+ recommended for systems with many services
  • Port 19999 available on the host system for accessing the Netdata web dashboard
  • Host system with /proc, /sys, and /etc directories accessible for comprehensive system metrics collection
  • SYS_PTRACE capability support in Docker environment for process monitoring and debugging features
  • Basic understanding of system metrics and monitoring concepts for effective dashboard interpretation

For development & testing. Review security settings, change default credentials, and test thoroughly before production use. See Terms

docker-compose.yml

docker-compose.yml
1services:
2 netdata:
3 image: netdata/netdata:stable
4 container_name: netdata
5 restart: unless-stopped
6 cap_add:
7 - SYS_PTRACE
8 security_opt:
9 - apparmor:unconfined
10 volumes:
11 - netdata_config:/etc/netdata
12 - netdata_lib:/var/lib/netdata
13 - netdata_cache:/var/cache/netdata
14 - /etc/passwd:/host/etc/passwd:ro
15 - /etc/group:/host/etc/group:ro
16 - /proc:/host/proc:ro
17 - /sys:/host/sys:ro
18 ports:
19 - "19999:19999"
20
21volumes:
22 netdata_config:
23 netdata_lib:
24 netdata_cache:

.env Template

.env
1# No environment variables required

Usage Notes

  1. 1Docs: https://learn.netdata.cloud/docs/
  2. 2Dashboard at http://localhost:19999 - zero config needed
  3. 31-second granularity metrics for CPU, memory, disk, network
  4. 4Auto-detects and monitors Docker containers, databases, web servers
  5. 5Configure alerts in /etc/netdata/health.d/
  6. 6Optional: connect to Netdata Cloud for multi-node dashboards

Quick Start

terminal
1# 1. Create the compose file
2cat > docker-compose.yml << 'EOF'
3services:
4 netdata:
5 image: netdata/netdata:stable
6 container_name: netdata
7 restart: unless-stopped
8 cap_add:
9 - SYS_PTRACE
10 security_opt:
11 - apparmor:unconfined
12 volumes:
13 - netdata_config:/etc/netdata
14 - netdata_lib:/var/lib/netdata
15 - netdata_cache:/var/cache/netdata
16 - /etc/passwd:/host/etc/passwd:ro
17 - /etc/group:/host/etc/group:ro
18 - /proc:/host/proc:ro
19 - /sys:/host/sys:ro
20 ports:
21 - "19999:19999"
22
23volumes:
24 netdata_config:
25 netdata_lib:
26 netdata_cache:
27EOF
28
29# 2. Create the .env file
30cat > .env << 'EOF'
31# No environment variables required
32EOF
33
34# 3. Start the services
35docker compose up -d
36
37# 4. View logs
38docker compose logs -f

One-Liner

Run this command to download and set up the recipe in one step:

terminal
1curl -fsSL https://docker.recipes/api/recipes/netdata/run | bash

Troubleshooting

  • Dashboard shows 'Cannot connect' or loads indefinitely: Verify port 19999 is not blocked by firewall and container started successfully with docker logs netdata
  • Missing container metrics or 'Docker containers not detected': Ensure Docker socket is properly mounted by adding '-v /var/run/docker.sock:/var/run/docker.sock:ro' to volumes section
  • High CPU usage from Netdata container: Disable unnecessary plugins in /etc/netdata/netdata.conf by setting enabled=no for unused collectors like python.d or charts.d
  • Permission denied errors in container logs: Verify AppArmor profile allows unconfined access or add '--security-opt apparmor=unconfined' if not present in compose file
  • Metrics show zeros or 'no data' for system stats: Check that host directories /proc and /sys are mounted read-only and accessible within container namespace

Community Notes

Loading...
Loading notes...

Download Recipe Kit

Get all files in a ready-to-deploy package

Includes docker-compose.yml, .env template, README, and license

Ad Space