docker-container-healthchecker is a Docker CLI plugin that validates whether a Docker container is healthy by running configurable checks -- HTTP requests, port listening, command execution, or uptime monitoring -- defined in an app.json file.
After starting a container, you need to know it is actually working before routing traffic to it. Docker's built-in HEALTHCHECK instruction supports a single command, but many applications need more: checking an HTTP endpoint, verifying a port is bound, or running an internal validation script.
Container orchestrators like Kubernetes distinguish between startup, liveness, and readiness probes, each serving a different purpose. Docker alone does not make this distinction.
docker-container-healthchecker fills this gap. You define multiple healthchecks per process type in an app.json file, run them against a live container, and get pass/fail results. It supports all three probe types and four check strategies, giving you Kubernetes-style health validation for plain Docker containers.
Once installed, the plugin is available as docker healthcheck:
docker healthcheck versionUse the install script to download the latest release and install it as a Docker CLI plugin:
curl -fsSL https://raw.githubusercontent.com/dokku/docker-container-healthchecker/main/install.sh | shTo install a specific version:
VERSION=v0.14.1 curl -fsSL https://raw.githubusercontent.com/dokku/docker-container-healthchecker/main/install.sh | shTo install to a custom directory:
PLUGIN_DIR=/usr/libexec/docker/cli-plugins curl -fsSL https://raw.githubusercontent.com/dokku/docker-container-healthchecker/main/install.sh | shbrew install dokku/repo/docker-container-healthcheckersudo apt-get update
sudo apt-get install docker-container-healthcheckerThe Debian package installs the binary to both /usr/bin/docker-container-healthchecker (for direct invocation) and /usr/libexec/docker/cli-plugins/docker-healthcheck (for automatic Docker CLI plugin discovery).
Download a pre-built binary from GitHub Releases and place it in your Docker CLI plugins directory:
mkdir -p ~/.docker/cli-plugins
cp docker-healthcheck ~/.docker/cli-plugins/docker-healthcheck
chmod +x ~/.docker/cli-plugins/docker-healthcheckDocker looks for plugins in these directories:
~/.docker/cli-plugins/(per-user)/usr/libexec/docker/cli-plugins/(system-wide on Linux)/usr/local/lib/docker/cli-plugins/(system-wide on Linux)$(brew --prefix)/lib/docker/cli-plugins/(Homebrew on macOS)
Build and install as a Docker CLI plugin:
make installThis builds the binary for your platform and copies it to ~/.docker/cli-plugins/docker-healthcheck.
Direct invocation: The binary can also be run directly as
docker-container-healthchecker <command>without installing it as a plugin.
Start a container that serves HTTP traffic:
docker run -d --name demo nginxCreate an app.json file with a path check against the root URL:
{
"healthchecks": {
"web": [
{
"type": "startup",
"name": "http check",
"path": "/",
"port": 80,
"attempts": 3
}
]
}
}Run the healthcheck:
docker healthcheck check demo --port 80The command inspects the container, finds the healthcheck definitions for the web process type, sends an HTTP request to / on port 80, and reports the result. If the response returns a 2xx status code, the check passes.
If you run the check without an app.json file or without any checks for the specified process type, a default 10-second uptime check runs automatically -- verifying the container has been running without restarts.
Clean up:
docker rm -f demo- Command Reference -- all CLI flags and arguments
- Healthchecks -- the four check strategies and three healthcheck types
- File Format -- full
app.jsonfield reference - Dokku Migration -- converting from the legacy CHECKS file format