Lazy Docker
Lazy Docker
Lazy Docker is a terminal UI (TUI) for Docker management - like Docker Desktop, but faster, keyboard-driven, and in your terminal.
Key advantage: Mouse-free Docker management with real-time stats, logs, and full control without memorizing docker commands.
Installation
macOS:
bashbrew install jesseduffield/lazydocker/lazydocker
Linux:
bash# Download latest release curl https://raw.githubusercontent.com/jesseduffield/lazydocker/master/scripts/install_update_linux.sh | bash
Or with Go:
bashgo install github.com/jesseduffield/lazydocker@latest
Launch
bashlazydocker
Interface appears with panels for:
- Containers (running/stopped)
- Images
- Volumes
- Networks
- Container stats (CPU, memory)
- Logs (streaming)
Navigation
Vim-Style Keys
Panel navigation:
h/l- Switch between panels (left/right)j/k- Move up/down in lists[/]- Switch between tabs
Tabs:
1- Project view2- Containers3- Images4- Volumes5- Networks
Container Actions
Select container and press:
Enter- View container menul- View logss- View statse- Exec into container (opens shell)t- Top (processes inside container)r- Restart containerd- Remove containerp- Pause/unpausec- View config
In logs view:
/- Search logsw- Wrap/unwrap linesf- Follow mode (tail -f)
Image Actions
Select image and press:
Enter- Image menud- Delete imageb- Build from Dockerfilep- Prune unused images
Bulk Operations
Prune everything:
x- Opens prune menu- Prune containers
- Prune images
- Prune volumes
- Prune networks
- Prune everything (dangerous!)
Real-Time Features
Live Stats
Container stats panel shows:
- CPU usage (%)
- Memory usage (MB / GB)
- Network I/O
- Block I/O (disk)
Updates in real-time - no need to run docker stats separately.
Log Streaming
Logs panel:
- Automatically tails selected container
- Color-coded output
- Search with
/ - Follow mode (updates live)
Switch containers - logs update instantly.
Process Monitoring
Press t on container:
- Shows running processes inside container
- Like
docker top <container> - Refreshes automatically
Common Workflows
Debugging Container
- Launch
lazydocker - Select container (
j/kto navigate) - Press
lfor logs - Search logs with
/error - Press
eto exec into container - Debug interactively
Ctrl-Cto exit shell
All without typing docker commands.
Image Cleanup
- Navigate to Images tab (
3) - Press
xβ Prune images - Confirm
- See space freed in real-time
Restart Services
Docker Compose stack:
- Project view (
1) - Select service
- Press
rto restart - Logs update automatically
Configuration
Config location: ~/.config/lazydocker/config.yml
Example config:
yamlgui: theme: activeBorderColor: - green - bold inactiveBorderColor: - white scrollHeight: 2 language: 'en' logs: timestamps: false since: '60m' confirmOnQuit: false customCommands: containers: - name: 'bash' attach: true command: 'docker exec -it {{ .Container.ID }} /bin/bash' serviceNames: []
Custom Commands
Add frequently-used commands:
yamlcustomCommands: containers: - name: 'View environment' attach: false command: 'docker exec {{ .Container.ID }} env' - name: 'Check disk usage' attach: false command: 'docker exec {{ .Container.ID }} df -h' - name: 'Tail nginx logs' attach: true command: 'docker exec -it {{ .Container.ID }} tail -f /var/log/nginx/access.log' serviceNames: ['nginx']
Access: Select container, press c for custom commands menu.
Docker Compose Integration
Lazy Docker auto-detects docker-compose.yml:
Project view shows:
- All services in compose file
- Service status (running/stopped)
- Service logs (grouped)
- Quick restart/rebuild
Per-service actions:
r- Restart servicel- View logs (just that service)e- Exec into service containerd- Remove service container
Rebuild:
- Select service
- Press
b - Lazy Docker runs
docker-compose build <service> - Auto-restarts after rebuild
Bulk Actions
Prune Menu (x)
Options:
- Prune stopped containers
- Prune dangling images
- Prune unused images (dangerous!)
- Prune unused volumes
- Prune unused networks
- Prune everything (nuclear option)
Shows space to be freed before confirming.
Multi-Container Management
Select multiple containers:
- Not directly supported (future feature)
- Use filters in Project view
Workaround: Use custom commands for batch operations.
Keyboard Shortcuts Reference
| Key | Action |
|---|---|
| Navigation | |
h / l | Switch panels |
j / k | Move in list |
1-5 | Switch tabs |
[ / ] | Cycle tabs |
| Container Actions | |
Enter | Menu |
l | Logs |
s | Stats |
e | Exec shell |
t | Top (processes) |
r | Restart |
d | Remove |
p | Pause/unpause |
| Log View | |
/ | Search |
w | Wrap toggle |
f | Follow mode |
n / N | Next/prev match |
| General | |
? | Help menu |
x | Prune menu |
m | Open custom commands |
Ctrl-R | Refresh |
q or Esc | Quit/Back |
Comparison: Lazy Docker vs Docker CLI
| Task | CLI | Lazy Docker |
|---|---|---|
| View logs | docker logs -f <container> | Select + l |
| Exec shell | docker exec -it <container> bash | Select + e |
| View stats | docker stats <container> | Automatic (always visible) |
| Restart | docker restart <container> | Select + r |
| Prune | docker system prune + confirm | x β select option |
| View processes | docker top <container> | Select + t |
| Multi-container | Multiple commands | Navigate visually |
Lazy Docker wins: No memorizing container IDs/names, visual feedback, real-time updates.
Comparison: Lazy Docker vs Docker Desktop
| Feature | Docker Desktop | Lazy Docker |
|---|---|---|
| Interface | GUI (Electron app) | TUI (terminal) |
| Speed | Slower startup | Instant |
| Memory | ~500 MB+ | ~20 MB |
| Keyboard-driven | No | Yes |
| Mouse required | Yes | No |
| SSH-able | No | Yes (runs in terminal) |
| Customizable | Limited | Config file + custom commands |
| Log search | Basic | Full search (/ + regex) |
Lazy Docker wins: Speed, efficiency, SSH-able, keyboard-first workflow.
Advanced Use Cases
Remote Docker Management
SSH into server:
bashssh user@server lazydocker
Manage remote Docker as if local - full TUI experience over SSH.
Tmux/Zellij Integration
Dedicated Docker pane:
βββββββββββββββ¬ββββββββββββββ
β β β
β nvim β lazydocker β
β β (monitoring)β
βββββββββββββββ΄ββββββββββββββ
Always-on monitoring in split pane.
Zellij layout:
kdlpane split_direction="horizontal" { pane size="70%" pane command="lazydocker" size="30%" }
CI/CD Debugging
Build fails in CI:
- SSH into build server
lazydocker- Find failed container
- View logs
- Exec into container
- Debug interactively
Faster than docker logs + docker exec separately.
Tips
Always-on monitoring:
bash# In a tmux/zellij pane lazydocker
Leave running - glance at stats anytime.
Quick container cleanup:
bashlazydocker # Press x β Prune stopped containers
Log searching:
bash# In logs view /error # Search for "error" n # Next match N # Previous match
Custom shell exec:
Edit config:
yamlcustomCommands: containers: - name: 'zsh' attach: true command: 'docker exec -it {{ .Container.ID }} /bin/zsh'
Now c β "zsh" opens Zsh instead of Bash.
Resource monitoring:
- Watch Stats panel for memory leaks
- High CPU% = inefficient container
- Network I/O spikes = debug traffic
Integration with Other Tools
Use alongside:
- asciinema - Record Docker TUI sessions
- ctop - Dedicated container stats (alternative)
- dry - Another Docker TUI (less feature-rich)
Lazy Docker is best for general-purpose Docker management.
Gotchas
Requires Docker daemon running:
bash# If Docker not running sudo systemctl start docker # or open -a Docker # macOS Docker Desktop
TTY required:
- Won't work in non-interactive environments
- Use
dockerCLI for scripts/automation
Not a replacement for complex operations:
- Multi-stage builds: Use
docker build - Complex networking: Use
docker networkCLI - Swarm/Kubernetes: Use dedicated tools
Lazy Docker is for: Day-to-day container management, debugging, monitoring.
Links
Lazy Docker GitHub
- URL: https://github.com/jesseduffield/lazydocker
- Summary: Terminal UI for Docker management with real-time stats and logs
- Related: Docker, ctop, asciinema
NetworkChuck Video: 37 INSANE Linux Commands
- URL: https://www.youtube.com/watch?v=6P-vjgPx9ww
- Summary: Features Lazy Docker as "a treasure" for Docker management
- Related: asciinema, Mosh, Wormhole