LinuxCommandLibrary

docker-container-start

TLDR

Start a Docker container

$ docker [[start|container start]] [container]
copy

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

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

Display help
$ docker [[start|container start]] --help
copy

SYNOPSIS

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

PARAMETERS

-a, --attach
    Attach to STDIN, STDOUT or STDERR of the container

-i, --interactive
    Keep STDIN open even if not attached. Implies -a

--detach-keys string
    Override key sequence for detaching (default: ctrl-p,ctrl-q)

DESCRIPTION

The docker container start command restarts one or more stopped containers. Containers must already exist and be in a stopped state; it does not create new ones like docker run. This is useful for resuming workloads without losing data or configuration.

By default, it starts containers in detached mode, returning control to the terminal immediately. Use options like -a or -i for interactive sessions. Multiple containers can be specified, starting them in parallel. Status can be checked with docker ps.

It respects container configurations like ports, volumes, and environment variables from creation. Errors occur if containers are running, paused, or nonexistent. Ideal for development, testing, and production restarts.

CAVEATS

Containers must exist and be stopped; fails on running, paused, or missing ones. No automatic cleanup or recreation.

EXAMPLES

docker container start mycontainer
Start single detached container.

docker container start -ai mycontainer
Start interactively with attach.

HISTORY

Introduced in Docker 1.0 (2013) as docker start; container subcommand added in Docker 1.13 (2017) for better organization.

SEE ALSO

docker container stop(1), docker container run(1), docker ps(1), docker container ls(1)

Copied to clipboard