# LazyDocker LazyDocker is a terminal UI (TUI) for managing [[Docker]] containers, images, volumes, and networks. Created by [[Jesse Duffield]] in 2019, it provides an intuitive visual interface for Docker operations without leaving the terminal. Part of Duffield's "lazy" tool suite (alongside [[LazyGit]] and LazyNpm), it follows the philosophy of making complex CLI tools accessible through keyboard-driven interfaces. Instead of memorizing Docker commands or constantly checking documentation, LazyDocker presents all resources in navigable panels with contextual actions. View logs in real-time, attach to containers, inspect configurations, and manage resources—all with single keystrokes. Written in [[Go]], it's fast, cross-platform, and requires no configuration. ## Key Features | Feature | Description | |---------|-------------| | **Container Management** | Start, stop, restart, remove, attach | | **Real-time Logs** | Stream container logs with search | | **Resource Monitoring** | CPU, memory, network stats per container | | **Image Management** | List, remove, prune images | | **Volume Management** | Inspect, remove volumes | | **Docker Compose** | Native support for compose projects | | **Custom Commands** | Define project-specific actions | | **Bulk Operations** | Prune all unused resources | ## Interface Layout ``` ┌─────────────────┬─────────────────────────────────────┐ │ Containers │ │ │ ─────────────│ Container Details │ │ > web (running) │ │ │ db (running) │ Logs | Stats | Config | Top │ │ redis (exited)│ │ ├─────────────────┤ │ │ Images │ [live log output or stats] │ │ ─────────────│ │ │ nginx:latest │ │ │ postgres:15 │ │ ├─────────────────┤ │ │ Volumes │ │ └─────────────────┴─────────────────────────────────────┘ ``` ## Keyboard Shortcuts | Key | Action | |-----|--------| | `↑/↓` | Navigate items | | `←/→` | Switch panels | | `Enter` | Focus item | | `d` | Remove container/image | | `s` | Stop container | | `r` | Restart container | | `a` | Attach to container | | `l` | View logs | | `[` / `]` | Switch tabs | | `x` | Open menu | | `?` | Show help | ## Installation ```bash # Homebrew (macOS/Linux) brew install lazydocker # Go go install github.com/jesseduffield/lazydocker@latest # Docker (ironic but works) docker run --rm -it -v /var/run/docker.sock:/var/run/docker.sock \ lazyteam/lazydocker ``` ## Configuration Custom commands in `~/.config/lazydocker/config.yml`: ```yaml customCommands: containers: - name: bash attach: true command: docker exec -it {{ .Container.ID }} bash ``` ## LazyDocker vs Docker CLI | Task | Docker CLI | LazyDocker | |------|------------|------------| | View logs | `docker logs -f container` | Navigate + `l` | | Stop container | `docker stop container` | Navigate + `s` | | View stats | `docker stats` | Built-in panel | | Prune all | Multiple commands | `x` → Prune | | Inspect | `docker inspect container` | Tab to Config | ## References - https://github.com/jesseduffield/lazydocker - https://www.youtube.com/watch?v=NICqQPxwJWw ## Related - [[Docker]] - [[Jesse Duffield]] - [[LazyGit]] - [[Go]] - [[Terminal User Interface (TUI)]] - [[Docker Compose]]