How to Install and Use Lazydocker in Linux Terminal to Manage Docker Containers

Administering Docker containers, images, volumes, and networks on Linux servers typically requires juggling repetitive command-line invocations like docker ps, docker logs -f, docker exec -it, and docker system prune. While web-based container management platforms exist, they introduce unnecessary overhead, external port exposures, and security surface area on production servers. lazydocker is a terminal user interface (TUI) written in Go that provides a complete, keyboard-driven dashboard to inspect and manage Docker environments with zero web overhead.

Core Advantages of Lazydocker

Developed with developer ergonomics in mind, lazydocker streamlines container maintenance directly in your shell:

  • Live Multi-Container Monitoring: Displays real-time CPU and memory graphs for individual running containers alongside aggregated container lists.
  • Interactive Log Streaming: Automatically attaches and tails container stdout/stderr logs with full text search and colour formatting.
  • Single-Key Actions: Start, stop, restart, pause, or remove containers, images, and volumes using single keyboard presses.
  • In-Terminal Container Shell: Press a single key to attach directly to an interactive bash/sh shell inside any running container without remembering container IDs.
  • Volume and Image Pruning: Visualises dangling images and unused persistent volumes, allowing you to reclaim gigabytes of disk space with an interactive confirmation prompt.

Installing Lazydocker on Linux

You can install lazydocker through several convenient methods:

  • Automated Installation Script:
    curl https://raw.githubusercontent.com/jesseduffield/lazydocker/master/scripts/install_update.sh | bash
    This script downloads the correct pre-compiled binary for your CPU architecture (x86_64 or ARM64) and places it into ~/.local/bin/lazydocker.
  • Arch Linux and Manjaro:
    sudo pacman -S lazydocker
  • Homebrew on Linux:
    brew install lazydocker
  • Run via Docker Itself: If you prefer not to install local binaries, run lazydocker directly inside a temporary container bound to the local Docker socket:
    docker run --rm -it -v /var/run/docker.sock:/var/run/docker.sock -v ~/.config/lazydocker:/.config/jesseduffield/lazydocker lazyteam/lazydocker

Launching and Navigating the Lazydocker Dashboard

To start the application, open your terminal and run:

lazydocker

The interface divides into distinct panels on the left-hand column and a large dynamic inspection viewport on the right:

  1. Project Panel: Summarises Docker daemon status, total containers, images, and cumulative CPU/memory consumption.
  2. Containers: Lists running, stopped, and restarting containers.
  3. Services: If a docker-compose.yml file is present in your working directory, manages multi-container compose services together.
  4. Images: Displays local Docker images, tags, and disk footprints.
  5. Volumes: Lists all persistent storage volumes.

Use the [ and ] bracket keys or numbers 1 through 5 to cycle between panels, and use arrow keys (or Vim-keys j/k) to move up and down.

Essential Keyboard Shortcuts for Container Management

Handling day-to-day Docker operations inside lazydocker takes only seconds:

  • Inspect Logs: Highlight a container and press Enter to focus the real-time log stream. Press / to search within logs.
  • Stop / Restart: Press s to stop an active container; press r to trigger an immediate restart.
  • Attach to Shell: Press e to open an interactive bash/sh shell inside the selected container immediately.
  • Remove Container: Press d to delete a container.
  • Prune Unused Data: In the Project panel, press m to open the maintenance menu and select Prune containers or Prune volumes to reclaim disk space.
  • Quit: Press q to exit the interface cleanly.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.