Skip to content

lazydocker

lazydocker is a terminal UI for Docker, providing a visual interface for managing containers, images, volumes, and networks.

Installation

macOS (Homebrew)

brew install lazydocker

Linux

# Download binary
curl https://raw.githubusercontent.com/jesseduffield/lazydocker/master/scripts/install_update_linux.sh | bash

# Or via package managers
# Arch Linux
pacman -S lazydocker

# Via Go
go install github.com/jesseduffield/lazydocker@latest

Verify Installation

lazydocker --version

Basic Usage

Launch

lazydocker

# Short alias
lzd

Interface Layout

+------------------+----------------------------------+
|    Containers    |           Main Panel             |
|       (1)        |    (Logs/Stats/Config/Top)       |
+------------------+                                  |
|     Images       |                                  |
|       (2)        |                                  |
+------------------+                                  |
|     Volumes      |                                  |
|       (3)        |                                  |
+------------------+                                  |
|    Networks      |                                  |
|       (4)        |                                  |
+------------------+----------------------------------+
Key Action
H / L Switch panels
J / K Move up/down
Enter Focus main panel
Esc Return to list
[ / ] Scroll main panel
? Show keybindings

Containers

Container List

The containers panel shows all containers with status indicators:

  • Green: Running
  • Yellow: Paused
  • Red: Stopped/Exited
  • Gray: Created

Container Actions

Key Action
D Stop container
S Start/stop toggle
R Restart
A Attach to container
Shift+D Remove container
E Exec shell in container
Shift+E Exec custom command
L View logs
C Run docker-compose
Enter View details

View Logs

  1. Select container
  2. Press L or view in main panel
  3. Use [ / ] to scroll

Log options in main panel:

Key Action
Ctrl+F Follow logs
Ctrl+S Search logs
T Toggle timestamps
W Wrap lines

Container Shell

  1. Select container
  2. Press E for shell access
  3. Press Ctrl+D or ++exit++ to return

Container Stats

Select container and view in main panel:

  • CPU usage
  • Memory usage
  • Network I/O
  • Block I/O

Toggle views with 1 - 4 when container selected.

Images

Image Actions

Key Action
D Delete image
Shift+D Force delete
Enter View layers
B Build from Dockerfile
P Push to registry
F Filter images

Prune Images

Press P in images panel for prune options:

  • Prune dangling images
  • Prune all unused images

Volumes

Volume Actions

Key Action
D Delete volume
Enter View details
P Prune unused volumes

Volume Info

View in main panel:

  • Mount point
  • Size
  • Created date
  • Associated containers

Networks

Network Actions

Key Action
D Delete network
Enter View details
P Prune unused networks

Network Info

  • Subnet/Gateway
  • Connected containers
  • Driver type

Docker Compose

Running Compose Commands

  1. Press M for menu
  2. Select compose action

Or use direct keys:

Key Action
U Compose up
Shift+U Compose up --build
Shift+D Compose down
R Compose restart

Project View

lazydocker automatically detects docker-compose projects and groups containers.

Main Panel Views

Toggle with number keys when container selected:

Key View
1 Logs
2 Stats
3 Config (inspect)
4 Top (processes)

Configuration

Config File Location

~/.config/lazydocker/config.yml

Example Configuration

gui:
  scrollHeight: 2
  theme:
    activeBorderColor:
      - green
      - bold
    inactiveBorderColor:
      - white
  returnImmediately: false
  showAllContainers: true

logs:
  timestamps: false
  since: '60m'
  tail: 200

commandTemplates:
  dockerCompose: docker compose
  restartService: '{{ .DockerCompose }} restart {{ .Service.Name }}'

oS:
  openCommand: open {{filename}}
  openLinkCommand: open {{link}}

stats:
  graphs:
    - caption: CPU (%)
      statPath: DerivedStats.CPUPercentage
      color: cyan
    - caption: Memory (%)
      statPath: DerivedStats.MemoryPercentage
      color: green

Custom Commands

customCommands:
  containers:
    - name: "View container IP"
      attach: false
      command: "docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' {{ .Container.ID }}"

    - name: "Export logs"
      attach: false
      command: "docker logs {{ .Container.ID }} > /tmp/{{ .Container.Name }}.log 2>&1"

  images:
    - name: "Scan for vulnerabilities"
      command: "docker scout cves {{ .Image.ID }}"

Bulk Operations

Select Multiple Items

Key Action
Space Toggle selection
Ctrl+A Select all
D Delete selected

Prune All

Press Shift+P for system prune options.

Search and Filter

Key Action
/ Start filter
Esc Clear filter

Filter syntax:

# Filter by name
nginx

# Filter by status
status:running
status:exited

# Filter by label
label:env=prod

Keybinding Reference

Global

Key Action
? Help
X Menu
M Docker menu
Q Quit
Esc Cancel/back

Containers

Key Action
S Stop/start
D Stop
R Restart
E Exec shell
A Attach
L Logs
Shift+D Remove
B Bulk actions

All Panels

Key Action
D Delete
P Prune
F Filter
Enter Details

Common Workflows

Quick Container Management

  1. Launch: lazydocker
  2. Navigate to container: J / K
  3. View logs: 1 or L
  4. Shell access: E

Clean Up Resources

  1. Press M for menu
  2. Select "Prune containers"
  3. Or use P in volumes/images for specific cleanup

Monitor Container

  1. Select container
  2. Press 2 for stats
  3. Watch CPU/memory in real-time

Troubleshoot Container

  1. Select container
  2. View logs: 1
  3. Search logs: Ctrl+S
  4. Check config: 3
  5. Shell in: E

Editor Integration

Neovim

-- Custom keymap for lazydocker
vim.keymap.set("n", "<leader>D", function()
  require("toggleterm").exec("lazydocker")
end, { desc = "lazydocker" })

VS Code Task

{
  "label": "lazydocker",
  "type": "shell",
  "command": "lazydocker",
  "presentation": {
    "reveal": "always",
    "panel": "dedicated"
  }
}
alias lzd='lazydocker'
alias ld='lazydocker'

Troubleshooting

Permission Denied

Ensure user is in docker group:

sudo usermod -aG docker $USER
# Log out and back in

Docker Socket

If using custom socket:

DOCKER_HOST=unix:///var/run/docker.sock lazydocker

Reset Config

rm ~/.config/lazydocker/config.yml

Update

brew upgrade lazydocker