Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🐳 HA Docker Manager

A Home Assistant custom integration for monitoring and managing Docker containers across multiple servers — built as a proper HA integration with a full config flow UI.

hacs_badge GitHub release License: MIT


Features

  • 🖥 Multi-server — monitor any number of Docker hosts (local socket or remote TCP)
  • 📦 Auto-discovery — all containers discovered automatically, no yaml required
  • 📊 Full stats — CPU, memory, network up/down, uptime, health, ports
  • 🧱 Compose-aware — shows which compose stack each container belongs to
  • 🔌 Auto port detection — reads exposed ports directly from Docker API
  • ▶️ Container control — start, stop, restart from HA
  • 📋 Log viewer — fetch last 100 log lines as a persistent notification
  • 🌐 Cluster overview — aggregate sensors across all servers
  • 🔧 Per-container options — set display names and external URLs in the HA UI

Installation via HACS

Open your Home Assistant instance and open a repository inside the Home Assistant Community Store.

Or manually:

  1. Open HACS in Home Assistant
  2. Go to Integrations
  3. Click the three dots → Custom repositories
  4. Add https://github.com/bartkodden/HA-Docker-Manager as an Integration
  5. Search for Docker Manager and install
  6. Restart Home Assistant

Setup

1. Add the integration

Settings → Devices & Services → Add Integration → Docker Manager

2. Configure each server

Field Description
Server name Display name (e.g. Server1, Docker1)
Connection type Local socket or Remote TCP
Host IP IP of the remote server (TCP only)
Docker port Default 2375
Scan interval Poll frequency in seconds

3. Enable TCP on remote servers

Remote servers must expose the Docker API over TCP. Add to /etc/docker/daemon.json:

{
  "hosts": ["unix:///var/run/docker.sock", "tcp://0.0.0.0:2375"]
}

Then restart Docker:

sudo systemctl daemon-reload && sudo systemctl restart docker

⚠️ Port 2375 is unauthenticated. Use on trusted LAN networks only. For production consider docker-socket-proxy.

4. Configure container options (optional)

After adding a server, click Configure on the integration entry to set per-container display names and external URLs.


Entities created

Per server (host-level)

Entity Description
sensor.{server}_version Docker version
sensor.{server}_containers_running Running container count
sensor.{server}_containers_total Total container count
sensor.{server}_cpu_usage Normalized CPU % (0-100)
sensor.{server}_memory_usage Total memory used (MiB)
sensor.{server}_network_total_up Aggregate upload speed (KiB/s)
sensor.{server}_network_total_down Aggregate download speed (KiB/s)

Per container

Entity Description
sensor.{server}_{container}_state running / exited / paused
sensor.{server}_{container}_status Human readable status
sensor.{server}_{container}_cpu CPU %
sensor.{server}_{container}_memory Memory (MiB)
sensor.{server}_{container}_ports Exposed ports
sensor.{server}_{container}_compose_project Compose stack name
sensor.{server}_{container}_uptime Start timestamp
switch.{server}_{container}_running Start / stop
button.{server}_{container}_restart Restart
button.{server}_{container}_fetch_logs Fetch logs → notification

Cluster (auto-created, across all servers)

Entity Description
sensor.docker_manager_docker_servers_online Online server count
sensor.docker_manager_docker_total_running Total running across all servers
sensor.docker_manager_docker_total_containers Total containers across all servers
binary_sensor.docker_manager_docker_cluster_healthy All servers reachable

Dashboard

A full Lovelace dashboard YAML is available in the wiki.

Required HACS frontend cards:


Requirements

  • Home Assistant 2024.1.0+
  • Docker with API access (local socket or TCP)
  • Python package: aiodocker==0.21.0 (installed automatically)

Contributing

PRs welcome! Please open an issue first for major changes.

git clone https://github.com/bartkodden/HA-Docker-Manager.git
cd HA-Docker-Manager
python -m venv venv && source venv/bin/activate
pip install -r requirements_dev.txt

About

Home assistant docker manager, monitor status, control containers and manage multiple docker servers in one package

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages