Skip to main content

Container Monitoring

Docker Container Monitoring Guide

Docker container monitoring focuses on CPU utilization, memory consumption, and health check status to maintain uptime in self-hosted environments. Self-hosted tools like Uptime Kuma enable frequent checks, with 20-second intervals advertised, via Docker socket access. This guide provides steps for homelab setups to detect restarts and failures early.

Rai AnsarFounder of Visual Sentinel11 min read

Docker Container Monitoring Guide

What Metrics Does Docker Container Monitoring Track for Uptime?

Docker container monitoring tracks CPU utilization, memory use, health status, restarts, network traffic and lifecycle events. Tools can access the Docker daemon through unix:///var/run/docker.sock. These observations support investigation of container failures.

For example, alert when CPU utilization stays above 90% for 10 minutes.

A user-set memory threshold, such as 80% for 5 minutes, can prompt investigation before a container reaches its configured limit. Monitoring tools help record resource use and failures.

A configured health check can test http://localhost:8080/health every 30 seconds. A failed test returns a non-zero status; Docker applies the configured retry policy before marking it unhealthy. Uptime Monitoring provides a separate HTTP check of the exposed website.

A user-set threshold, such as more than 5 restarts in an hour, can flag instability. Investigate application crashes and configuration problems. Uptime Kuma provides self-hosted Docker monitoring through daemon access.

Network throughput measures traffic volume. Review lifecycle events and exit codes alongside logs; exit code 137 alone does not prove an out-of-memory kill.

How Do Docker Health Checks Prevent Container Downtime?

Docker HEALTHCHECK runs periodic tests and marks a container unhealthy when its configured failure threshold is reached. For example, HEALTHCHECK --interval=30s --timeout=3s CMD curl -f http://localhost:8080/health || exit 1 tests an application endpoint. An unhealthy status alone does not trigger a standalone Docker restart policy.

Choose the health-check interval for the workload. A 30-second or 20-second interval is a configuration choice.

A 3-second timeout limits how long the example check waits. Choose a timeout appropriate to the endpoint's expected behavior.

A failed check updates health status according to the configured retries. Orchestrators may use that status in their own recovery behavior. Combine checks with Performance Monitoring for separate website response observations.

Embed a suitable HEALTHCHECK in the Dockerfile for an API on port 8080. Verify the configured interval and retries against the application's behavior.

Docker restart policies apply when a container exits; they do not restart a running container solely because it is unhealthy. Configure and test alerts and recovery separately.

What Self-Hosted Tools Support Docker Container Monitoring?

Uptime Kuma provides free self-hosted Docker container monitoring through unix:///var/run/docker.sock. Its supported checks and intervals depend on the monitor configuration. Use a metrics tool separately when the required resource observations are not covered.

Uptime Kuma deploys via Docker with image louislam/uptime-kuma:2. Access occurs through unix:///var/run/docker.sock for local monitoring. The local Unix socket avoids exposing a TCP listener.

Choose intervals and CPU or memory alert thresholds for the host's workload. Measure monitoring overhead instead of assuming a fixed resource cost.

Configure available container-status notifications and test delivery to the intended channels. Compare approaches with Visual Sentinel vs UptimeRobot.

Uptime Kuma is free, open source and self-hosted. It supports HTTP, TCP and Docker container checks. Domain Monitor offers external HTTP checks for containerized sites.

How to Set Up Uptime Kuma for Docker Monitoring in Homelabs?

Deploy Uptime Kuma and add a Docker container monitor using an appropriately protected daemon connection. Check the configured monitor's status and test a failure before relying on notifications. Deployment time depends on the host and setup.

Deployment Steps

For local Docker monitoring, run docker run -d --restart=always -p 127.0.0.1:3001:3001 -v uptime-kuma:/app/data -v /var/run/docker.sock:/var/run/docker.sock --name uptime-kuma louislam/uptime-kuma:2. Open http://127.0.0.1:3001 on the host, or use an SSH tunnel for remote access. Only grant socket access to a trusted instance: it gives control of the host Docker daemon.

Install Docker using its official instructions and verify the installation. Use persistent volumes for Uptime Kuma's data.

Monitor Configuration

Select 'Docker container' type in the UI and enter container name like myapp. Configure via unix:///var/run/docker.sock for direct access. Set the check interval per monitor; 20 seconds is the advertised level for health status and restarts.

Configure the status alerts supported by the chosen monitor. Use a resource-monitoring tool for CPU, memory or restart-rate thresholds where needed. Website Checker provides a separate app-level website check.

For remote monitoring, configure the Docker daemon and Uptime Kuma to use authenticated TLS on port 2376, with the required certificates and network restrictions.

What TCP Ports Enable Secure Docker Daemon Access for Monitoring?

Docker daemon access uses TCP port 2375 for insecure connections or 2376 for secure TLS with certificates like ca.pem and server.pem, configured in /etc/docker/daemon.json to allow remote monitoring tools in self-hosted homelabs. Port 2375 exposes the daemon without encryption on local networks. Secure option on 2376 requires 3 PEM files for TLS.

For remote monitoring, configure authenticated TLS access and restrict the listener to the intended network. An IP binding or private subnet alone does not authenticate clients to the Docker daemon.

For remote access, use TLS on 2376 with the required certificate and key files. Verify client authentication and network access controls before enabling the connection.

The local Unix socket /var/run/docker.sock avoids a TCP listener. Restrict socket access because control of the Docker daemon grants powerful host access. Do not make the socket world-writable or expose an unauthenticated daemon publicly.

Use DNS Monitoring separately for service DNS records. Record checks run on a schedule; they do not secure Docker daemon access or prevent exploits.

How to Configure Alerts for Docker Container Restart Thresholds?

Choose alert thresholds for the workload, such as more than 5 restarts in an hour or memory above 80% for 5 minutes.

A user-set restart threshold, such as 5 events per hour, can prompt investigation of an Nginx container. Review Docker events and application logs to find the cause.

Review unhealthy status and failed health-check results. A failed endpoint test does not by itself establish an application crash or unhandled exception.

CPU above 90% for 10 minutes or memory above 80% for 5 minutes are possible user-set thresholds. Alerts do not prevent out-of-memory kills. Use SSL Monitoring separately for a website's certificate on port 443.

Simulate failures in a development environment and verify that the intended recipients receive notifications. Test the actual monitor configuration before relying on it.

What Are Common Failure Indicators in Docker Containers?

High resource use, failed health checks, repeated restarts and network changes can warrant investigation. Select thresholds for the workload rather than treating a particular percentage as proof of a failure.

Resource Exhaustion

Memory exhaustion can cause processes to be killed.

CPU contention and configured limits can affect application performance. Investigate sustained high utilization in the context of the workload.

Health Check Failures

Failed health checks can reflect endpoint or dependency problems. Review the actual response and logs to identify the cause.

Repeated restarts warrant review of entrypoint scripts and application failures. Health-check retries and container restart policies are separate settings.

Review lifecycle events, slow image pulls and exit codes alongside logs. Exit code 137 does not alone confirm OOM. See More articles for troubleshooting guidance.

How Does Visual Sentinel Enhance Docker Container Uptime Monitoring?

Visual Sentinel complements Docker monitoring with checks for uptime, performance, SSL, DNS, visual regression, and content changes for containerized web apps (content from Starter). Visual Sentinel's Starter plan is $30/month for 15 monitors, with uptime checks every 5 minutes. Checks run from Europe and the US.

The uptime check confirms the site responds. The fastest interval is every minute, on Business and Agency.

Performance monitoring provides website response observations.

SSL Monitoring checks website certificate validity and expiry, with default reminders at 13, 3 and 1 days before expiry. DNS monitoring checks records on a schedule; neither check prevents failures or scans key strength.

Visual monitoring compares screenshots. content monitoring checks expected page text. These checks observe the website served by a container rather than inspecting every page element or container event.

Which Tools Compare for Docker Container Monitoring Features?

Uptime Kuma polls Docker container running and health status through the Docker daemon. Domain Monitor checks the exposed website over HTTP.

ToolMonitoring approachCheck intervalPrice
Uptime KumaPolls Docker running and health status through socket or TCP access20 seconds advertised; configurableFree, self-hosted
PingdomExternal website uptime checksAs often as 1 minute$16.50/month billed annually or $18 monthly for 10 uptime checks
UptimeRobot FreeExternal website checks5 minutesFree for 50 monitors

Uptime Kuma polls Docker running and health status through socket or TCP access. Domain Monitor checks the exposed website over HTTP. Choose the approach that matches what you need to observe.

Pingdom (SolarWinds, from $16.50/month billed annually or $18 monthly for 10 uptime checks) provides global uptime from 100+ locations but omits Docker socket integration. UptimeRobot (free for 50 monitors) handles HTTP pings every 5 minutes without container specifics.

Choose tools that support the required daemon or service checks. Compare with Visual Sentinel vs Pingdom for layered checks.

Engineers select based on cost, intervals, and alerts. Domain Monitor adds SSL expiry notifications 30 days early.

Actionable Conclusion for Docker Container Monitoring

Set up a container monitor and test its alerts. Choose resource thresholds for the actual workload, and use Performance Monitoring for separate website response observations.

To hear when your own site goes down, see how uptime alerts work in Visual Sentinel.

docker-monitoringcontainer-uptimeself-hosted-toolshomelab-setuphealth-checks

Check your site while you read

Run a free check for regional reachability, response time, redirect handling, TLS evidence, and DNS resolution. No account is required.

Check a site free

Common questions

What is the minimum check interval for Docker monitoring in Uptime Kuma?

Uptime Kuma advertises 20-second check intervals for Docker containers via socket or TCP access, and current versions accept shorter intervals (the interface warns below 20 seconds). This allows frequent monitoring of health status and restarts in self-hosted homelabs. Adjust intervals based on resource constraints for optimal uptime.

How do you expose Docker daemon for remote monitoring?

For remote Docker monitoring, use a protected daemon connection with TLS and client authentication rather than exposing unauthenticated port 2375. Verify network restrictions and the monitoring tool's connection settings.

What thresholds trigger Docker container alerts?

Possible user-set thresholds include CPU over 90% for 10 minutes, memory above 80% for 5 minutes, or more than 5 restarts per hour. Configure them in a tool that supports the required metrics and test the alerts.

Related

  • Database Performance Monitoring Guide

    database monitoring

    Database Performance Monitoring Guide

    Master database performance monitoring across MySQL, PostgreSQL, and MongoDB with our comprehensive 2026 guide. Discover essential metrics, AI-driven tools, and proven optimization strategies that keep your databases running at peak performance.

    Rai Ansar13 min read

  • Site24x7 Alternatives: Top Monitoring Tools

    comparisons

    Site24x7 Alternatives: Top Monitoring Tools

    Site24x7 offers robust monitoring, but numerous alternatives provide specialized features or different pricing models. This guide reviews top options for uptime, performance, SSL, DNS, and visual monitoring, helping businesses find the ideal solution.

    Rai Ansar11 min read

Stop guessing whether your site still works.

Your first check is free when you add your site. Then try a paid plan for 7 days (card required) or subscribe, from $15 USD a month.

Start 7-day trialSee pricing