Top Related Projects
simple terminal UI for git commands
A tool for exploring each layer in a docker image
Top-like interface for container metrics
dry - A Docker manager for the terminal @
Immersive terminal interface for managing docker containers and services
Glances an Eye on your system. A top/htop alternative for GNU/Linux, BSD, Mac OS and Windows operating systems.
Quick Overview
Lazydocker is a terminal UI for Docker and Docker Compose, built with the gocui library. It provides an intuitive interface for managing Docker containers, images, volumes, and networks, allowing users to easily monitor and interact with their Docker environment without memorizing complex command-line instructions.
Pros
- User-friendly interface for managing Docker resources
- Reduces the need to remember complex Docker commands
- Provides real-time monitoring of container logs and resource usage
- Supports Docker Compose for managing multi-container applications
Cons
- May have a learning curve for users unfamiliar with terminal-based UIs
- Limited customization options compared to command-line Docker
- Requires installation and setup, unlike native Docker CLI
- May not support all advanced Docker features or edge cases
Getting Started
To install Lazydocker, you can use one of the following methods:
- Using Homebrew (macOS and Linux):
brew install jesseduffield/lazydocker/lazydocker
- Using Scoop (Windows):
scoop bucket add extras
scoop install lazydocker
- Manual installation:
- Download the latest release from the GitHub releases page
- Extract the archive and move the
lazydocker
binary to a directory in your PATH
To run Lazydocker, simply open a terminal and type:
lazydocker
Once launched, you can navigate the interface using keyboard shortcuts. Press ?
to view the keybindings and available commands.
Competitor Comparisons
simple terminal UI for git commands
Pros of Lazygit
- More comprehensive Git functionality, including branch management, rebasing, and stashing
- Wider adoption and larger community, leading to more frequent updates and bug fixes
- Better suited for complex Git workflows and larger projects
Cons of Lazygit
- Steeper learning curve due to more advanced Git features
- Less intuitive for users primarily focused on basic Git operations
- May feel overwhelming for beginners or those who prefer simpler interfaces
Code Comparison
Lazygit configuration example:
gui:
theme:
activeBorderColor:
- green
- bold
inactiveBorderColor:
- white
Lazydocker configuration example:
gui:
scrollHeight: 2
scrollPastBottom: true
mouseEvents: true
skipDisclaimer: false
Both projects use similar configuration structures, but Lazygit focuses on Git-specific settings, while Lazydocker tailors its options for Docker management.
Summary
Lazygit is a powerful Git TUI that offers extensive Git functionality, making it ideal for advanced users and complex projects. Lazydocker, on the other hand, is specifically designed for Docker management, providing a simpler interface for container-related tasks. While both tools share similar design principles, they cater to different aspects of development workflows.
A tool for exploring each layer in a docker image
Pros of dive
- Focused specifically on analyzing Docker image layers
- Provides detailed information about image size and efficiency
- Offers suggestions for optimizing Docker images
Cons of dive
- Limited to image analysis, lacks broader Docker management features
- Command-line interface may be less intuitive for some users
- Doesn't provide real-time monitoring of running containers
Code comparison
dive:
dive <image-name>
lazydocker:
lazydocker
Key differences
dive is a specialized tool for Docker image analysis, while lazydocker is a more comprehensive Docker management interface. dive excels at providing detailed information about image layers and optimization opportunities, making it valuable for developers focused on image efficiency. lazydocker, on the other hand, offers a broader range of features for managing Docker containers, images, and volumes through a user-friendly terminal UI.
dive is ideal for users who need in-depth image analysis, while lazydocker is better suited for those seeking an all-in-one Docker management solution. The choice between the two depends on the specific needs of the user and their Docker workflow.
Top-like interface for container metrics
Pros of ctop
- Lightweight and focused solely on container monitoring
- Provides real-time CPU and memory usage graphs
- Supports both Docker and runC containers
Cons of ctop
- Limited to container monitoring, lacks broader Docker management features
- No built-in log viewing or container management capabilities
- Less intuitive interface for users new to container management
Code Comparison
ctop:
func (cm *ContainerMetrics) CPUUtil() float64 {
return round((cm.cur.CPU.Usage - cm.prev.CPU.Usage) / float64(cm.cur.CPU.System-cm.prev.CPU.System) * 100)
}
lazydocker:
func (c *Container) GetDisplayStrings() []string {
return []string{
c.Name,
c.ContainerInfo.State.Status,
c.ContainerInfo.Config.Image,
c.GetCPUPercentage(),
c.GetMemoryPercentage(),
}
}
Summary
ctop is a lightweight, focused tool for monitoring container resources, while lazydocker offers a more comprehensive Docker management interface. ctop excels in providing real-time resource usage graphs but lacks broader management features. lazydocker, on the other hand, offers a more intuitive interface with built-in log viewing and container management capabilities, making it more suitable for users who need a full-featured Docker management tool.
dry - A Docker manager for the terminal @
Pros of dry
- Lighter and more focused on Docker-specific operations
- Supports Docker Swarm mode out of the box
- Offers a more compact UI layout, potentially better for smaller screens
Cons of dry
- Less feature-rich compared to lazydocker
- Limited support for Docker Compose
- Less active development and community support
Code Comparison
dry:
func (v *ContainerDetailsWidget) updateHeader() {
v.header.Clear()
v.header.AddText("Container: "+v.container.Names[0], true, tview.AlignLeft, tcell.ColorWhite)
}
lazydocker:
func (gui *Gui) renderContainerDetails(container *types.Container) error {
return gui.renderString(gui.Views.ContainerDetails, gui.containerDetailsString(container))
}
Both projects use Go and focus on rendering Docker-related information. dry appears to use a more widget-based approach, while lazydocker seems to have a more centralized rendering system.
lazydocker offers a broader range of features, including better integration with Docker Compose and a more user-friendly interface. It also has more active development and a larger community. However, dry excels in its lightweight nature and specific focus on Docker operations, making it potentially more suitable for users who primarily work with Docker containers and Swarm mode.
Immersive terminal interface for managing docker containers and services
Pros of Dockly
- Lightweight and easy to install via npm
- Provides a clean, minimalist interface for monitoring Docker containers
- Offers real-time resource usage statistics for containers
Cons of Dockly
- Limited functionality compared to Lazydocker
- Less intuitive navigation and control options
- Fewer advanced features for managing Docker images and networks
Code Comparison
Dockly (JavaScript):
const blessed = require('blessed')
const contrib = require('blessed-contrib')
const dockerUtil = require('./src/dockerUtil')
const screen = blessed.screen()
const grid = new contrib.grid({rows: 12, cols: 12, screen: screen})
Lazydocker (Go):
package main
import (
"github.com/jesseduffield/gocui"
"github.com/jesseduffield/lazydocker/pkg/app"
"github.com/jesseduffield/lazydocker/pkg/config"
)
Both projects use terminal-based user interfaces, but Lazydocker is written in Go, while Dockly is written in JavaScript. Lazydocker offers a more comprehensive set of features and a more intuitive interface for managing Docker containers, images, and networks. Dockly, on the other hand, provides a simpler, more focused approach to monitoring Docker containers with real-time resource usage statistics.
Glances an Eye on your system. A top/htop alternative for GNU/Linux, BSD, Mac OS and Windows operating systems.
Pros of Glances
- Broader system monitoring capabilities, covering CPU, memory, network, and more
- Cross-platform support (Linux, macOS, Windows)
- Extensible plugin system for custom metrics
Cons of Glances
- Less focused on Docker-specific monitoring
- May require more setup for Docker-centric use cases
- Command-line interface might be less intuitive for some users
Code Comparison
Glances (Python):
from glances_api import Glances
glances = Glances()
cpu_percent = glances.getCpu()
print(f"CPU Usage: {cpu_percent}%")
Lazydocker (Go):
package main
import (
"github.com/jesseduffield/lazydocker/pkg/commands"
)
func main() {
app := commands.NewApp()
app.Run()
}
Summary
Glances is a comprehensive system monitoring tool with broad capabilities, while Lazydocker focuses specifically on Docker container management. Glances offers cross-platform support and extensibility, but may require more setup for Docker-centric use cases. Lazydocker provides a more intuitive interface for Docker management but has a narrower focus. The code examples highlight the different approaches: Glances uses a Python API for system metrics, while Lazydocker is built in Go and centered around Docker operations.
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
A simple terminal UI for both docker and docker-compose, written in Go with the gocui library.
Sponsors
Maintenance of this project is made possible by all the contributors and sponsors. If you'd like to sponsor this project and have your avatar or company logo appear below click here. ð
Elevator Pitch
Minor rant incoming: Something's not working? Maybe a service is down. docker-compose ps
. Yep, it's that microservice that's still buggy. No issue, I'll just restart it: docker-compose restart
. Okay now let's try again. Oh wait the issue is still there. Hmm. docker-compose ps
. Right so the service must have just stopped immediately after starting. I probably would have known that if I was reading the log stream, but there is a lot of clutter in there from other services. I could get the logs for just that one service with docker compose logs --follow myservice
but that dies everytime the service dies so I'd need to run that command every time I restart the service. I could alternatively run docker-compose up myservice
and in that terminal window if the service is down I could just up
it again, but now I've got one service hogging a terminal window even after I no longer care about its logs. I guess when I want to reclaim the terminal realestate I can do ctrl+P,Q
, but... wait, that's not working for some reason. Should I use ctrl+C instead? I can't remember if that closes the foreground process or kills the actual service.
What a headache!
Memorising docker commands is hard. Memorising aliases is slightly less hard. Keeping track of your containers across multiple terminal windows is near impossible. What if you had all the information you needed in one terminal window with every common command living one keypress away (and the ability to add custom commands as well). Lazydocker's goal is to make that dream a reality.
- Requirements
- Installation
- Usage
- Keybindings
- Cool Features
- Contributing
- Video Tutorial
- Config Docs
- Twitch Stream
- FAQ
Requirements
- Docker >= 1.13 (API >= 1.25)
- Docker-Compose >= 1.23.2 (optional)
Installation
Homebrew
Normally lazydocker
formula can be found in the Homebrew core but we suggest you to tap our formula to get frequently updated one. It works with Linux, too.
Tap:
brew install jesseduffield/lazydocker/lazydocker
Core:
brew install lazydocker
Scoop (Windows)
You can install lazydocker
using scoop:
scoop install lazydocker
Chocolatey (Windows)
You can install lazydocker
using Chocolatey:
choco install lazydocker
asdf-vm
You can install asdf-lazydocker plugin using asdf-vm:
Setup (Once)
asdf plugin add lazydocker https://github.com/comdotlinux/asdf-lazydocker.git
For Install / Upgrade
asdf list all lazydocker
asdf install lazydocker latest
asdf global lazydocker latest
Binary Release (Linux/OSX/Windows)
You can manually download a binary release from the release page.
Automated install/update, don't forget to always verify what you're piping into bash:
curl https://raw.githubusercontent.com/jesseduffield/lazydocker/master/scripts/install_update_linux.sh | bash
The script installs downloaded binary to $HOME/.local/bin
directory by default, but it can be changed by setting DIR
environment variable.
Go
Required Go Version >= 1.19
go install github.com/jesseduffield/lazydocker@latest
Required Go version >= 1.8, <= 1.17
go get github.com/jesseduffield/lazydocker
Arch Linux AUR
You can install lazydocker using the AUR by running:
yay -S lazydocker
Docker
-
Click if you have an ARM device
-
If you have a ARM 32 bit v6 architecture
docker build -t lazyteam/lazydocker \ --build-arg BASE_IMAGE_BUILDER=arm32v6/golang \ --build-arg GOARCH=arm \ --build-arg GOARM=6 \ https://github.com/jesseduffield/lazydocker.git
-
If you have a ARM 32 bit v7 architecture
docker build -t lazyteam/lazydocker \ --build-arg BASE_IMAGE_BUILDER=arm32v7/golang \ --build-arg GOARCH=arm \ --build-arg GOARM=7 \ https://github.com/jesseduffield/lazydocker.git
-
If you have a ARM 64 bit v8 architecture
docker build -t lazyteam/lazydocker \ --build-arg BASE_IMAGE_BUILDER=arm64v8/golang \ --build-arg GOARCH=arm64 \ https://github.com/jesseduffield/lazydocker.git
-
-
Run the container
docker run --rm -it -v \ /var/run/docker.sock:/var/run/docker.sock \ -v /yourpath:/.config/jesseduffield/lazydocker \ lazyteam/lazydocker
-
Don't forget to change
/yourpath
to an actual path you created to store lazydocker's config -
You can also use this docker-compose.yml
-
You might want to create an alias, for example:
echo "alias lzd='docker run --rm -it -v /var/run/docker.sock:/var/run/docker.sock -v /yourpath/config:/.config/jesseduffield/lazydocker lazyteam/lazydocker'" >> ~/.zshrc
-
For development, you can build the image using:
git clone https://github.com/jesseduffield/lazydocker.git
cd lazydocker
docker build -t lazyteam/lazydocker \
--build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \
--build-arg VCS_REF=`git rev-parse --short HEAD` \
--build-arg VERSION=`git describe --abbrev=0 --tag` \
.
If you encounter a compatibility issue with Docker bundled binary, try rebuilding
the image with the build argument --build-arg DOCKER_VERSION="v$(docker -v | cut -d" " -f3 | rev | cut -c 2- | rev)"
so that the bundled docker binary matches your host docker binary version.
Usage
Call lazydocker
in your terminal. I personally use this a lot so I've made an alias for it like so:
echo "alias lzd='lazydocker'" >> ~/.zshrc
(you can substitute .zshrc for whatever rc file you're using)
Cool features
everything is one keypress away (or one click away! Mouse support FTW):
- viewing the state of your docker or docker-compose container environment at a glance
- viewing logs for a container/service
- viewing ascii graphs of your containers' metrics so that you can not only feel but also look like a developer
- customising those graphs to measure nearly any metric you want
- attaching to a container/service
- restarting/removing/rebuilding containers/services
- viewing the ancestor layers of a given image
- pruning containers, images, or volumes that are hogging up disk space
Contributing
There is still a lot of work to go! Please check out the contributing guide. For contributor discussion about things not better discussed here in the repo, join the discord channel
Donate
If you would like to support the development of lazydocker, consider sponsoring me (github is matching all donations dollar-for-dollar for 12 months)
Social
If you want to see what I (Jesse) am up to in terms of development, follow me on twitter or watch me program on twitch
FAQ
How do I edit my config?
By opening lazydocker, clicking on the 'project' panel in the top left, and pressing 'o' (or 'e' if your editor is vim). See Config Docs
How do I get text to wrap in my main panel?
In the future I want to make this the default, but for now there are some CPU issues that arise with wrapping. If you want to enable wrapping, use gui.wrapMainPanel: true
How do you select text?
Because we support mouse events, you will need to hold option while dragging the mouse to indicate you're trying to select text rather than click on something. Alternatively you can disable mouse events via the gui.ignoreMouseEvents
config value.
Mac Users: See Issue #190 for other options.
Why can't I see my container's logs?
By default we only show logs from the last hour, so that we're not putting too much strain on the machine. This may be why you can't see logs when you first start lazydocker. This can be overwritten in the config's commandTemplates
If you are running lazydocker in Docker container, it is a know bug, that you can't see logs or CPU usage.
Alternatives
- docui - Skanehira beat me to the punch on making a docker terminal UI, so definitely check out that repo as well! I think the two repos can live in harmony though: lazydocker is more about managing existing containers/services, and docui is more about creating and configuring them.
- Portainer - Portainer tries to solve the same problem but it's accessed via your browser rather than your terminal. It also supports docker swarm.
- See Awesome Docker list for similar tools to work with Docker.
Top Related Projects
simple terminal UI for git commands
A tool for exploring each layer in a docker image
Top-like interface for container metrics
dry - A Docker manager for the terminal @
Immersive terminal interface for managing docker containers and services
Glances an Eye on your system. A top/htop alternative for GNU/Linux, BSD, Mac OS and Windows operating systems.
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot