Skip to content

Instantly share code, notes, and snippets.

@guibranco
Last active July 2, 2026 11:17
Show Gist options
  • Select an option

  • Save guibranco/c134d27df237186ed2de4244c79c42d1 to your computer and use it in GitHub Desktop.

Select an option

Save guibranco/c134d27df237186ed2de4244c79c42d1 to your computer and use it in GitHub Desktop.
ETCD + ETCD Workbench (web gui tool to manage ETCD) Docker compose file, with volume set
services:
etcd:
image: gcr.io/etcd-development/etcd:v3.6.12
container_name: etcd
restart: unless-stopped
command:
- etcd
- --name=etcd0
- --data-dir=/etcd-data
- --listen-client-urls=http://0.0.0.0:2379
- --advertise-client-urls=http://etcd:2379
- --listen-peer-urls=http://0.0.0.0:2380
ports:
- "2379:2379"
- "2380:2380"
volumes:
- etcd-data:/etcd-data
healthcheck:
test: ["CMD", "etcdctl", "endpoint", "health"]
interval: 10s
timeout: 5s
retries: 3
start_period: 10s
etcd-workbench:
image: tzfun/etcd-workbench:latest
container_name: etcd-workbench
restart: unless-stopped
ports:
- "8002:8002"
depends_on:
etcd:
condition: service_healthy
volumes:
etcd-data:
@guibranco

Copy link
Copy Markdown
Author

etcd + etcd-workbench β€” local dev stack 🐳

This docker-compose.yml spins up a single-node etcd v3.6.12 server alongside etcd-workbench, a browser-based UI for inspecting and managing etcd β€” ideal for local development and testing (no TLS/auth, so don't expose it publicly).

What's inside

Service Image Ports Purpose
etcd gcr.io/etcd-development/etcd:v3.6.12 2379 (client), 2380 (peer) Single-node etcd key-value store
etcd-workbench tzfun/etcd-workbench:latest 8002 Web UI to browse/edit keys, manage users & roles

How it works

  • etcd runs as a single member (etcd0) with its data directory persisted in the named volume etcd-data, so keys survive container restarts. Data is only wiped with docker compose down -v.
  • A healthcheck (etcdctl endpoint health) gates the workbench startup via depends_on: condition: service_healthy, so the UI only starts once etcd is actually ready.
  • Both services share the default compose network. etcd advertises itself as http://etcd:2379, so inside the workbench UI you add a connection using host etcd and port 2379 (Docker DNS resolves the service name). From your host machine, use localhost:2379 instead.
  • The workbench config mount (./etcd-workbench.conf) is optional β€” the image ships with a default config. Mount your own only to enable authentication or change the port.

Usage

# spin up (detached)
docker compose up -d

# open the UI
# β†’ http://localhost:8002  (add a connection to etcd:2379)

# quick smoke test
docker compose exec etcd etcdctl put foo bar
docker compose exec etcd etcdctl get foo

# tail logs
docker compose logs -f

# spin down (keeps data)
docker compose down

# spin down + delete the data volume
docker compose down -v

Repositories

⚠️ Note on etcd-workbench web version

The web/Docker version of etcd-workbench is archived and no longer maintained β€” development moved to the desktop app (releases prefixed App-x.y.z). The Docker image (Web-1.1.4) still works fine for local testing, but don't expect updates or security patches. For anything longer-lived, consider the desktop app or plain etcdctl.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment