# jesseduffield/lazydocker architecture

> Architecture diagram of the GitHub repository jesseduffield/lazydocker, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/jesseduffield/lazydocker
- Repository: https://github.com/jesseduffield/lazydocker

## Overview

Lazydocker is a terminal UI for managing Docker and Docker Compose. The main workflow starts with the user launching the app, which initializes configuration, Docker access, and the UI; users then inspect and operate containers, services, projects, images, networks, and volumes. The UI uses command adapters for Docker and host commands, while task management supports background and repeating work. Some resource panels are represented from the tree and README rather than inspected source, so their internal links are omitted where call ownership is not evidenced.

Main entry points: [`pkg/app/app.go`](https://github.com/jesseduffield/lazydocker/blob/master/pkg/app/app.go) (App bootstrap), [`pkg/commands/docker.go`](https://github.com/jesseduffield/lazydocker/blob/master/pkg/commands/docker.go) (Docker commands), [`pkg/gui/services_panel.go`](https://github.com/jesseduffield/lazydocker/blob/master/pkg/gui/services_panel.go) (Services panel), [`pkg/gui/gui.go`](https://github.com/jesseduffield/lazydocker/blob/master/pkg/gui/gui.go) (GUI runtime)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Startup"]
  node_main["CLI entry<br/>[main.go]"]
  node_app["App bootstrap<br/>[app.go]"]
  node_config["App config<br/>[app_config.go]"]
end

subgraph group_ui["Terminal UI"]
  node_gui["GUI runtime<br/>[gui.go]"]
  node_container_panel["Containers panel"]
  node_service_panel["Services panel<br/>[services_panel.go]"]
  node_other_panels["Other resource panels"]
  node_presentation["Resource presentation"]
  node_task_adapter["GUI task adapter<br/>[tasks_adapter.go]"]
end

subgraph group_docker["Docker access"]
  node_docker_commands["Docker commands<br/>[docker.go]"]
  node_os_commands["Host commands<br/>[os.go]"]
  node_service_actions["Service actions<br/>[service.go]"]
  node_ssh_tunnel["SSH tunnel<br/>[ssh.go]"]
end

subgraph group_support["Runtime support"]
  node_task_manager["Task manager<br/>[tasks.go]"]
  node_translations["Translations<br/>[i18n.go]"]
  node_logging["Logging<br/>[log.go]"]
end

node_user(("User"))
node_docker_daemon(("Docker daemon"))
node_compose_cli(("Compose CLI"))

node_user -->|"launches"| node_main
node_main -->|"loads"| node_config
node_main -->|"starts"| node_app
node_app -->|"uses"| node_config
node_app -->|"creates"| node_gui
node_app -->|"creates"| node_docker_commands
node_app -->|"creates"| node_os_commands
node_app -->|"loads"| node_translations
node_app -->|"creates"| node_logging
node_gui -.->|"renders"| node_container_panel
node_gui -.->|"renders"| node_service_panel
node_gui -.->|"renders"| node_other_panels
node_container_panel -->|"uses"| node_docker_commands
node_container_panel -->|"uses"| node_presentation
node_service_panel -->|"uses"| node_docker_commands
node_service_panel -->|"uses"| node_presentation
node_service_panel -->|"uses"| node_task_adapter
node_service_panel -->|"runs"| node_os_commands
node_task_adapter -->|"queues"| node_task_manager
node_docker_commands -->|"queries"| node_docker_daemon
node_docker_commands -->|"queries"| node_compose_cli
node_docker_commands -->|"configures"| node_ssh_tunnel
node_service_actions -->|"runs"| node_os_commands

click node_main "https://github.com/jesseduffield/lazydocker/blob/master/main.go"
click node_app "https://github.com/jesseduffield/lazydocker/blob/master/pkg/app/app.go"
click node_config "https://github.com/jesseduffield/lazydocker/blob/master/pkg/config/app_config.go"
click node_gui "https://github.com/jesseduffield/lazydocker/blob/master/pkg/gui/gui.go"
click node_container_panel "https://github.com/jesseduffield/lazydocker/blob/master/pkg/gui/containers_panel.go"
click node_service_panel "https://github.com/jesseduffield/lazydocker/blob/master/pkg/gui/services_panel.go"
click node_other_panels "https://github.com/jesseduffield/lazydocker/tree/master/pkg/gui"
click node_presentation "https://github.com/jesseduffield/lazydocker/tree/master/pkg/gui/presentation"
click node_task_adapter "https://github.com/jesseduffield/lazydocker/blob/master/pkg/gui/tasks_adapter.go"
click node_task_manager "https://github.com/jesseduffield/lazydocker/blob/master/pkg/tasks/tasks.go"
click node_docker_commands "https://github.com/jesseduffield/lazydocker/blob/master/pkg/commands/docker.go"
click node_os_commands "https://github.com/jesseduffield/lazydocker/blob/master/pkg/commands/os.go"
click node_service_actions "https://github.com/jesseduffield/lazydocker/blob/master/pkg/commands/service.go"
click node_ssh_tunnel "https://github.com/jesseduffield/lazydocker/blob/master/pkg/commands/ssh/ssh.go"
click node_translations "https://github.com/jesseduffield/lazydocker/blob/master/pkg/i18n/i18n.go"
click node_logging "https://github.com/jesseduffield/lazydocker/blob/master/pkg/log/log.go"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_main,node_app,node_config,node_user toneBlue
class node_gui,node_container_panel,node_service_panel,node_other_panels,node_presentation,node_task_adapter toneAmber
class node_docker_commands,node_os_commands,node_service_actions,node_ssh_tunnel toneMint
class node_task_manager,node_translations,node_logging toneRose
class node_docker_daemon,node_compose_cli toneIndigo
```

## Components

### Startup

- [CLI entry](https://github.com/jesseduffield/lazydocker/blob/master/main.go): `main.go`
- [App bootstrap](https://github.com/jesseduffield/lazydocker/blob/master/pkg/app/app.go): `pkg/app/app.go`
- [App config](https://github.com/jesseduffield/lazydocker/blob/master/pkg/config/app_config.go): `pkg/config/app_config.go`

### Terminal UI

- [GUI runtime](https://github.com/jesseduffield/lazydocker/blob/master/pkg/gui/gui.go): `pkg/gui/gui.go`
- [Containers panel](https://github.com/jesseduffield/lazydocker/blob/master/pkg/gui/containers_panel.go): `pkg/gui/containers_panel.go`
- [Services panel](https://github.com/jesseduffield/lazydocker/blob/master/pkg/gui/services_panel.go): `pkg/gui/services_panel.go`
- [Other resource panels](https://github.com/jesseduffield/lazydocker/tree/master/pkg/gui): `pkg/gui`
- [Resource presentation](https://github.com/jesseduffield/lazydocker/tree/master/pkg/gui/presentation): `pkg/gui/presentation`
- [GUI task adapter](https://github.com/jesseduffield/lazydocker/blob/master/pkg/gui/tasks_adapter.go): `pkg/gui/tasks_adapter.go`

### Docker access

- [Docker commands](https://github.com/jesseduffield/lazydocker/blob/master/pkg/commands/docker.go): `pkg/commands/docker.go`
- [Host commands](https://github.com/jesseduffield/lazydocker/blob/master/pkg/commands/os.go): `pkg/commands/os.go`
- [Service actions](https://github.com/jesseduffield/lazydocker/blob/master/pkg/commands/service.go): `pkg/commands/service.go`
- [SSH tunnel](https://github.com/jesseduffield/lazydocker/blob/master/pkg/commands/ssh/ssh.go): `pkg/commands/ssh/ssh.go`

### Runtime support

- [Task manager](https://github.com/jesseduffield/lazydocker/blob/master/pkg/tasks/tasks.go): `pkg/tasks/tasks.go`
- [Translations](https://github.com/jesseduffield/lazydocker/blob/master/pkg/i18n/i18n.go): `pkg/i18n/i18n.go`
- [Logging](https://github.com/jesseduffield/lazydocker/blob/master/pkg/log/log.go): `pkg/log/log.go`

### Other components

- **User**
- **Docker daemon**
- **Compose CLI**

## Connections

- User → CLI entry: launches
- CLI entry → App config: loads (evidence: `main.go`)
- CLI entry → App bootstrap: starts (evidence: `main.go`)
- App bootstrap → App config: uses (evidence: `pkg/app/app.go`)
- App bootstrap → GUI runtime: creates (evidence: `pkg/app/app.go`)
- App bootstrap → Docker commands: creates (evidence: `pkg/app/app.go`)
- App bootstrap → Host commands: creates (evidence: `pkg/app/app.go`)
- App bootstrap → Translations: loads (evidence: `pkg/app/app.go`)
- App bootstrap → Logging: creates (evidence: `pkg/app/app.go`)
- GUI runtime → Containers panel: renders
- GUI runtime → Services panel: renders
- GUI runtime → Other resource panels: renders
- Containers panel → Docker commands: uses (evidence: `pkg/gui/containers_panel.go`)
- Containers panel → Resource presentation: uses (evidence: `pkg/gui/containers_panel.go`)
- Services panel → Docker commands: uses (evidence: `pkg/gui/services_panel.go`)
- Services panel → Resource presentation: uses (evidence: `pkg/gui/services_panel.go`)
- Services panel → GUI task adapter: uses (evidence: `pkg/gui/services_panel.go`)
- Services panel → Host commands: runs (evidence: `pkg/gui/services_panel.go`)
- GUI task adapter → Task manager: queues (evidence: `pkg/gui/tasks_adapter.go`)
- Docker commands → Docker daemon: queries (evidence: `pkg/commands/docker.go`)
- Docker commands → Compose CLI: queries (evidence: `pkg/commands/docker.go`)
- Docker commands → SSH tunnel: configures (evidence: `pkg/commands/docker.go`)
- Service actions → Host commands: runs (evidence: `pkg/commands/service.go`)
