← Back to articles

Lazy Docker

Path: Computer Tech/Terminal/Lazy Docker.mdUpdated: 2/3/2026

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:

bash
brew 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:

bash
go install github.com/jesseduffield/lazydocker@latest

Launch

bash
lazydocker

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 view
  • 2 - Containers
  • 3 - Images
  • 4 - Volumes
  • 5 - Networks

Container Actions

Select container and press:

  • Enter - View container menu
  • l - View logs
  • s - View stats
  • e - Exec into container (opens shell)
  • t - Top (processes inside container)
  • r - Restart container
  • d - Remove container
  • p - Pause/unpause
  • c - View config

In logs view:

  • / - Search logs
  • w - Wrap/unwrap lines
  • f - Follow mode (tail -f)

Image Actions

Select image and press:

  • Enter - Image menu
  • d - Delete image
  • b - Build from Dockerfile
  • p - 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

  1. Launch lazydocker
  2. Select container (j/k to navigate)
  3. Press l for logs
  4. Search logs with /error
  5. Press e to exec into container
  6. Debug interactively
  7. Ctrl-C to exit shell

All without typing docker commands.

Image Cleanup

  1. Navigate to Images tab (3)
  2. Press x β†’ Prune images
  3. Confirm
  4. See space freed in real-time

Restart Services

Docker Compose stack:

  1. Project view (1)
  2. Select service
  3. Press r to restart
  4. Logs update automatically

Configuration

Config location: ~/.config/lazydocker/config.yml

Example config:

yaml
gui:
  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:

yaml
customCommands:
  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 service
  • l - View logs (just that service)
  • e - Exec into service container
  • d - 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

KeyAction
Navigation
h / lSwitch panels
j / kMove in list
1-5Switch tabs
[ / ]Cycle tabs
Container Actions
EnterMenu
lLogs
sStats
eExec shell
tTop (processes)
rRestart
dRemove
pPause/unpause
Log View
/Search
wWrap toggle
fFollow mode
n / NNext/prev match
General
?Help menu
xPrune menu
mOpen custom commands
Ctrl-RRefresh
q or EscQuit/Back

Comparison: Lazy Docker vs Docker CLI

TaskCLILazy Docker
View logsdocker logs -f <container>Select + l
Exec shelldocker exec -it <container> bashSelect + e
View statsdocker stats <container>Automatic (always visible)
Restartdocker restart <container>Select + r
Prunedocker system prune + confirmx β†’ select option
View processesdocker top <container>Select + t
Multi-containerMultiple commandsNavigate visually

Lazy Docker wins: No memorizing container IDs/names, visual feedback, real-time updates.

Comparison: Lazy Docker vs Docker Desktop

FeatureDocker DesktopLazy Docker
InterfaceGUI (Electron app)TUI (terminal)
SpeedSlower startupInstant
Memory~500 MB+~20 MB
Keyboard-drivenNoYes
Mouse requiredYesNo
SSH-ableNoYes (runs in terminal)
CustomizableLimitedConfig file + custom commands
Log searchBasicFull search (/ + regex)

Lazy Docker wins: Speed, efficiency, SSH-able, keyboard-first workflow.

Advanced Use Cases

Remote Docker Management

SSH into server:

bash
ssh 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:

kdl
pane split_direction="horizontal" {
    pane size="70%"
    pane command="lazydocker" size="30%"
}

CI/CD Debugging

Build fails in CI:

  1. SSH into build server
  2. lazydocker
  3. Find failed container
  4. View logs
  5. Exec into container
  6. 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:

bash
lazydocker
# 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:

yaml
customCommands:
  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 docker CLI for scripts/automation

Not a replacement for complex operations:

  • Multi-stage builds: Use docker build
  • Complex networking: Use docker network CLI
  • Swarm/Kubernetes: Use dedicated tools

Lazy Docker is for: Day-to-day container management, debugging, monitoring.

Links

Lazy Docker GitHub

NetworkChuck Video: 37 INSANE Linux Commands