binhex-healarr

binhex-healarr

Docker app from Binhex's Repository

Overview

Healarr monitors Docker containers for unhealthy status and automatically performs configurable actions (restart, stop, etc.) with retry logic to prevent false positives. It supports filtering by container label, environment variable, or name, and includes comprehensive logging.

Application

Healarr

Description

Healarr monitors Docker containers for unhealthy status and automatically performs configurable actions (restart, stop, pause, unpause, kill) with retry logic to prevent false positives. It supports filtering containers by label, environment variable, or name, and includes comprehensive logging.

Key Features:

  • Monitors Docker containers with health checks for unhealthy status
  • Configurable retry logic to verify unhealthy state before taking action
  • Multiple filtering options: by label, environment variable, or container name (OR logic)
  • Support for direct Docker socket or socket proxy connection
  • Configurable actions: restart, stop, pause, unpause, kill
  • Structured logging with configurable log levels
  • Notification to multiple services via Apprise
  • Graceful shutdown handling

Build notes

Arch Linux base with Docker CLI.

Docker Socket Access

Healarr supports two methods for accessing the Docker daemon:

Method 1: Direct Docker Socket Mount (Traditional)

Mount the Docker socket directly into the container:

-v /var/run/docker.sock:/var/run/docker.sock

Method 2: Docker Socket Proxy (Recommended for Security)

Use a Docker socket proxy container for enhanced security:

-e DOCKER_HOST=tcp://dockersocket:2375

Required proxy permissions:

  • CONTAINERS=1 - Read container information
  • POST=1 - Allow POST requests (for restart/stop/etc)
  • ALLOW_RESTARTS=1 - Allow restart action
  • ALLOW_STOP=1 - Allow stop action (if using stop action)
  • ALLOW_START=1 - Allow start action (if using unpause after pause)

See examples below for complete socket proxy setup.

Usage

docker run -d \
    --name=<container name> \
    -v /var/run/docker.sock:/var/run/docker.sock \
    -v <path for config files>:/config \
    -v /etc/localtime:/etc/localtime:ro \
    -e DOCKER_HOST=<tcp://dockersocket:2375> \
    -e MONITOR_INTERVAL=<seconds between health checks> \
    -e RETRY_COUNT=<number of retry checks> \
    -e RETRY_DELAY=<seconds between retries> \
    -e ACTION=<restart|stop|pause|unpause|kill|none> \
    -e CONTAINER_LABEL=<label to filter> \
    -e CONTAINER_ENV_VAR=<env var to filter> \
    -e CONTAINER_NAME=<comma separated names> \
    -e APPRISE_NOTIFICATION_SERVICES=<comma separated apprise service URLs> \
    -e LOG_LEVEL=<0|1|2|3> \
    -e ENABLE_HEALTHCHECK=<yes|no> \
    -e HEALTHCHECK_COMMAND=<command> \
    -e HEALTHCHECK_ACTION=<action> \
    -e HEALTHCHECK_HOSTNAME=<hostname> \
    -e UMASK=<umask for created files> \
    -e PUID=<uid for user> \
    -e PGID=<gid for user> \
    ghcr.io/binhex/arch-healarr

Please replace all user variables in the above command defined by <> with the correct values.

Required Mount:

  • /var/run/docker.sock:/var/run/docker.sock - Docker socket access (required for container management) OR
  • DOCKER_HOST environment variable - For use with Docker socket proxy (see examples below)

Environment Variables

Variable Values Default Description
DOCKER_HOST string (empty) Docker socket proxy address (e.g. tcp://dockersocket:2375). Use as a secure alternative to mounting /var/run/docker.sock. Leave empty to use direct socket mount.
MONITOR_INTERVAL integer 60 Time in seconds between checking for unhealthy containers
RETRY_COUNT integer 3 Number of times to verify unhealthy status before taking action
RETRY_DELAY integer 10 Time in seconds to wait between retry health checks
ACTION restart|stop|pause|unpause|kill|none restart Docker action to execute on unhealthy containers, set to 'none' to perform no action
CONTAINER_LABEL string (empty) Filter containers by label (e.g. com.example.monitor=true)
CONTAINER_ENV_VAR string (empty) Filter containers by environment variable (e.g. MONITOR_ENABLED=true)
CONTAINER_NAME string (empty) Filter containers by name, comma-separated (e.g. sonarr,radarr,plex)
APPRISE_NOTIFICATION_SERVICES string (empty) Comma-separated list of Apprise service URLs for notifications (e.g. mailto://user:pass@gmail.com,discord://webhook_id/webhook_token)
LOG_LEVEL 0|1|2|3 1 Logging level: 0=DEBUG, 1=INFO, 2=WARN, 3=ERROR
ENABLE_HEALTHCHECK yes|no no Enable or disable healthchecks (for this container)
HEALTHCHECK_COMMAND string healthcheck.sh Healthcheck command or script to execute
HEALTHCHECK_ACTION string exit 1 Action on healthcheck failure, e.g. exit 1 or kill 1
HEALTHCHECK_HOSTNAME string cloudflare.com Hostname for healthcheck DNS/HTTPS tests
PUID integer 99 User ID for the running container
PGID integer 100 Group ID for the running container
UMASK integer 000 UMASK for created files

Note: Filters (CONTAINER_LABEL, CONTAINER_ENV_VAR, CONTAINER_NAME) use OR logic. If no filters are specified, all containers with health checks will be monitored.

Access application

N/A, daemon only. Check logs for monitoring activity.

Examples

Example 1: Monitor all containers, restart unhealthy ones

docker run -d \
    --name=healarr \
    -v /var/run/docker.sock:/var/run/docker.sock \
    -v /apps/docker/healarr:/config \
    -v /etc/localtime:/etc/localtime:ro \
    -e MONITOR_INTERVAL=60 \
    -e RETRY_COUNT=3 \
    -e RETRY_DELAY=10 \
    -e ACTION=restart \
    -e LOG_LEVEL=1 \
    -e UMASK=000 \
    -e PUID=99 \
    -e PGID=100 \
    ghcr.io/binhex/arch-healarr

Example 2: Monitor specific containers by name

docker run -d \
    --name=healarr \
    -v /var/run/docker.sock:/var/run/docker.sock \
    -v /apps/docker/healarr:/config \
    -v /etc/localtime:/etc/localtime:ro \
    -e MONITOR_INTERVAL=120 \
    -e RETRY_COUNT=5 \
    -e RETRY_DELAY=15 \
    -e ACTION=restart \
    -e CONTAINER_NAME="sonarr,radarr,plex,jellyfin" \
    -e LOG_LEVEL=1 \
    -e UMASK=000 \
    -e PUID=99 \
    -e PGID=100 \
    ghcr.io/binhex/arch-healarr

Example 3: Monitor containers with specific label

docker run -d \
    --name=healarr \
    -v /var/run/docker.sock:/var/run/docker.sock \
    -v /apps/docker/healarr:/config \
    -v /etc/localtime:/etc/localtime:ro \
    -e MONITOR_INTERVAL=90 \
    -e RETRY_COUNT=3 \
    -e RETRY_DELAY=10 \
    -e ACTION=restart \
    -e CONTAINER_LABEL="healarr.monitor=true" \
    -e LOG_LEVEL=1 \
    -e UMASK=000 \
    -e PUID=99 \
    -e PGID=100 \
    ghcr.io/binhex/arch-healarr

Example 4: Monitor containers with specific env vars

docker run -d \
    --name=healarr \
    -v /var/run/docker.sock:/var/run/docker.sock \
    -v /apps/docker/healarr:/config \
    -v /etc/localtime:/etc/localtime:ro \
    -e MONITOR_INTERVAL=60 \
    -e RETRY_COUNT=2 \
    -e RETRY_DELAY=20 \
    -e ACTION=stop \
    -e CONTAINER_ENV_VAR="AUTO_HEAL=true" \
    -e LOG_LEVEL=2 \
    -e UMASK=000 \
    -e PUID=99 \
    -e PGID=100 \
    ghcr.io/binhex/arch-healarr

Example 5: Using Docker Socket Proxy (LinuxServer.io)

First, create a Docker socket proxy container:

docker run -d \
    --name=dockersocket \
    --restart=unless-stopped \
    -v /var/run/docker.sock:/var/run/docker.sock:ro \
    -e CONTAINERS=1 \
    -e POST=1 \
    -e ALLOW_RESTARTS=1 \
    -e ALLOW_STOP=1 \
    -e ALLOW_START=1 \
    --network=docker-management \
    lscr.io/linuxserver/socket-proxy:latest

Then run Healarr using the socket proxy:

docker run -d \
    --name=healarr \
    -v /apps/docker/healarr:/config \
    -v /etc/localtime:/etc/localtime:ro \
    -e DOCKER_HOST=tcp://dockersocket:2375 \
    -e MONITOR_INTERVAL=60 \
    -e RETRY_COUNT=3 \
    -e RETRY_DELAY=10 \
    -e ACTION=restart \
    -e LOG_LEVEL=1 \
    -e UMASK=000 \
    -e PUID=99 \
    -e PGID=100 \
    --network=docker-management \
    ghcr.io/binhex/arch-healarr

Important Note: Both containers MUST be on the same Docker network (docker-management in this example).

Notes

User ID (PUID) and Group ID (PGID) can be found by issuing the following command for the user you want to run the container as:-

id <username>

If you appreciate my work, then please consider buying me a beer :D

PayPal donation

Documentation | Support forum

Install binhex-healarr on Unraid in a few clicks.

Find binhex-healarr in Community Apps on your Unraid server, review the template, and click Install. Unraid handles the Docker app or plugin setup from the published template.

Open the Apps tab on your Unraid server Search Community Apps for binhex-healarr Review the template variables and paths Click Install

Download Statistics

1,401
Total Downloads

Related apps

Explore more like this

Explore all

Details

Repository
ghcr.io/binhex/arch-healarr
Last Updated2026-01-07
First Seen2025-12-29

Runtime arguments

Network
bridge
Shell
bash
Privileged
false
Extra Params
--restart=unless-stopped

Template configuration

Path: /configPathrw

This is the container path to your configuration files, e.g. databases, configuration files, logs etc.

Target
/config
Default
/mnt/user/appdata/healarr
Path: /var/run/docker.sockPathrw

Docker socket for container management - REQUIRED if not using DOCKER_HOST. Remove this if using Docker socket proxy.

Target
/var/run/docker.sock
Default
/var/run/docker.sock
Variable: DOCKER_HOSTVariable

Docker socket proxy address (e.g. 'tcp://dockersocket:2375'). Use this as a secure alternative to mounting /var/run/docker.sock. Leave empty to use direct socket mount.

Target
DOCKER_HOST
Variable: MONITOR_INTERVALVariable

Time in seconds between checking for containers that are 'unhealthy' (default: 60).

Target
MONITOR_INTERVAL
Default
60
Variable: RETRY_COUNTVariable

Number of times to verify unhealthy status before taking action (default: 3).

Target
RETRY_COUNT
Default
3
Variable: RETRY_DELAYVariable

Time in seconds to wait between retry health checks (default: 10).

Target
RETRY_DELAY
Default
10
Variable: ACTIONVariable

Docker action to execute on unhealthy containers: restart, stop, pause, unpause, kill or none (no action).

Target
ACTION
Default
restart|stop|pause|unpause|kill|none
Variable: CONTAINER_LABELVariable

Filter containers by label (e.g. 'com.example.monitor=true'). Filters use OR logic.

Target
CONTAINER_LABEL
Variable: CONTAINER_ENV_VARVariable

Filter containers by environment variable (e.g. 'MONITOR_ENABLED=true'). Filters use OR logic.

Target
CONTAINER_ENV_VAR
Variable: CONTAINER_NAMEVariable

Filter containers by name, comma-separated (e.g. 'sonarr,radarr,plex'). Filters use OR logic.

Target
CONTAINER_NAME
Variable: APPRISE_NOTIFICATION_SERVICESVariable

Comma-separated list of Apprise service URLs for notifications (e.g. 'mailto://user:pass@gmail.com,discord://webhook_id/webhook_token').

Target
APPRISE_NOTIFICATION_SERVICES
Variable: LOG_LEVELVariable

Logging level: 0=DEBUG, 1=INFO, 2=WARN, 3=ERROR (default: 1).

Target
LOG_LEVEL
Default
1
Variable: ENABLE_HEALTHCHECKVariable

Enable or disable healthchecks (this container).

Target
ENABLE_HEALTHCHECK
Default
yes|no
Variable: HEALTHCHECK_COMMANDVariable

The command or script to execute, if not specified then the script healthcheck.sh will be used (process, dns and https checking).

Target
HEALTHCHECK_COMMAND
Variable: HEALTHCHECK_ACTIONVariable

The action to execute if the healthcheck command returns a non zero exit code, if not specified the action will be 'exit 1', if you want the container to exit on failure then set the action to 'kill 1'.

Target
HEALTHCHECK_ACTION
Variable: HEALTHCHECK_HOSTNAMEVariable

The hostname used when performing HTTPS and DNS healthchecking.

Target
HEALTHCHECK_HOSTNAME
Default
google.com
Variable: PUIDVariable

User ID for the running container

Target
PUID
Default
99
Variable: PGIDVariable

Group ID for the running container

Target
PGID
Default
100
Variable: UMASKVariable

UMASK for the running container

Target
UMASK
Default
000