Introduction:
Docker and Docker-compose are tools that makes it simple to deploy software in an isolated environment. But at the same time to keep track of all those running services may be time consuming. Lazydocker, a TUI app that helps you to manage and monitor all the docker containers in one place.
What is Lazydocker ?
Lazydocker gathers all the information about your docker containers and presents it neatly inside your terminal. With this you can see what’s running, check the logs, view the resource usage and inspect the environment.
You can also stop, pause, restart and carry out other operations on individual containers, or apply the actions to every running services.
Features:
You can quickly view the running/stopped containers, volumes, images and networks.
Tracks your containers resources utilization instantly such as CPU, memory and view the live logs through real time monitoring.
How to install Lazydocker on Linux
We will install using wget, here we are downloading the latest version v0.23.3 at the time of writing this blog.
wget https://github.com/jesseduffield/lazydocker/releases/download/v0.23.3/lazydocker_0.23.3_Linux_x86_64.tar.gz
Unpack the file, and you will get 3 files from the command.
tar -xvzf lazydocker_0.23.3_Linux_x86_64.tar.gz
Once you unpack the file, you will get 3 new files.
License
lazydocker
Install the lazydocker binary using the below command.
sudo install lazydocker /usr/local/bin
It wont return any output. To verify the installation run the below command.
lazydocker --version
After installation, launch lazydocker by just typing the same in terminal.
lazydocker
The lazydocker interface will appear and it will look like the below image.
It doesn’t matter where you are in the file system or where your docker images or compose file are located, lazydocker will grab information from all of them.
Vertically if we see, there five sections. Let us understand each section:
Project: It displays your hostname of the Linux system.
Containers: It displays all the containers available, running or exited in your system.
Images: It displays saved docker images in your system.
Volumes: It shows container created volumes and custom volumes.
Networks: It displays all the available docker networks.
Horizontally, there are five sections.
Logs: It shows the chosen running container logs in the pane.
Stats: It shows the live stream of the container resource usage using graphs. These are the CPU and Memory stats.
Env: It shows the chosen container environment variables.
Config: It shows full details of the container.
Top: It shows the running processes within the container.
As you select each entry from the vertical tab, the relevant information is shown on the right hand side. You can scroll through the up and down arrow keys in your keyboard and [ ] keys to navigate the right hand side labels. Also you can use your mouse to click around the interface.
Managing your Docker Container
As we do not have any docker containers running, we can spin up a container to see the app in action.
Example:
You can deploy an Nginx container with the below command:
docker run -d -p 8080:80 --name demo-nginx nginx
By default the information pane will show the logs for the selected container, but you can click any other label such as stats, env, config or top.
When you click on the Stats label, you can get the CPU and memory stats of the selected container.
Same way you can check other labels and get the information of the container on the go. With a container selected, you can press x
to bring up a menu of actions which has all the options like stop, pause, restart, open in browser etc.
If any of your docker container crashes, you can examine every detail of the container without leaving the lazydocker tool. You can also perform bulk operations to all your containers by pressing b
key.
Thus you can see how powerful is lazydocker with all of your container information in one place and managing this requires no more than a few keystrokes. It is a great tool for anyone who wants to make Docker easier to use.
Difference between Lazydocker and Docker Desktop
Lazydocker is lightweight terminal UI for managing docker container, images and volumes. Somebody who needs an easy and visual way to interact with docker and which runs directly in the terminal.
Docker Desktop is a full fledged application for managing docker, kubernetes and related tools on Windows, macOS and Linux. Somebody who needs kubernetes integration and resource configuration.
Conclusion:
Lazydocker is a user friendly command line tool for managing docker applications and services. With this you can manage and monitor all your docker application from one place.
Check out the official github page for more information. LazyDocker Github
If you found this post useful, give it a like👍
Repost♻️
Follow Bala for more such posts 💯🚀