LinuxCommandLibrary

docker-start

Start stopped Docker containers

TLDR

View documentation for the original command

$ tldr docker container start
copy

SYNOPSIS

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

PARAMETERS

-a, --attach
    Attach STDOUT/STDERR streams to the terminal

-i, --interactive
    Keep STDIN open, even if not attached

DESCRIPTION

The docker start command restarts stopped Docker containers, bringing them back to a running state without recreating them. Containers must be in an Exited or Created state; attempting to start running or paused ones results in an error.

By default, it operates in detached mode, outputting only container IDs to the terminal. The -a or --attach option streams the container's STDOUT and STDERR to your terminal. Combine with -i or --interactive to enable STDIN interaction, ideal for shell access.

This command preserves container data, filesystem changes, and configurations from the prior run, assuming persistent storage like volumes. It's a core part of Docker lifecycle management: create with docker run, stop with docker stop, and restart as needed.

Supports multiple containers via space-separated IDs or names. Use docker ps -a to list candidates. Errors occur for non-existent or invalid targets.

Key use cases include resuming services after host reboots, scaling operations, or maintenance downtimes.

CAVEATS

Fails on running, paused, or non-existent containers. Does not restart with new configs; use docker run for that. No healthcheck or resource limit options.

EXAMPLES

docker start mycontainer
Starts detached.

docker start -a -i mycontainer
Starts interactively with output attached.

docker start container1 container2
Starts multiple containers.

HISTORY

Introduced in Docker 0.7.0 (2013) as basic container lifecycle command. Evolved with Docker Engine; options stabilized by v1.0. Supports swarm mode since v1.12.

SEE ALSO

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

Copied to clipboard