Command

Docker Attach to a Container Command

The Docker command to attach to a container is docker attach CONTAINER.

Quick Answer

Command
docker attach CONTAINER
DockerCommand

Attach to a Container

Type this command
docker attach CONTAINER

Connects your terminal to a running container's main process.

Learn More

How to attach to a container in Docker

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

Docker Attach to a Container Command

Run docker attach CONTAINER.

Related Commands

Frequently asked questions

What is the Docker command to attach to a container?

Run docker attach 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