docker network

Manage Docker networks. Containers on the same network can communicate by name.

Syntax

docker network COMMAND

Examples

Example 1
docker network create mynet

Create a custom bridge network.

Example 2
docker network ls

List all networks.

Example 3
docker network connect mynet my-container

Connect a container to a network.

Example 4
docker network inspect mynet

Show network details and connected containers.

Tips & best practices

Related commands

View full Docker cheatsheet →