Lazydocker Terminal UI for Docker
Lazydocker provides an intuitive terminal-based user interface for Docker management, streamlining common container operations without memorizing complex CLI commands. This comprehensive guide covers installation, navigation, container management, log viewing, statistics monitoring, keybindings customization, and configuration options. Lazydocker significantly improves Docker user experience, especially for system administrators and DevOps engineers working frequently with containers.
Table of Contents
- Understanding Lazydocker
- Installation and Setup
- Interface Navigation
- Container Management
- Image Operations
- Log Viewing and Monitoring
- Statistics and Performance
- Keybindings and Customization
- Configuration File
- Conclusion
Understanding Lazydocker
Lazydocker is a terminal UI for Docker written in Go, providing a visual interface for Docker operations including container management, image handling, log viewing, and statistics monitoring. It eliminates the need to memorize Docker CLI commands for common operations.
Key features:
- Container listing and management
- Real-time log viewing with filtering
- Container statistics and resource monitoring
- Image management and operations
- Volume browsing
- Network inspection
- Interactive commands with confirmation prompts
- Customizable keybindings and themes
- Cross-platform support (Linux, macOS, Windows WSL)
Interface components:
- Status bar: Shows current selection and available actions
- Container/Image panel: List view with details
- Logs panel: Real-time log streaming
- Stats panel: Resource usage metrics
- Info panel: Detailed information about selected item
Installation and Setup
Install Lazydocker on your system.
Installation methods:
# macOS with Homebrew
brew install lazydocker
# Linux with curl
curl https://raw.githubusercontent.com/jesseduffield/lazydocker/master/scripts/install_update_linux.sh | bash
# Verify installation
lazydocker --version
# Install manually from releases
cd /tmp
wget https://github.com/jesseduffield/lazydocker/releases/download/v0.23.1/lazydocker_0.23.1_Linux_x86_64.tar.gz
tar -xzf lazydocker_0.23.1_Linux_x86_64.tar.gz
sudo mv lazydocker /usr/local/bin/
chmod +x /usr/local/bin/lazydocker
# Verify
lazydocker --version
Building from source:
# Clone repository
git clone https://github.com/jesseduffield/lazydocker.git
cd lazydocker
# Build
go build -o lazydocker
# Install
sudo mv lazydocker /usr/local/bin/
# Verify
lazydocker --version
Configuration directory setup:
# Lazydocker creates config directory on first run
lazydocker
# Configuration location:
# Linux/macOS: ~/.config/lazydocker
# Windows: %APPDATA%\lazydocker
# Configuration files:
# - config.yml: Main configuration
# - state.yml: Saved UI state
# Verify creation
ls -la ~/.config/lazydocker
Running Lazydocker:
# Start Lazydocker
lazydocker
# Specify log level
lazydocker --log-level=debug
# Use alternative config file
lazydocker --config=/path/to/config.yml
# Specify container name to focus on
lazydocker --filter=myapp
# Exit with 'q' or Escape
Interface Navigation
Navigate Lazydocker's terminal user interface.
Main panels:
# Lazydocker shows multiple panels:
# 1. Containers panel (default)
# - Lists all containers
# - Shows status (running, exited, etc.)
# - Highlight selected container
# 2. Images panel
# - Lists all images
# - Shows repository, tag, size
# - Filter by name
# 3. Logs panel
# - Real-time log streaming
# - Tail or scroll
# - Timestamp display
# 4. Stats panel
# - CPU usage
# - Memory usage
# - Network I/O
# - Block I/O
# 5. Volumes panel
# - List volumes
# - Inspect mount points
Tab navigation:
# Press Tab or number keys to switch panels:
# 1 - Containers
# 2 - Images
# 3 - Volumes
# 4 - Networks
# 5 - Stats
# 6 - Logs
# Use arrow keys to navigate items in each panel
# Up/Down: Navigate list
# Left/Right: Switch panels
# Enter: Select item and show details
# Space: Show detail view (logs, stats, etc.)
Quick view operations:
# Common navigation patterns:
# View container logs:
# 1. Navigate to container (Tab + arrow keys)
# 2. Press 'l' to view logs
# 3. Scroll with Page Up/Down or mouse
# 4. 'q' to exit logs view
# View container stats:
# 1. Select container
# 2. Press 's' for stats
# 3. Watch real-time metrics
# 4. 'q' to exit
# View container details:
# 1. Select container
# 2. Press 'e' for environment
# 3. 'i' for inspect (full config)
# 4. 'q' to exit
Container Management
Perform common container operations from Lazydocker.
Basic container operations:
# Within Lazydocker UI:
# Start container: Press 's' on stopped container
# Stop container: Press 's' on running container
# Remove container: Press 'd' (with confirmation)
# Restart container: Press 'r'
# Execute command in container:
# Press 'e' to open exec dialog
# Type command (e.g., 'ls -la')
# Press Enter to execute
# View output in popup
# Attach to container:
# Press 'a' to attach interactive shell
# Type commands as if in container
# Ctrl+C to detach
Container sorting and filtering:
# Filter containers:
# Press '/' or Ctrl+F to open filter dialog
# Type filter pattern (matches name or ID)
# Press Enter to apply
# Press Escape to clear filter
# Example filters:
# 'prod' - Shows only containers with 'prod' in name
# 'running' - Shows only running containers
# 'exited' - Shows only stopped containers
# Sort containers:
# Press 's' for sort options
# Sort by: Name, Status, Created, Size
# Note: Filter operates on visible list
# For status-based filtering, use config
Bulk operations:
# Within containers panel:
# Stop all containers:
# 1. No direct 'stop all' button
# 2. Use command mode: Press ':' then 'docker ps -q | xargs docker stop'
# 3. Or: Select container -> s, Repeat for each
# Prune unused containers:
# Within Docker panel, Docker menu:
# 1. Press 'D' for Docker menu
# 2. Select 'Prune containers'
# 3. Confirm action
# View all containers (including exited):
# Press 'a' to toggle showing all containers
# Default: Shows only running
Image Operations
Manage Docker images through Lazydocker.
Image listing and inspection:
# Switch to Images tab (press '2')
# View available images
# Select image with arrow keys
# Press 'i' to inspect image details
# Image information shown:
# - Repository and tag
# - Image ID
# - Size
# - Created date
# - Layers
# - Environment variables
Image operations:
# Remove image: Press 'd' on selected image
# Tag image: Press 't' to open tag dialog
# Build image: Press 'b' to build from Dockerfile
# Search Docker Hub:
# Press 's' in images panel
# Type image name to search
# Select and pull
# Pull image:
# Press 'p' to open pull dialog
# Enter image name:tag
# Press Enter to pull
# View progress in popup
Prune and cleanup:
# Access Docker menu:
# Press 'D' (capital D)
# Options shown:
# - Prune containers (remove exited)
# - Prune images (remove dangling)
# - Prune volumes (remove unused)
# - Prune networks (remove unused)
# Confirm each action
# View cleanup summary
Log Viewing and Monitoring
Access and analyze container logs.
View container logs:
# From Containers panel:
# 1. Select container
# 2. Press 'l' to view logs
# 3. View real-time log stream
# Log viewer features:
# - Timestamp display: 't' toggle
# - Follow mode: 'f' toggle
# - Clear logs: 'c' (clears display, not actual logs)
# - Search: '/' to find text in logs
# - Page navigation: Page Up/Down or mouse scroll
Log filtering and search:
# Search within logs:
# Press '/' to open search
# Type search term
# Navigate matches with 'n' (next) or 'p' (previous)
# Escape to exit search
# Filter log lines:
# In log view, press 'f'
# Enter filter pattern (regex supported)
# View only matching lines
# Examples:
# 'ERROR' - Show only error lines
# 'INFO.*database' - Show INFO lines with database
Log output format:
# Customize log display:
# - Timestamps: 't' toggle on/off
# - Colors: Preserved from container output
# - Line wrapping: Handled automatically
# - Scroll position: Saved when viewing other containers
# Follow multiple containers:
# Lazydocker follows single container at a time
# Switch between containers to view their logs
# Scroll history maintained per container
Statistics and Performance
Monitor container resource usage.
View real-time statistics:
# Access Statistics tab:
# Press Tab until on Stats panel
# Or press '5'
# Metrics displayed:
# - CPU: Percentage of available CPU
# - Memory: Current and limit
# - Network I/O: Bytes sent/received
# - Block I/O: Disk read/write bytes
# Stats refresh: Auto-updates (typically 1-2 second interval)
# All running containers shown simultaneously
# Select container to focus stats
# Arrow keys navigate container list
Performance monitoring workflow:
# Monitor single container:
# 1. Go to Containers tab
# 2. Select container
# 3. Press 's' for stats detail
# 4. View focused metrics
# Monitor multiple containers:
# 1. Go to Stats tab
# 2. View all containers stats
# 3. Identify resource hogs
# 4. Take action (stop, limit, etc.)
# Track over time:
# Lazydocker shows current values
# For historical data, use docker stats --no-stream
Keybindings and Customization
Customize keybindings for efficient operation.
Default keybindings:
# Navigation:
# Tab - Switch panel
# Number (1-6) - Jump to specific panel
# Arrow keys - Navigate list items
# Page Up/Down - Scroll lists
# Operations:
# s - Start/Stop container
# r - Restart container
# d - Delete/Remove
# e - Execute command in container
# l - View logs
# i - Inspect details
# a - Attach/Detach
# Enter - Open detail view
# q - Quit current view
# / - Search/Filter
# Docker operations:
# D - Docker menu (prune, etc.)
Customizing keybindings:
# Edit configuration file:
# ~/.config/lazydocker/config.yml
# Example custom keybindings:
cat > ~/.config/lazydocker/config.yml <<'EOF'
keybinding:
universal:
quit: 'q'
return: 'z'
containers:
startAll: 'S'
stopAll: 'T'
images:
remove: 'D'
build: 'B'
EOF
# View current keybindings:
# Press '?' in Lazydocker for help
# Shows all available keybindings
Command mode (advanced):
# Press ':' to enter command mode
# Type Docker commands directly
# Examples:
# :docker ps -a
# :docker logs mycontainer
# :docker exec mycontainer bash
# Command mode output shown in overlay
# Useful for complex operations not in UI
# Escape to exit command mode
Configuration File
Configure Lazydocker behavior and appearance.
Configuration file structure:
# Edit ~/.config/lazydocker/config.yml
cat > ~/.config/lazydocker/config.yml <<'EOF'
# Lazydocker configuration
guiConfig:
theme:
activeBorderColor:
- green
- bold
inactiveBorderColor:
- white
windowBorderCorners: "rounded"
logs:
timestamps: true
follow: true
tail: 100
docker:
logLevel: 'info'
refreshUnfocusedPauseInterval: 10000
EOF
# Restart Lazydocker to apply changes
lazydocker
Environment configuration:
# Docker socket configuration:
# For non-standard socket location
export DOCKER_HOST=unix:///run/podman/podman.sock
lazydocker
# Proxy configuration:
export HTTP_PROXY=http://proxy.example.com:8080
export HTTPS_PROXY=http://proxy.example.com:8080
lazydocker
# Debug mode:
export DEBUG=true
lazydocker
Theme customization:
# Available themes:
# - default
- custom
# Color options:
# Colors: black, red, green, yellow, blue, magenta, cyan, white
# Styles: bold, underline, reverse
# Example: Custom theme
cat > ~/.config/lazydocker/config.yml <<'EOF'
guiConfig:
theme:
activeBorderColor:
- blue
- bold
inactiveBorderColor:
- gray
selectedLineBgColor:
- blue
optionsTextColor:
- yellow
windowBorderCorners: rounded
EOF
Conclusion
Lazydocker transforms Docker management from command-line-dependent workflows into intuitive visual interactions, significantly improving user experience for system administrators and DevOps engineers. The combination of container management, log viewing, statistics monitoring, and customizable keybindings creates an efficient environment for daily Docker operations. Start with basic container navigation and operations, progress to understanding statistics and performance metrics, and eventually customize keybindings and themes for your workflow. Whether managing a handful of development containers or monitoring production deployments, Lazydocker provides the visibility and control necessary for effective container management. Integrate Lazydocker into your development and operations workflows to reduce complexity and improve productivity when working with Docker containers.


