Skip to main content
Removes networks not connected to any containers. However, default and system networks are preserved.

Usage

container network prune [--debug]

Options

--debug
boolean
Enable debug output

Examples

# Remove all unused networks
container network prune

Behavior

This command will:
  • Remove all user-created networks not connected to any containers
  • Preserve the default network
  • Preserve system networks
  • Display the networks that were removed
Only user-defined networks can be pruned. The default network is always preserved.
Run this command periodically to clean up orphaned networks and keep your network configuration tidy.

Build docs developers (and LLMs) love