Overview
Lazydocker is a terminal-based user interface for managing Docker containers and Docker Compose stacks. It provides a visual dashboard for monitoring containers, images, volumes, and networks without needing to remember complex Docker CLI commands. Everything is accessible through keyboard-driven navigation with real-time updates.
Lazydocker displays container status, resource usage (CPU, memory), logs, environment variables, and configuration in a single terminal window. It supports common operations like starting, stopping, restarting, removing containers and images, attaching to shells, and viewing real-time log streams. It works with both standalone Docker containers and Docker Compose projects.
Installation
# macOS via Homebrew
brew install lazydocker
# Linux / macOS via Go
go install github.com/jesseduffield/lazydocker@latest
# Linux one-liner script
curl https://raw.githubusercontent.com/jesseduffield/lazydocker/master/scripts/install_update_linux.sh | bash
# Arch Linux
sudo pacman -S lazydocker
# Nixpkgs
nix-env -iA nixpkgs.lazydocker
# Scoop (Windows)
scoop install lazydocker
# Chocolatey (Windows)
choco install lazydocker
# Docker (run lazydocker itself in Docker)
docker run --rm -it \
-v /var/run/docker.sock:/var/run/docker.sock \
-v ~/.config/lazydocker:/.config/jesseduffield/lazydocker \
lazyteam/lazydocker
Quick Start
# Launch lazydocker
lazydocker
# Launch with a specific Docker Compose file
COMPOSE_FILE=docker-compose.prod.yml lazydocker
# Launch with a specific Docker context
DOCKER_CONTEXT=remote lazydocker
Interface Layout
┌────────────────────────────────────────────────┐
│ Lazydocker │
├──────────┬─────────────────────────────────────┤
│ Left │ Main Panel │
│ Panel │ │
│ │ Shows details for selected item: │
│ Projects │ - Logs │
│ Containers│ - Stats (CPU/Memory) │
│ Images │ - Config/Environment │
│ Volumes │ - Top (running processes) │
│ Networks │ │
│ │ │
└──────────┴─────────────────────────────────────┘
Navigation
Global Keys
| Key | Action |
|---|
[ / ] | Switch between left panel sections |
Tab | Switch between left and main panels |
j / k | Move down / up in lists |
h / l | Move left / right between panels |
Enter | Focus / select item |
q | Quit lazydocker |
x | Open command menu for selected item |
? | Show help / keybindings |
/ | Filter items in current list |
Escape | Cancel / go back |
+ | Next Docker Compose project |
- | Previous Docker Compose project |
Container Panel
| Key | Action |
|---|
d | Stop container |
s | Start/restart container |
r | Restart container |
a | Attach to container shell |
m | View logs |
E | Open shell in container |
D | Remove container |
S | Stop container |
U | Start container |
R | Rebuild and recreate (Compose) |
b | View bulk commands |
c | Run custom command |
Image Panel
| Key | Action |
|---|
d | Remove image |
D | Remove image (force) |
p | Prune unused images |
Volume Panel
| Key | Action |
|---|
d | Remove volume |
p | Prune unused volumes |
Network Panel
| Key | Action |
|---|
d | Remove network |
p | Prune unused networks |
Main Panel Tabs
When a container is selected, the main panel shows multiple tabs:
| Tab | Content |
|---|
| Logs | Real-time container log stream |
| Stats | CPU, memory, network I/O, disk I/O |
| Config | Container configuration and environment |
| Top | Running processes inside the container |
Log Navigation
| Key | Action |
|---|
j / k | Scroll down / up |
G | Jump to bottom (latest) |
g | Jump to top (oldest) |
Ctrl+D | Page down |
Ctrl+U | Page up |
/ | Search in logs |
n | Next search match |
N | Previous search match |
f | Toggle follow mode |
w | Toggle line wrap |
t | Toggle timestamps |
s | Toggle since filter |
Configuration
Config File Location
# Linux
~/.config/lazydocker/config.yml
# macOS
~/Library/Application Support/lazydocker/config.yml
# Windows
%APPDATA%/lazydocker/config.yml
config.yml
gui:
# Show all containers or just running
showAllContainers: true
# Scroll speed
scrollHeight: 2
# Language
language: 'auto'
# Theme (can be customized)
theme:
activeBorderColor:
- green
- bold
inactiveBorderColor:
- white
selectedLineBgColor:
- blue
# Return to container after executing command
returnImmediately: false
# Wrap main panel content
wrapMainPanel: true
logs:
# Timestamps in logs
timestamps: false
# Number of log lines to show
since: '60m'
# Tail last N lines
tail: ''
commandTemplates:
# Docker top command
dockerCompose: "docker compose"
# Stop all containers
stopAll: "docker stop $(docker ps -q)"
# Remove all stopped containers
pruneContainers: "docker container prune -f"
# Custom commands available via 'c' key
customCommands:
containers:
- name: "View full logs"
attach: false
command: "docker logs -f {{ .Container.ID }}"
serviceNames: []
- name: "Shell into container"
attach: true
command: "docker exec -it {{ .Container.ID }} /bin/sh"
serviceNames: []
- name: "View environment"
attach: false
command: "docker inspect --format='{{range .Config.Env}}{{println .}}{{end}}' {{ .Container.ID }}"
serviceNames: []
images:
- name: "Show image history"
command: "docker history {{ .Image.ID }}"
attach: false
volumes:
- name: "Show volume details"
command: "docker volume inspect {{ .Volume.Name }}"
attach: false
Custom Commands
Custom commands use Go templates with access to the selected resource.
Available Template Variables
| Context | Variables |
|---|
| Container | .Container.ID, .Container.Name, .Container.Image |
| Image | .Image.ID, .Image.Repository, .Image.Tag |
| Volume | .Volume.Name, .Volume.Driver |
| Network | .Network.Name, .Network.ID |
| Service | .Service.Name (Docker Compose) |
Example Custom Commands
customCommands:
containers:
- name: "Copy file from container"
command: "docker cp {{ .Container.ID }}:/path/in/container ./local/path"
attach: false
- name: "Export container"
command: "docker export {{ .Container.ID }} > {{ .Container.Name }}.tar"
attach: false
- name: "View resource usage"
command: "docker stats {{ .Container.ID }} --no-stream"
attach: false
- name: "Inspect container"
command: "docker inspect {{ .Container.ID }} | less"
attach: true
Docker Compose Integration
Lazydocker automatically detects Docker Compose projects and provides additional operations:
| Feature | Description |
|---|
| Service grouping | Containers grouped by Compose service |
| Rebuild | Rebuild and recreate services (R key) |
| Up/Down | Start or stop entire Compose project |
| Logs | View logs for specific service or all |
| Project switching | Switch between Compose projects with +/- |
Advanced Usage
Aliases
# Add to ~/.bashrc or ~/.zshrc
alias lzd='lazydocker'
# Launch for specific Compose project
alias lzd-prod='COMPOSE_FILE=docker-compose.prod.yml lazydocker'
Remote Docker Hosts
# Use Docker context
docker context create remote --docker "host=ssh://user@remote-host"
DOCKER_CONTEXT=remote lazydocker
# Or use DOCKER_HOST environment variable
DOCKER_HOST=ssh://user@remote-host lazydocker
DOCKER_HOST=tcp://remote-host:2376 lazydocker
Filtering
Press / in any list panel to filter items. The filter supports substring matching:
# Filter containers by name
/web
# Filter images
/nginx
# Clear filter
Press Escape
Troubleshooting
| Issue | Solution |
|---|
| Cannot connect to Docker | Ensure Docker daemon is running; check socket permissions |
| Permission denied | Add user to docker group: sudo usermod -aG docker $USER |
| No containers showing | Check showAllContainers config; ensure Docker is running |
| Slow performance | Reduce log history with since config; limit tail lines |
| Custom commands not appearing | Check config.yml syntax; restart lazydocker |
| Key bindings not working | Check for terminal key mapping conflicts |
| Compose services not detected | Run lazydocker from the Compose project directory |
| Remote Docker not connecting | Verify Docker context or DOCKER_HOST is correct |