LinuxCommandLibrary

docker-start

Start stopped Docker containers

TLDR

Display help

$ docker start --help
copy

Start a Docker container
$ docker start [container]
copy

Start a container, attaching stdout and stderr and forwarding signals
$ docker start [[-a|--attach]] [container]
copy

Start one or more containers
$ docker start [container1 container2 ...]
copy

SYNOPSIS

docker start [OPTIONS] CONTAINER [CONTAINER...]

PARAMETERS

-a, --attach
    Attach STDOUT/STDERR and forward signals to the container. This allows you to see the container's output in your terminal and interact with it if it accepts input.

-i, --interactive
    Attach container's STDIN. This is commonly used in conjunction with -a to allow interactive input to the container, such as when starting a shell or a command that requires user interaction.

--detach-keys string
    Override the default key sequence for detaching a container (e.g., 'ctrl-p,ctrl-q'). This is useful when -a or -i is used and you need to detach without stopping the container.

DESCRIPTION

The docker start command is a fundamental tool used to resume the execution of one or more previously stopped Docker containers. Unlike docker run, which is used to create and then start a new container from a Docker image, docker start operates solely on existing containers. When invoked, it brings a container that is in a 'stopped' state back into a 'running' state, leveraging its existing filesystem, configuration (such as port mappings, volume mounts, and environment variables), and network settings. This command is crucial for managing container lifecycles, enabling users to pause and resume work with persistent environments without the overhead of re-creating a container from scratch. It is particularly useful for long-running services or development environments that need to be brought online or offline efficiently.

CAVEATS

Important Considerations:
The specified CONTAINER must exist and be in a stopped state for docker start to be effective.

docker start does not re-create or modify the container's original configuration (e.g., port mappings, volume mounts, environment variables); these are preserved from its initial creation with docker run.

If the container was configured with a restart policy during docker run, docker start will respect that policy if the container stops unexpectedly after being started.

CONTAINER IDS AND NAMES

You can specify containers by their full ID, short ID, or name. For example, docker start my-container-name or docker start a1b2c3d4e5f6.

STARTING MULTIPLE CONTAINERS

You can start multiple containers at once by listing their IDs or names separated by spaces, like docker start container1 container2 container3.

HISTORY

The docker start command has been a fundamental part of the Docker CLI since the early days of Docker's public release in 2013. As Docker matured from a lightweight virtualization solution to a full-fledged containerization platform, the ability to manage the lifecycle of containers – including starting, stopping, and restarting them – became crucial. docker start specifically addresses the need to resume work on a persistent container environment, contrasting with docker run which focuses on initial container creation. Its core functionality has remained consistent, reflecting its foundational role in container orchestration.

SEE ALSO

docker run(1), docker stop(1), docker restart(1), docker attach(1), docker ps(1)

Copied to clipboard