Lazy Docker: A User-Friendly CLI Tool for Docker Management (2024)

🚀

Quick Overview

If you need a lightweight alternative to Portainer, consider Lazy Docker. It’s a CLI Docker front-end that displays the list of running/stopped containers, images, volumes, and networks and allows you to check their logs, stats, env, config, and top.

However, complex operations on containers, such as attaching flags or tags, assigning ports, advanced networking configurations, and building images, cannot be done (click here to know more).

Lazy Docker: A User-Friendly CLI Tool for Docker Management (1)

Lazy Docker, a minimalist CLI tool (unlike the advanced Portainer Web UI), is highly beneficial for Docker users who primarily focus on monitoring containers, images, volumes, and networks.

It provides a more interactive and user-friendly way to interact with Docker compared to the standard command-line interface (CLI).

Lazy Docker simplifies Docker container management with a visual interface, but it’s not a substitute for the standard Docker CLI or advanced front-ends like Portainer.

In this article, you’ll discover its features along with its limitations, the installation process on Linux, and beginner-friendly usage instructions.

Tutorial Details

DescriptionLazy Docker
Difficulty LevelModerate
Root or Sudo PrivilegesYes
OS CompatibilityUbuntu, Manjaro, Fedora, etc.
Prerequisitesdocker
Internet RequiredYes (for installation)

Features and Limitations of Lazy Docker

Lazy Docker could become your preferred Docker management tool if your primary requirements align with the following:

  • Quickly view the list of running/stopped containers, images, volumes, and networks.
  • Instantly track your container’s resource utilization (CPU, memory) and view live logs through real-time monitoring.
  • Easily manage containers using Lazy Docker’s user-friendly interface for starting, stopping, restarting, and removing them.
  • Support Docker Compose for easy management of multi-container applications defined in Compose files.
  • Launch a terminal session inside a running container directly from the LazyDocker interface.
  • Provides time-saving keyboard shortcuts for Docker commands, enhancing efficiency for power users.

Despite its many features, LazyDocker has limitations and may not excel at all Docker management tasks. Here are some things it cannot do or may not perform well in:

  • It lacks robust support for orchestrating containers using Docker Swarm or Kubernetes.
  • Advanced networking setups, such as custom bridge networks with complex routing, may necessitate the use of the standard Docker CLI since they cannot be configured here.
  • It isn’t meant for creating Docker images from Dockerfiles or other sources.
  • It doesn’t provide extensive tools for managing user accounts and permissions within running containers.
  • If you rely on Docker plugins for additional functionality, such as storage or network drivers, managing those plugins would generally require the standard Docker CLI.
  • It is best suited for single-host Docker setups; for distributed or multi-host Docker environments like Docker Swarm or Kubernetes clusters, different tools and configurations are needed.

Despite these limitations, if your requirements align with the features, you can give it a try.

How to Install Lazy Docker on Linux

Lazy Docker isn’t in the Linux repository but offers straightforward installation options for Linux, macOS, and even Windows.

To begin, choose one of the preferred methods for installing it on your Linux system.

Installing Lazy Docker using Homebrew

First, confirm that you have homebrew installed on your system, and then proceed by running this command:

$ brew install jesseduffield/lazydocker/lazydocker

Installing Lazy Docker using Go

Ensure Golang is installed on your system, then run this command:

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

Installing Lazy Docker using Curl

Binary files are available on the release page for manual installation, but automation can be achieved with this command:

📝

This command is compatible with both macOS and Windows systems.

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

By default, the script downloads the binary to “$HOME/.local/bin“. To make it globally accessible, create a symbolic link in the user directory with the following command:

📝

Replace the path of the home directory with your own.

$ sudo ln -s /home/linuxtldr/.local/bin/lazydocker /usr/bin/

Installing Lazy Docker in Arch Linux

You can install lazydocker using the AUR by running:

$ yay -S lazydocker

Strip the Lazy Docker Command (optional)

Create an “lzd” alias to shorten the length of the “lazydocker” command.

📝

When users who aren’t in the Docker group try to use Docker and Lazydocker with “sudo” for their commands, this method usually fails because they relies on the Root configuration file.

#For Bash$ echo "alias lzd='lazydocker'" >> ~/.bashrc#For ZSH$ echo "alias lzd='lazydocker'" >> ~/.zshrc

Usage of Lazy Docker

Once you’ve successfully installed Lazy Docker, use this command to launch it:

$ lazydocker#OR$ lzd #If alias is created

Output:

Lazy Docker: A User-Friendly CLI Tool for Docker Management (2)

When Lazy Docker is launched, you’ll use the interface displayed in the image above.

  • Resources is a GUI-Based System Monitoring Tool for Linux

Let’s understand each section of this interface, starting with:

  1. Project will be the hostname of your Linux system (equivalent to “hostname“).
  2. Containers will list container names, running or exited status, resource utilization, and forwarded ports (equivalent to “docker ps -a“).
  3. Logs show the chosen container logs (equivalent to “docker logs {container_name}“).
  4. Stats show the live stream of container resource usage statistics in ascii graphs (equivalent to “docker stats {container_name}“).
  5. Env shows the chosen container environment variables (equivalent to “docker inspect {container_name} --format "{{.Config.Env}}“).
  6. Config displays concise container information, with an option for full details (equivalent to “docker inspect {container_name}“).
  7. Top displays the running process within the container (equivalent to “docker top {container_name}“).
  8. Images display saved Docker images in your system (equivalent to “docker images“).
  9. Volumes show container-created volumes (equivalent to “docker volume ls“).
  10. Networks show all available Docker networks (equivalent to “docker network ls“).
  11. Help section displays keyboard shortcuts for scrolling, quitting, menu navigation, and more.

Watch the following video to get an idea of how each section will appear.

If you are in the Config section of any container, you can navigate through the long list of configuration details via the navigation keys or “PgUp/PgDn” key.

To manage containers, images, volumes, and networks, press “b” for bulk editing, then select the desired action based on your needs.

Lazy Docker: A User-Friendly CLI Tool for Docker Management (3)

Pressing the “x” key displays key bindings for various actions in Lazy Docker.

Lazy Docker: A User-Friendly CLI Tool for Docker Management (4)

With this key binding, you can easily perform actions on your containers. For example, to restart a specific container, just select it and press “r“.

Lazy Docker: A User-Friendly CLI Tool for Docker Management (5)

To open a shell for a particular container, select it and press “E” to launch a shell.

📝

If the selected container lacks a valid login shell such as bash or shell, using this shortcut key may result in an error.

Lazy Docker: A User-Friendly CLI Tool for Docker Management (6)

The rest is self-explanatory; I’ll let you discover those treasures on your own.

If you encounter any problems or have questions about this article, please feel free to ask them in the comments.

Till then, peace!

Lazy Docker: A User-Friendly CLI Tool for Docker Management (2024)
Top Articles
Latest Posts
Article information

Author: Kieth Sipes

Last Updated:

Views: 6610

Rating: 4.7 / 5 (67 voted)

Reviews: 90% of readers found this page helpful

Author information

Name: Kieth Sipes

Birthday: 2001-04-14

Address: Suite 492 62479 Champlin Loop, South Catrice, MS 57271

Phone: +9663362133320

Job: District Sales Analyst

Hobby: Digital arts, Dance, Ghost hunting, Worldbuilding, Kayaking, Table tennis, 3D printing

Introduction: My name is Kieth Sipes, I am a zany, rich, courageous, powerful, faithful, jolly, excited person who loves writing and wants to share my knowledge and understanding with you.