Docker Networking (original) (raw)

Last Updated : 28 Apr, 2026

Docker networking enables containers to communicate with each other, the Docker host and external systems. Each container runs in its own isolated network environment with a unique IP address and network interface. Containers on the same network can communicate directly without exposing ports to the host, allowing you to build secure, interconnected multi-container applications.

**Core Networking Concepts

1

Core Networking Concepts

Network Drivers

Docker uses different network drivers to create and manage various types of networks. Here are the most common drivers and what they do:

419253537

Network Drivers

Essential Docker Network Commands

1. Understanding the Docker Network Command

The Docker Network command is the main command that would allow you to create, manage, and configure your Docker Network. Let's see what the sub-commands can be used with the Docker Network command. to know more about Creating a Network in Docker and Connecting a Container to That Network.

sudo docker network

We will see all the Network sub-commands one by one.

2. Using Docker Network Create command

With the help of the "Create" command, we can create our own docker network and can deploy our containers in **it.

sudo docker network create --driver

3. Using the Docker Network Connect command

Using the "Connect" command, you can connect a running Docker Container to an existing Network.

sudo docker network connect

In this example, we will connect an Ubuntu Container to the Bridge Network we created in the last step.

4. Using the Docker Network Inspect command

Using the Network Inspect command, you can find out the details of a Docker Network.

sudo docker network inspect

You can also find the list of Containers that are connected to the Network.

5. Using the Docker Network ls command

To list all the Docker Networks, you can use the list command.

sudo docker network ls

6. Using the Docker Network Disconnect command

The disconnect command can be used to remove a Container from the Network.

sudo docker network disconnect

7. Using the Docker Network rm command

You can remove a Docker Network using the **rm command.

sudo docker network rm

Note that if you want to remove a network, you need to make sure that no container is currently referencing the network.

8. Using the Docker Network prune command

To remove all the unused Docker Networks, you can use the prune command.

sudo docker network prune

To know more about Docker-published ports refer to this article Docker – Managing Ports

Common Operations