Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Docker Dashboard

A tiny local web app that shows the live status of every Docker container on your machine in one browser page — CPU/memory/network stats, start/stop/ restart controls, and live streaming logs.

It talks directly to your local Docker daemon (the same one the docker CLI uses) via its Unix socket, so no remote setup is needed.

1. Requirements

  • Python 3.9+
  • Docker Desktop / Docker Engine running locally
  • Your user must be able to run docker ps without sudo (i.e. you're in the docker group on Linux, or using Docker Desktop on Mac/Windows)

2. Install

cd docker-dashboard
python3 -m venv venv
source venv/bin/activate       # Windows: venv\Scripts\activate
pip install -r requirements.txt

3. Run

python app.py

Then open http://localhost:8008 in your browser.

The page auto-refreshes every 3 seconds. Click Logs on any container to open a live streaming log panel (via WebSocket). Use Start / Stop / Restart to control containers directly from the dashboard.

4. Notes / troubleshooting

  • Permission denied talking to Docker: on Linux, add your user to the docker group (sudo usermod -aG docker $USER, then log out/in), or run the app with sudo.
  • Port 8008 already in use: change the port at the bottom of app.py (uvicorn.run(app, host="0.0.0.0", port=8008)).
  • Windows named pipe: docker.from_env() also works with Docker Desktop on Windows automatically; no extra config needed.
  • This is designed for local, single-host use — it's a thin wrapper around the Docker SDK, not an auth-protected multi-user service. Don't expose port 8008 to the open internet as-is.

5. How it works

  • app.py — FastAPI backend using the docker Python SDK:
    • GET /api/containers — list all containers with status/health/ports
    • GET /api/containers/{id}/stats — one-shot CPU/mem/net/block stats
    • POST /api/containers/{id}/{start|stop|restart|pause|unpause}
    • WS /ws/logs/{id} — streams docker logs -f output live
  • static/index.html — single-page vanilla JS/CSS dashboard, polls the REST endpoints and opens a WebSocket per log view. No build step, no frameworks.

Ideas for extending it

  • Add a text filter/search box for container name or image
  • Add container creation (docker run form) if you want it to do more than view/control existing containers
  • Persist historical CPU/mem graphs (currently only shows the live snapshot)
  • Add basic auth (e.g. HTTP Basic via FastAPI middleware) if you ever expose it beyond localhost

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages