docker-compose-up
start compose services
TLDR
Start services
$ docker compose up
Start in detached mode$ docker compose up -d
Build images before starting$ docker compose up --build
Start specific services$ docker compose up [service1] [service2]
Force recreate containers$ docker compose up --force-recreate
Scale a service$ docker compose up --scale [service]=[3]
Remove orphans$ docker compose up --remove-orphans
SYNOPSIS
docker compose up [options] [service...]
DESCRIPTION
docker compose up builds, (re)creates, starts, and attaches to containers for the services defined in compose.yaml / docker-compose.yml. It also creates networks and volumes declared in the file.When run without -d, it streams aggregated logs from all attached containers and stops them on Ctrl+C. With --wait or -d, the command returns as soon as services are up (or healthy, with --wait).
PARAMETERS
-d, --detach
Run containers in the background and print container names.--build
Build images before starting containers.--no-build
Don't build images even if they are missing.--pull policy
Pull image before running: always, missing (default), or never.--force-recreate
Recreate containers even if configuration and image are unchanged.--no-recreate
Don't recreate containers that already exist.--always-recreate-deps
Recreate dependent containers. Incompatible with --no-recreate.-V, --renew-anon-volumes
Recreate anonymous volumes instead of retrieving data from previous containers.--no-deps
Don't start linked (dependent) services.--scale service=num
Scale the given service to num instances (overrides deploy.replicas).--remove-orphans
Remove containers for services not defined in the Compose file.--wait
Wait for services to be running or healthy. Implies --detach.--wait-timeout seconds
Maximum time to wait for services when using --wait.--abort-on-container-exit
Stop all containers if any container stops. Incompatible with -d.--abort-on-container-failure
Stop all containers if any container exited with non-zero status.--attach service
Restrict log output to the specified service(s).--no-attach service
Do not attach (stream logs from) the specified service(s).-t, --timeout seconds
Shutdown timeout in seconds when stopping attached containers.--timestamps
Show timestamps in container logs.--quiet-pull
Pull images without printing progress information.--no-start
Don't start the services after creating them.
CAVEATS
If the Compose file has changed, containers are recreated unless --no-recreate is set. Using --force-recreate and -V together discards all existing data in anonymous volumes for recreated services.
