How to Manage Your Docker Containers Easily With lazydocker (2024)

Docker and Docker Compose are easy-to-use tools that make it simple to deploy software in an isolated environment. But keeping track of the health of all your running services can be time-consuming.

lazydocker is a TUI app that helps you to manage and monitor all your Docker containers in one place.

Why Use lazydocker?

How to Manage Your Docker Containers Easily With lazydocker (1)

Docker is an essential tool if you want to run software without cluttering up your system with new packages. Each Docker app runs in a separate container and never gets to interact with other apps on your system unless you explicitly want it to.

If you don't already have it installed, you should read our guide on how to install Docker and Docker Compose on Linux.

Docker Compose makes it even easier to deploy services, and it's especially useful when self-hosting projects on a Raspberry Pi. You can define the configuration in a single YAML file and launch multiple Docker containers with a single command which will bring up the containers specified in the file.

You can see which containers are running by typing:

docker-compose ps 

...in the directory where your docker-compose.yml file is located.

As you test and deploy more software, you'll probably create multiple docker-compose.yml files in different locations around your filesystem, as well as launching and forgetting dockerized apps you fired up for a one-off purpose.

It's difficult to control or even keep track of what's running—especially if your Docker Compose files are scattered across your hard drive.

Administration can become messy, and remembering the complete range of Docker commands is a task all on its own.

lazydocker gathers all the information about your Docker containers and presents it neatly inside your terminal. You can see what's running, check the logs, view resource usage, and inspect the environments.

You can also stop, pause, restart, and carry out other operations on individual containers, or apply the actions to every running service.

How to Install lazydocker on Linux

How to Manage Your Docker Containers Easily With lazydocker (2)

While lazydocker does itself come as a dockerized image, deploying it this way currently means that you won't be able to see the logs or CPU usage graphs for your other Docker containers.

Instead, you should use the lazydocker installation script:

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

Needless to say, you should check the content of any script before piping it to Bash.

Use lazydocker to Manage Your Docker Containers

Launch lazydocker by typing:

lazydocker 

It doesn't matter where you are in the file system or where your Docker images or Docker Compose files are located—lazydocker will grab information from all of them.

How to Manage Your Docker Containers Easily With lazydocker (3)

Running vertically down the left side of the TUI, you'll see four sections. These are Services, Standalone containers, Images, and Volumes.

Within each of these sections, you can browse through the entries using the Up and Down arrow keys on your keyboard. As you highlight each entry, the relevant information is shown in the right-hand pane. Alternatively, you can use your mouse to click around the interface.

How to Manage Your Docker Containers Easily With lazydocker (4)

By default, the information pane will show the logs for whatever entry you selected, but you can click the labels at the top to show CPU and memory stats, the container environment, config entries, or top.

If a dockerized app crashes, you can examine everything about it, and about every other dockerized app without leaving lazydocker.

The aforementioned information options are only available for actual containers. If you've selected an entry in Images or Volumes, you'll only be able to see the config.

With a container highlighted, press x to bring up a menu of actions you can perform. In addition to stop, pause, and restart, you can remove containers, open them in a browser, bring containers up and down, or execute commands directly.

As well as being able to run commands from within the menu, you'll also see the relevant shortcut key for future use.

How to Manage Your Docker Containers Easily With lazydocker (5)

If you want to perform bulk actions on all of your containers, press the b key to bring up the Bulk Commands menu.

If you choose this action while in the Services section, you'll see the standard Docker Compose commands, while if you open the menu in Standalone containers, you'll have options to stop, remove, and prune containers.

In the remaining two sections, the only bulk action you'll be able to perform is to prune unused volumes and images.

lazydocker Makes Container Management on Linux Easy

With all of your container information in one place and management requiring no more than a few keystrokes, it's super simple to keep your sprawling virtual port better organized.

If you're falling out of love with Docker, consider an alternative container management system instead.

  • Linux
  • Docker
  • Linux Apps

Your changes have been saved

Email Is sent

Please verify your email address.

You’ve reached your account maximum for followed topics.

Manage Your List

Follow

Followed

Follow with Notifications

Follow

Unfollow

Readers like you help support MakeUseOf. When you make a purchase using links on our site, we may earn an affiliate commission. Read More.

How to Manage Your Docker Containers Easily With lazydocker (2024)
Top Articles
Latest Posts
Article information

Author: Francesca Jacobs Ret

Last Updated:

Views: 6612

Rating: 4.8 / 5 (68 voted)

Reviews: 91% of readers found this page helpful

Author information

Name: Francesca Jacobs Ret

Birthday: 1996-12-09

Address: Apt. 141 1406 Mitch Summit, New Teganshire, UT 82655-0699

Phone: +2296092334654

Job: Technology Architect

Hobby: Snowboarding, Scouting, Foreign language learning, Dowsing, Baton twirling, Sculpting, Cabaret

Introduction: My name is Francesca Jacobs Ret, I am a innocent, super, beautiful, charming, lucky, gentle, clever person who loves writing and wants to share my knowledge and understanding with you.