# Pumba — Chaos Testing for Docker Containers > Pumba is a chaos testing and network emulation tool for Docker containers. It can kill, pause, stop, and remove running containers, and inject network failures such as latency, packet loss, and bandwidth limits to test application resilience. ## Install Save in your project root: # Pumba — Chaos Testing for Docker Containers ## Quick Use ```bash # Install go install github.com/alexei-led/pumba@latest # Kill a random container every 30 seconds pumba --interval 30s kill # Add 3 second network delay to a specific container pumba netem --duration 1m delay --time 3000 my-app-container ``` ## Introduction Pumba is an open-source chaos testing tool designed specifically for Docker environments. Inspired by Netflix's Chaos Monkey, it brings resilience testing to container workloads by randomly killing, pausing, or stopping containers and injecting network faults. Pumba helps development teams verify that their containerized applications handle infrastructure failures gracefully before those failures occur in production. ## What Pumba Does - Kills, stops, pauses, and removes Docker containers on a configurable schedule - Injects network latency, packet loss, bandwidth limits, and corruption into container traffic - Targets containers by name, label, or random selection with regex pattern matching - Runs as a single binary or as a Docker container alongside your application stack - Supports one-shot and recurring chaos experiments with configurable intervals ## Architecture Overview Pumba connects to the Docker daemon via the Docker API to discover and manipulate running containers. For container-level chaos (kill, stop, pause), it issues Docker API calls directly. For network emulation, Pumba uses Linux `tc` (traffic control) and `netem` inside the target container's network namespace. It operates as a standalone process with no server component, reading configuration from command-line flags. ## Self-Hosting & Configuration - Install via `go install`, download a prebuilt binary, or run as a Docker container - Target specific containers with `--name` regex patterns or Docker labels - Set chaos intervals with `--interval` for recurring experiments - Limit chaos duration with `--duration` to automatically restore normal behavior - Run Pumba itself as a Docker container: `docker run gaiaadm/pumba kill --interval 60s` ## Key Features - Container chaos: kill, stop, pause, and remove with configurable signals and grace periods - Network emulation: delay, loss, corruption, duplication, and bandwidth throttling via netem - Flexible targeting using container name patterns, labels, or random selection - Dry-run mode to preview which containers would be affected without executing - Lightweight single binary with no external dependencies beyond Docker ## Comparison with Similar Tools - **Chaos Mesh** — Kubernetes-native chaos platform; Pumba targets Docker containers directly - **LitmusChaos** — Full chaos engineering platform for K8s; Pumba is simpler and Docker-focused - **Comcast** — System-wide network shaping; Pumba targets individual container network namespaces - **Toxiproxy** — TCP proxy for simulating network failures; Pumba operates at the container and network level - **Gremlin** — Commercial chaos engineering platform; Pumba is free and open-source ## FAQ **Q: Does Pumba work with Kubernetes?** A: Pumba is designed for Docker. For Kubernetes chaos testing, consider Chaos Mesh or LitmusChaos. Pumba can still target containers on K8s nodes if run with Docker access. **Q: Can Pumba target specific containers?** A: Yes. Use `--name` with regex patterns to target containers by name, or filter by Docker labels. **Q: Will Pumba affect my production environment?** A: Pumba only affects containers on the host where it runs. Use `--dry-run` to verify targeting before executing chaos experiments. **Q: How does network emulation work?** A: Pumba uses Linux `tc netem` inside the target container's network namespace to inject latency, packet loss, and bandwidth limits without affecting other containers. ## Sources - https://github.com/alexei-led/pumba - https://github.com/alexei-led/pumba#readme --- Source: https://tokrepo.com/en/workflows/asset-7c69e9b3 Author: AI Open Source