Docker

How do you monitor Docker containers on a VPS?

What goes wrong with Docker on a single VPS: restart loops, unbounded JSON logs, dangling images filling the disk. Tools compared, fixes included.

By , Founder of Opservo (LinkedIn) · Updated

In short

To monitor Docker containers on a VPS, watch four things the Docker daemon will not warn you about: containers in a restart loop, per-container JSON logs growing without a cap, images and build cache filling the disk, and a database container with its port published to the internet. Opservo reads these from the Docker socket, clusters container logs, and includes the fix for each.

What fails on Docker hosts that nobody notices?

  • •A container with restart: always crashing every 30 seconds; docker ps says "Up 12 seconds" forever
  • •JSON log files under /var/lib/docker/containers growing to tens of gigabytes because no max-size was set
  • •Dangling images, stopped containers and build cache eating the root volume after months of deploys
  • •A MySQL, Postgres, Redis or Mongo container started with -p 3306:3306 and no firewall, reachable from the internet
  • •A container quietly OOM-killed and restarted, losing in-memory state each time
  • •Memory and CPU limits absent, so one container can starve the host

What does Opservo collect from Docker?

From the Docker socket, read-only: every container with its image, state, restart count, published ports and resource usage, and container logs, which are clustered into patterns and summarized rather than stored raw. Databases running as containers are inspected with docker exec status commands, so MySQL, Redis and PostgreSQL in containers get the same insights as on the host. Volume-level disk growth is forecast by the Watchdog.

Which tools monitor Docker on a VPS, and what does each cover?

On a single VPS the question is less "which tool is most powerful" and more "which tool leaves memory for the containers". From lightest to heaviest:

ToolWhat it isWhat it coversPricing model
docker stats, docker logs, docker eventsBuilt into DockerLive CPU, memory and I/O per container, logs, lifecycle events; no history, no alertsFree
OpservoHosted agent on the host, no exporter or sidecarEvery container with restart count, published ports and resources; logs clustered into patterns; MySQL, Redis and Postgres containers inspected; disk forecast; the fix per findingFree for 2 servers; then ₹999 (about $12) per server per month
NetdataOpen-source agent with a Docker pluginReal-time per-container charts on the node; cloud for history and alertsAgent is free; cloud plans are paid
cAdvisor + Prometheus + GrafanaSelf-hosted metrics stackPer-container metrics with history, dashboards and alert rules you write; the stack itself uses memory on a small VPSFree software; your time and RAM
Uptime Kuma or UptimeRobotExternal checksWhether the site answers; nothing about the containers behind itFree tier or self-hosted; paid by monitors
DatadogHosted platform, agent as a containerContainer metrics, logs, APM, dashboardsPer host plus add-ons for logs, APM and containers

Compared on 20 October 2026. Pricing describes each vendor’s published model; see their pricing pages for current numbers. Only Opservo’s prices are quoted.

What should alert?

  • •A container that has restarted more than three times, which means it crashes shortly after starting
  • •A database container port published on 0.0.0.0 with no firewall rule, as a security critical
  • •Disk growth projected to fill the volume, with the prune and log-cap fix
  • •A recurring error pattern in a container’s logs that was not there yesterday

What are the fixes?

# why is it restarting
docker logs --tail 100 <name>
docker inspect <name> --format "{{.State.ExitCode}} {{.State.OOMKilled}}"
# reclaim space
docker system prune -af
# cap logs for every new container: /etc/docker/daemon.json
{ "log-opts": { "max-size": "50m", "max-file": "3" } }
# publish a database only on localhost
-p 127.0.0.1:3306:3306

Each of these is attached to the matching Opservo finding and can be run from the dashboard on servers with remote actions enabled. A crashed container restart is a good first autonomous policy.

Last updated 2026-10-20.

FAQ

Related questions

What should Docker container monitoring cover?+

Five things. Container state and restart count, because a container stuck in a restart loop is the most common silent failure. CPU and memory use per container. Disk used by images, volumes and container logs, which is what usually fills a VPS. The container’s own logs, so a crash comes with its last error. And the host underneath, since every container shares its disk, memory and kernel. Opservo’s agent reads containers straight from the Docker socket on every heartbeat, with no exporter or sidecar, and reports the host alongside them.

Do I need cAdvisor or a Prometheus exporter?+

No. The agent reads the Docker socket directly and reports containers, resources and disk usage on every heartbeat. Metrics can still be exported to Prometheus or Grafana from Opservo if you want your own dashboards.

Does it monitor Docker Compose stacks?+

Yes. Compose services are ordinary containers to the Docker socket; each appears with its state, restarts and clustered logs like any other container.

What about Kubernetes?+

Kubernetes clusters use a separate read-only in-cluster agent that reports workloads, pods, crash loops with exit codes and log tails, resources and events. It is installed with one kubectl apply.

Are container logs stored?+

Not raw. The agent ships normalized entries; the API keeps only clustered patterns with counts and an AI summary, so log volume does not affect price or privacy.

What are the ways to monitor Docker containers, and which should I pick?+

There are three common routes. The built-in docker ps and docker stats commands give a live view with no setup, but keep no history and send no alerts. A self-hosted stack, such as a metrics exporter with Prometheus and Grafana, gives history and dashboards, but you build and maintain it. An agent-based tool collects container data continuously and alerts you. Opservo takes the agent route: one command installs it, containers are auto-discovered with no configuration, and first findings appear within five minutes. The agent is read-only by default and opens no inbound ports.

How do I monitor Docker network connectivity and exposed ports?+

Start with what each container is listening on and whether the service behind that port actually answers. Inside the host, docker network ls and docker network inspect show how containers are attached, and ss -tlnp shows which ports are listening. From the outside, a TCP, HTTP or ping check tells you whether users can reach the service. Opservo auto-discovers listening ports on the server and offers external HTTP, API, TCP, ping and DNS checks, so you can alert on a port that stops responding.

How do I tell if a Docker container is slow or short on resources?+

Compare each container's CPU, memory and restart count with its normal behaviour and with any limits you set. Sustained CPU near its limit, memory close to the cap (which leads to OOM kills), or frequent restarts are the usual signs. docker stats gives a live view, but it has no history. Opservo shows these per server in plain English, explains why a server is slow, and on paid plans learns each server's normal CPU, memory and load for every hour of the day, alerting when it is unusual without thresholds to set.