Skip to main content

Create and manage docker networks.

# To list all available and configured networks on docker daemon:
docker network ls

# To create a user-defined network:
docker network create --driver <driver_name> <network_name>

# To display detailed information of a space-separated list of networks:
docker network inspect <network_name>

# To connect a container to a network using a name or ID:
docker network connect <network_name> <container_name|ID>

# To disconnect a container from a network:
docker network disconnect <network_name> <container_name|ID>

# To remove all unused (not referenced by any container) networks:
docker network prune

# To remove a space-separated list of unused networks:
docker network rm <network_name>