Lazy Docker Is the Easiest Way to Manage Home Lab Containers From Your Terminal

Lazy docker is the easiest way to manage home lab containers from your terminal

When you start out in the home lab managing containers, this always starts out fairly simple when you have one or two containers. You might even introduce a reverse proxy and a database at some point. However, after you add more and more services and build out things like a media stack, monitoring platform, Git repo, and other apps, you can suddenly have dozens of containers. In addition, you will have dozens of networks, volumes, and log files to keep up with. The Docker CLI can do anything you need, but it is often difficult to manage this way as your environment grows. Lazy Docker helps solve this problem. Let’s see how Lazy Docker can help you in the home lab and what features it includes.

What is Lazy Docker?

Lazy Docker was created by Jesse Duffield, the same developer behind the LazyGit tool. It has a similar mindset of being fast and helpful while at the same time easy to navigate using just a keyboard. It is a terminal UI for Docker and Docker Compose. So, instead of you having to type multiple commands to view logs, check resources, inspect your containers, or have your containers restarted, Lazy Docker gives you this in a single screen.

If you have used something like htop or btop in the past, it has a very similar feel to those tools, but it is specific to Docker environments. You probably won’t completely replace your docker CLI with this tool, but I think it is a great companion app to go along with what you can do from the command line.

You can check out the official project repo here: jesseduffield/lazydocker.

Why home labbers really like Lazy Docker

Lazy Docker feels like the type of project that you would want to make use of in the home lab. In the home lab, most of us run a mix of containers that give you essential services. These can include some or all of the following:

  • Nginx Proxy Manager or Traefik as a reverse proxy
  • Prometheus, Grafana, Netdata, or Dozzle to monitor the environment
  • Automation tools and now AI tools
  • Plex, Jellyfin, or Emby for media
  • Gitea or GitLab for self-hosting your own Git server
  • Postgres or MariaDB for databases
  • Tailscale or WireGuard for VPN
  • Portainer or Komodo as GUI container manager tools

Each of these services may include multiple containers, docker compose files, volumes, networks, and many other resources related to the stacks. You CAN manage all of this with Docker CLI, but it can definitely become tedious. Having a more GUI-type tool for your Docker environment is way better when you need to monitor a large number of containers.

Note the following features of Lazy Docker and what it allows you to do.

What Lazy Docker Helps You DoDescription
See running containersQuickly view all active containers in one dashboard
Monitor container resource usageCheck CPU, memory, disk, and network usage at a glance
Tail logs instantlyView real time logs for any container without using CLI commands
Start, stop, or restart containersManage container lifecycle actions with simple key commands
See Docker stacksSee which containers are in the same stacks and troubleshoot from the perspective of the stack
See issues visuallySee errors or performance problems through an interactive UI
See real time statisticsTrack performance metrics in real-time from within your terminal
Troubleshoot fasterCombine logs, stats, and config views to troubleshoot everything in one place

If you regularly SSH into your Docker container hosts in the home lab and run Docker CLI commands to find this kind of information, this tool can make this much easier.

Installing Lazy Docker

Lazy Docker is very easy to install. There are several methods, but the simplest is the official install script:

curl https://raw.githubusercontent.com/jesseduffield/lazydocker/master/scripts/install_update_linux.sh | bash
Curling down the install.sh script
Curling down the install.sh script

Then, if you don’t want to update your PATH, you can do the following to move it to the /usr/local/bin directory:

sudo mv /home/linuxadmin/.local/bin/lazydocker /usr/local/bin/

sudo chmod +x /usr/local/bin/lazydocker
Moving the executable to the user local bin directory
Moving the executable to the user local bin directory

To update Lazy Docker, run the same command again.

If you want to use Homebrew, you can install it with:

brew install lazydocker

Or if you have Go installed:

go install github.com/jesseduffield/lazydocker@latest

Once installed, launch it by running:

lazydocker

You are immediately taken into the interactive dashboard.

What You See When Lazy Docker Opens

Lazy Docker displays several panels that work together to give you a full view of your system.

Containers Panel

The containers panel looks like the below. As you can see, it displays a really nice view of your running containers. The thing i like as well is that it is context aware. So, if you launch this in a global folder, it will show you all your containers. But if you launch it inside a single Docker compose folder, it will show you the information in the context of that folder.

Containers panel
Containers panel

This is the main panel that shows all containers running on your system. You can see the following information:

  • Container name
  • CPU usage – this is a real-time ticker that shows you the CPU usage
  • Memory usage
  • Health status – green for healthy, red if something is wrong
  • Restart count
  • Container uptime

When you highlight a container, you can quickly open:

  • The logs panel
  • The stats panel
  • The environment variable view
  • The configuration view
  • Top – to see the top processes

As a side note. To switch between the menu items in the (Logs Stats Env Config Top) screen, you need to use the left and right brackets button on your keyboard by default.

Services Panel

If you use Docker Compose and you launch LazyDocker from the directory with your docker compose file, it will show services rather than just the containers. This is useful for understanding which containers belong to each service.

Showing services in lazydocker
Showing services in lazydocker

You can even view the docker compose from the Lazy Docker tool. This is great as you don’t have to leave the tool to look at your compose code.

Viewing the docker compose of your service
Viewing the docker compose of your service

Stacks Panel

Lazy Docker automatically detects all Docker Compose files and presents them as stacks. You can interact with an entire stack or drill down into specific services. This is helpful for:

  • Restarting a stack
  • Viewing stack level logs
  • Rebuilding services after modifying YAML files

It makes Compose based deployments much more intuitive.

Logs Panel

One of the most useful features in Lazydocker is the log viewer. Instead of running docker logs over and over, Lazy Docker tails logs in real time. You can scroll through logs and jump to the bottom. Then you can switch between containers as you need.

Viewing logs in lazydocker
Viewing logs in lazydocker

Stats Panel

Lazy Docker shows live metrics for your containers running on your Docker host. These states include things like:

  • CPU load
  • Memory usage
  • Network throughput
  • Disk I/O

Below, you can see the Stats view of the specific container you have focused in on.

Logs stats env config and top panels
Logs stats env config and top panels

This is really useful if you are troubleshooting performance or your host is maxed out on system resources and you need to understand why.

Customizing Lazy Docker

One of the really cool things about LazyDocker is that it includes optional customization for the tool. You can modify key bindings, color themes, and command behavior.

Create a configuration directory:

mkdir -p ~/.config/lazydocker

Then create a config file:

~/.config/lazydocker/config.yml

You can also create this file easily while you are inside Lazy Docker by being in the project pane and typing “x” on the keyboard to launch the global menu. You will see this:

Editing lazydocker config file
Editing lazydocker config file

Inside, you can configure custom colors, Docker Compose paths, or even swap Docker out for Podman. This allows you the opportunity to tweak and tune it exactly for your specific environment and needs.

Lazy Docker With Podman

Speaking of Podman, Lazy Docker now supports Podman, which is useful for users of Red Hat based systems or rootless containers. To tell Lazy Docker to use Podman, you need to update your config file for Lazy Docker with:

commandTemplates:
  docker: podman
  dockerCompose: podman-compose

As a note, Lazy Docker works in nearly the same way with Podman as it does with Docker.

Lazy Docker vs Docker CLI vs Portainer vs Komodo

I know many out there might be wondering. Should I use this vs Docker CLI vs something like Portainer? Well, I don’t think Lazy Docker completely replaces the Docker CLI, especially for scripting and other things having to do with automation. Also, GUI tools like Portainer and Komodo are great tools.

Keep in mind that Portainer is not free once you get past 3 container hosts. You can do a home lab/student license with them, but this price has increased this year compared to last year. Komodo keeps getting better as well. It I would say is probably the most appealing option out of all the solutions that are free and open-source to use for managing your containerized environments.

Lazy Docker I think is in a type of middle ground here. It gives you an interactive view in the terminal that is much faster than having to memorize all the relevant Docker CLI commands, and probably easier for most to understand. It isn’t a full management solution like Portainer or Komodo and it doesn’t claim to be that.

Many users, including myself, run all three tools side by side. Lazy Docker often is the quick and easy daily driver for quick checks, log viewing, and restarts.

Wrapping up

I really think Lazy Docker is one of the coolest little tools that you can use for managing your Docker environment in your home lab. It is really efficient and works to give you a quick understanding of what is going on with your container environment. If you are running Docker and have more than around 5 containers, Lazy Docker is almost a sure thing to improve your workflow in managing things. It also helps with quick and easy troubleshooting, including viewing logs, restarting containers, reviewing docker compose, etc. Let me know in the comments. Have you tried out Lazy Docker?

About The Author

Brandon Lee

Brandon Lee

Brandon Lee is the Senior Writer, Engineer and owner at Virtualizationhowto.com, and a 7-time VMware vExpert, with over two decades of experience in Information Technology. Having worked for numerous Fortune 500 companies as well as in various industries, He has extensive experience in various IT segments and is a strong advocate for open source technologies. Brandon holds many industry certifications, loves the outdoors and spending time with family. Also, he goes through the effort of testing and troubleshooting issues, so you don't have to.

0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments