Command

Docker Open a Shell in a Running Container Command

The Docker command to open a shell in a running container is docker exec -it CONTAINER bash.

Quick Answer

Command
docker exec -it CONTAINER bash
DockerCommand

Open a Shell in a Running Container

Type this command
docker exec -it CONTAINER bash

Runs a command inside a container that is already up, such as a bash prompt.

Learn More

How to open a shell in a running container in Docker

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

Docker Open a Shell in a Running Container Command

Run docker exec -it CONTAINER bash.

Related Commands

Frequently asked questions

What is the Docker command to open a shell in a running container?

Run docker exec -it CONTAINER bash.

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