docker-commander

module
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 5, 2026 License: MIT

README ΒΆ

Docker Commander

A self-hosted, open-source Docker monitoring & control panel with an enterprise-grade UI β€” monitor containers in real time, control their full lifecycle, browse logs and files, manage images, networks and volumes, alert on problems, and administer it all from one binary.

One Go binary with the web UI embedded. No external database, no runtime dependencies, CGO-free. Runs on Linux, macOS and Windows.

CI Release Go Report Card Go version


πŸ“Έ Screenshots

Dashboard β€” host overview, disk usage, and running containers at a glance.

Dashboard

Container detail β€” live CPU / memory with history, and tabs for logs, an interactive console, processes, the file browser, filesystem changes and env.

Container detail

Aggregated logs β€” many containers in one stream, color-coded by source with level filters, regex search and structured parsing.

Aggregated logs

✨ Features

Monitor

  • Live CPU / memory graphs over WebSockets and historical charts (Redis or in-memory).
  • Dashboard that updates in near real time (Docker events stream): host facts, disk usage, a resource breakdown (each container's share of host CPU/memory), and a port scan that fingerprints what's actually listening.
  • Logs β€” per-container tail, plus a global aggregated view with level detection, regex search and saved parsing rules that turn lines into structured columns.
  • Live events feed, container diff / top, disk usage, and raw JSON inspect for any object.
  • Networks & topology β€” an interactive containers ↔ networks graph (pan / zoom / fullscreen, filters).

Control

  • Containers: create/run, start/stop/restart/pause/kill, rename, update limits & restart policy, commit to an image, and an interactive shell (xterm.js).
  • File browser inside containers β€” list, download, upload, delete (docker cp).
  • Images: pull (live progress), build, push, tag, save/load/import, history, prune.
  • Volumes & networks: list, inspect, create, remove, prune (see which containers use each volume).
  • Compose β€” discover & manage Stacks by label (CLI-created ones too: start/stop/restart/remove, view compose file), and Projects: managed compose folders (a compose file + sidecar configs/scripts) edited in a built-in tree editor and deployed via the docker compose CLI with profile selection and .zip import/export.

Multi-host

  • Manage local, TCP(+TLS) and SSH daemons; SSH host keys are verified (known_hosts / trust-on-first-use). Every view rebinds to the selected host, and the alert engine watches all hosts. A per-host detail panel shows the hardware / OS / engine, and a host can be disabled to take it out of monitoring (e.g. an offline laptop).

Alerting & integrations

  • Rules on state, resource thresholds, log patterns and restart/crash-loops β€” editable, with severity & cooldown.
  • Notify via webhooks, email (SMTP, per-host routing), an in-app feed, and a Prometheus /metrics exporter.

Security & administration

  • Argon2id passwords + TOTP 2FA (optionally exempt for localhost), rate limiting, strict headers, signed HttpOnly cookies.
  • Multi-user with roles, per-section permissions, read-only mode, global feature flags, and an audit log. Per-user UI preferences (filters) follow the account across browsers.
  • Optional LDAP / Active Directory login with auto-provisioning. Registry / SMTP / LDAP secrets are encrypted at rest (AES-256-GCM).

Ops

  • Single CGO-free binary, embedded UI, systemd unit, config file, native HTTPS (or behind a proxy), /healthz probe, and structured alert logging to the journal/syslog. See Deployment.

πŸ—οΈ Architecture

React + TypeScript SPA  ──REST──▢  Go backend  ──Docker Engine API──▢  dockerd
   (Tailwind, Recharts)  ◀─WebSocket (live stats + logs)β”€β”˜

The Go server embeds the built SPA (go:embed) and serves everything from one origin, so the production artifact is a single executable.

Layer Technology
Backend Go, chi, coder/websocket, official Docker SDK
Storage SQLite via modernc.org/sqlite (pure Go, no CGO); metric history in Redis or memory
Auth Argon2id, TOTP (pquerna/otp), JWT, optional LDAP
Frontend React, TypeScript, Vite, Tailwind CSS, Recharts, React Flow, xterm.js

πŸš€ Quick start

Option A β€” download a release binary

Grab the binary for your OS/arch from the Releases page, then:

chmod +x dockercmd-linux-amd64
./dockercmd-linux-amd64           # serves on http://127.0.0.1:8470

On Windows, run dockercmd-windows-amd64.exe from a terminal.

Option B β€” build from source

Requires Go β‰₯ 1.25, Node.js β‰₯ 18 (to build the UI) and a running Docker daemon. See Building for per-OS details.

git clone https://github.com/koduj-dev/docker-commander.git
cd docker-commander
make build      # builds the UI, then the binary with the UI embedded
./dockercmd     # http://127.0.0.1:8470

Open http://127.0.0.1:8470, create the admin account, scan the QR code to enable 2FA β€” done.

βš™οΈ Configuration

Every option is a flag with an environment-variable equivalent, and can also live in a config file β€” see deploy/commander.conf.example for the full list. The Docker connection also honours the standard DOCKER_HOST / DOCKER_CERT_PATH variables.

Flag Env Default Description
-host DC_HOST 127.0.0.1 Listen host/interface. Use 0.0.0.0 to bind all (deliberate).
-port / -p DC_PORT 8470 Listen port.
-addr DC_ADDR (unset) Legacy full host:port; overrides -host/-port.
-tls-cert DC_TLS_CERT (off) PEM certificate path; with -tls-key, serves HTTPS directly.
-tls-key DC_TLS_KEY (off) PEM private-key path.
-data-dir DC_DATA_DIR OS config dir SQLite DB + signing/encryption keys.
-session-ttl β€” 12h Session token lifetime.
-dev DC_DEV=1 off Dev mode: API only + permissive CORS for Vite.
-metrics-token DC_METRICS_TOKEN (open) If set, /metrics needs Authorization: Bearer <token> (or ?token=).
-redis-addr DC_REDIS_ADDR (memory) Redis host:port for metric history; empty = in-memory ring.
-redis-password DC_REDIS_PASSWORD (empty) Redis password; DC_REDIS_DB selects the DB index.
-metrics-retention DC_METRICS_RETENTION 6h History retention (e.g. 30m, 24h).

πŸ–₯️ Run as a service (Linux / systemd)

The server keeps monitoring, alerting and metric history running 24/7 whether or not a browser is connected β€” on a server, run it under systemd:

sudo install -m755 dockercmd /usr/local/bin/dockercmd
sudo useradd --system --no-create-home --shell /usr/sbin/nologin dockercmd
sudo usermod -aG docker dockercmd
sudo install -d /etc/docker-commander && sudo cp deploy/commander.conf.example /etc/docker-commander/commander.conf   # edit
sudo cp deploy/dockercmd.service /etc/systemd/system/
sudo systemctl daemon-reload && sudo systemctl enable --now dockercmd

It binds to loopback by default β€” put it behind a TLS reverse proxy (nginx, Caddy) to expose it, and keep the localhost 2FA exemption off on servers.

πŸ”¨ Building

The UI is built with Node and embedded into the Go binary; the result is a single CGO-free static executable.

make build          # current platform β†’ ./dockercmd
make release        # cross-compile all platforms β†’ dist-bin/ (+ SHA256SUMS)
make test vet       # tests + static checks
VERSION=v1.0.0 make release   # stamp the version into the binary

Per OS (building from source β€” end users can just download a release):

Host OS Notes
Linux make build. Default target for releases.
macOS make build (Intel or Apple Silicon). Cross-compiles to both darwin/amd64 and darwin/arm64.
Windows Use WSL or Git Bash for make, or run the two steps manually: cd web && npm ci && npm run build then go build -o dockercmd.exe ./cmd/dockercmd. Releases ship windows/amd64 + windows/arm64 .exe.

make release builds linux/{amd64,arm64}, darwin/{amd64,arm64} and windows/{amd64,arm64} from any host (no C toolchain needed).

πŸ§‘β€πŸ’» Development

make dev                       # API on :8470 (dev mode)
cd web && npm install && npm run dev   # UI on :5173, proxies /api β†’ :8470

Tests

go test -short ./...   # fast unit tests (what CI runs)
go test ./...          # + integration tests β€” needs a local Docker daemon
                       #   (spins throwaway Redis / OpenLDAP / MailHog containers)

πŸ“ˆ Monitoring & alerting

Define rules on the Alerts screen:

Type Fires when…
state a container emits a lifecycle event (die, kill, oom, stop, unhealthy)
resource CPU% or MEM% crosses a threshold for N seconds
log a log line matches a substring / regex
restart a container restarts too often within a window (crash loop)

Rules target containers by name substring, carry a severity + cooldown, and can notify webhooks (Go-template bodies) and/or email. Prometheus: scrape /metrics for dockercmd_container_cpu_percent, _mem_bytes, _mem_percent, _container_running (labelled by id, name, host).

πŸ”’ Security notes

  • Local-by-default (binds to loopback). Behind a server, terminate TLS at a reverse proxy.
  • 2FA is enforced everywhere unless an admin enables the localhost exemption (Settings), which trusts RemoteAddr only β€” keep it off behind a proxy.
  • SSH hosts verify the daemon host key (known_hosts / trust-on-first-use); a changed key is refused as a possible MITM.
  • Signing key and at-rest encryption key are generated on first run and stored in the data dir; stored secrets are never returned by the API.

πŸ“š Documentation

A per-feature user manual lives in docs/ β€” one page per agenda (Containers, Images, Logs, Alerts, Hosts, Users, Settings…) plus Getting started and Deployment.

πŸ—ΊοΈ Roadmap & changelog

See NEXT.md for the status and future ideas, and CHANGELOG.md for what shipped in each release.

🀝 Contributing

Issues and pull requests are welcome! See CONTRIBUTING.md for build/test/style guidelines, CODE_OF_CONDUCT.md, and SECURITY.md for reporting vulnerabilities (privately, please).

πŸ€– Made with AI

Roughly 95 % of this project was built with AI (Claude Code) β€” code, tests, and docs β€” under human direction and review. πŸŽ‰

πŸ“„ License

MIT.

Directories ΒΆ

Path Synopsis
cmd
dockercmd command
Command dockercmd is the Docker Commander server: a single binary that monitors and controls Docker containers and serves the embedded web UI.
Command dockercmd is the Docker Commander server: a single binary that monitors and controls Docker containers and serves the embedded web UI.
internal
api
Package api wires the HTTP surface together: REST endpoints for auth and Docker operations, the WebSocket upgrade, and serving the embedded SPA.
Package api wires the HTTP surface together: REST endpoints for auth and Docker operations, the WebSocket upgrade, and serving the embedded SPA.
config
Package config loads runtime configuration from flags and environment variables and resolves sensible cross-platform defaults.
Package config loads runtime configuration from flags and environment variables and resolves sensible cross-platform defaults.
crypto
Package crypto provides authenticated symmetric encryption (AES-256-GCM) for secrets stored at rest, such as registry credentials.
Package crypto provides authenticated symmetric encryption (AES-256-GCM) for secrets stored at rest, such as registry credentials.
docker
Package docker manages connections to one or more Docker engines and exposes a domain-shaped API (containers, networks, stats, logs) for the rest of the app.
Package docker manages connections to one or more Docker engines and exposes a domain-shaped API (containers, networks, stats, logs) for the rest of the app.
history
Package history stores a rolling window of container resource metrics for charting.
Package history stores a rolling window of container resource metrics for charting.
monitor
Package monitor is the alerting engine.
Package monitor is the alerting engine.
store
Package store provides a pure-Go SQLite-backed persistence layer.
Package store provides a pure-Go SQLite-backed persistence layer.
ws
Package ws implements the WebSocket endpoint that streams real-time data (container stats and logs) to authenticated frontend clients.
Package ws implements the WebSocket endpoint that streams real-time data (container stats and logs) to authenticated frontend clients.
Package web embeds the built single-page application so the whole product ships as one binary.
Package web embeds the built single-page application so the whole product ships as one binary.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL