# docker network rm: Remove Networks & In-Use Errors

> How docker network rm works: deleting user-defined networks, the active-endpoints error, prune, and CI cleanup.

Source: https://latchkey.dev/learn/command-reference/docker-network-rm-command  
Updated: 2026-06-25

Remove a user-defined network once nothing is attached.

docker network rm deletes networks. This page covers the active-endpoints error and how prune differs.

## What it does

docker network rm removes one or more user-defined networks. A network with connected containers cannot be removed until they disconnect or stop.

## Common usage

```Terminal
docker network rm testnet
docker network prune -f                  # remove all unused networks
```

## Common errors in CI

"error while removing network: network ... has active endpoints" means a container is still attached - stop/remove it first, then rm the network. You cannot remove the built-in bridge, host, or none. For bulk cleanup of leftover compose networks, docker network prune -f is simpler than individual rm.

## FAQ

### docker network rm: Remove Networks & In-Use Errors?

docker network rm deletes networks. This page covers the active-endpoints error and how prune differs.

### What it does?

docker network rm removes one or more user-defined networks. A network with connected containers cannot be removed until they disconnect or stop.

### Common errors in CI?

"error while removing network: network ... has active endpoints" means a container is still attached - stop/remove it first, then rm the network. You cannot remove the built-in bridge, host, or none. For bulk cleanup of leftover compose networks, docker network prune -f is simpler than individual rm.

---

Latchkey runs CI/CD that repairs its own failures. Agent entry points: https://latchkey.dev/agent.txt, https://latchkey.dev/openapi.json, https://latchkey.dev/llms.txt
