Command

Docker Connect a Container to a Network Command

The Docker command to connect a container to a network is docker network connect NETWORK CONTAINER.

Quick Answer

Command
docker network connect NETWORK CONTAINER
DockerCommand

Connect a Container to a Network

Type this command
docker network connect NETWORK CONTAINER

Joins a running container to an existing network.

Learn More

How to connect a container to a network in Docker

  1. Open the terminal or command interface for Docker.
  2. Type docker network connect NETWORK CONTAINER, replace any placeholders, and run it.

Docker Connect a Container to a Network Command

Run docker network connect NETWORK CONTAINER.

Related Commands

Frequently asked questions

What is the Docker command to connect a container to a network?

Run docker network connect NETWORK CONTAINER.

Where do I type this Docker command?

Type it in the terminal or command-line interface used by Docker.

Does this Docker command work on Mac and Windows?

Yes. The command text is the same on both platforms when the tool is installed.

Official source · How we verify