DOCKER-COMPOSE-UP(1)

πŸ“¦ version 2.26.1, in debian trixie

✨ NAME ✨

docker-compose-up β€” bestie, this is the one that creates and starts containers. The whole vibe. The main character of the Compose family πŸ’…

It's the up subcommand of docker compose, and yeah, the manual page is literally called DOCKER-COMPOSE-UP(1), which is a whole mouthful, so let's just get into it 🫢


🌸 SYNOPSIS 🌸

docker compose up [OPTIONS] [SERVICE...]

πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so here's the tea: up builds, (re)creates, starts, and attaches to containers for a service. All of it. The full glow-up sequence ✨

Unless they're already running, this command also starts any linked services. No service left behind, periodt.

The docker compose up command aggregates the output of each container β€” think of it like docker compose logs --follow but make it fashion. And because sometimes one chatty service floods the whole group chat, you can:

  • pick a subset of services to attach to with the --attach flag, or
  • exclude some services with --no-attach

so your terminal doesn't get absolutely ratio'd by one verbose service 😭

When the command exits, all containers are stopped. But if you run docker compose up --detach, the containers start in the background and stay running. Iconic. Detached queen behavior πŸ‘‘

If there are existing containers for a service and the service's configuration or image changed after the container was created, docker compose up picks up the changes by stopping and recreating the containers (preserving mounted volumes, so your data is safe, don't panic 🫢). Wanna stop Compose from picking up changes? Use the --no-recreate flag.

Wanna force Compose to stop and recreate all the containers? That's the --force-recreate flag. Aggressive. Love that for you πŸ”₯

⚠️ Exit code tea: if the process hits an error, the exit code for this command is 1. If the process gets interrupted with SIGINT (ctrl + C) or SIGTERM, the containers are stopped and the exit code is 0. Not me being graceful under pressure πŸ’…

πŸ’– OPTIONS πŸ’–

  • --abort-on-container-exit[=false] β€” Stops all containers if any container was stopped. Incompatible with -d. Pick a lane bestie, you can't have both πŸ™ˆ
  • --always-recreate-deps[=false] β€” Recreate dependent containers. Incompatible with --no-recreate.
  • --attach=[] β€” Restrict attaching to the specified services. Incompatible with --attach-dependencies.
  • --attach-dependencies[=false] β€” Automatically attach to log output of dependent services. It's giving "and bring your friends" ✨
  • --build[=false] β€” Build images before starting containers.
  • -d, --detach[=false] β€” Detached mode: run containers in the background. Main character exit, no goodbye 🌈
  • --exit-code-from="" β€” Return the exit code of the selected service container. Implies --abort-on-container-exit.
  • --force-recreate[=false] β€” Recreate containers even if their configuration and image haven't changed. No notes. Just chaos πŸ”₯
  • -h, --help[=false] β€” help for up.
  • --no-attach=[] β€” Do not attach (stream logs) to the specified services. The mute button we all need πŸ”‡
  • --no-build[=false] β€” Don't build an image, even if it's policy.
  • --no-color[=false] β€” Produce monochrome output. Minimalist era πŸ–€
  • --no-deps[=false] β€” Don't start linked services.
  • --no-log-prefix[=false] β€” Don't print prefix in logs.
  • --no-recreate[=false] β€” If containers already exist, don't recreate them. Incompatible with --force-recreate.
  • --no-start[=false] β€” Don't start the services after creating them. All dressed up, nowhere to go πŸ’€
  • --pull="policy" β€” Pull image before running ("always"|"missing"|"never").
  • --quiet-pull[=false] β€” Pull without printing progress information.
  • --remove-orphans[=false] β€” Remove containers for services not defined in the Compose file. Cleaning house, we love a declutter 🧹
  • -V, --renew-anon-volumes[=false] β€” Recreate anonymous volumes instead of retrieving data from the previous containers.
  • --scale=[] β€” Scale SERVICE to NUM instances. Overrides the scale setting in the Compose file if present. Clone army activated πŸ‘‘
  • -t, --timeout=0 β€” Use this timeout in seconds for container shutdown when attached or when containers are already running.
  • --timestamps[=false] β€” Show timestamps.
  • --wait[=false] β€” Wait for services to be running|healthy. Implies detached mode. Patience is a virtue, bestie 🧚
  • --wait-timeout=0 β€” Maximum duration to wait for the project to be running|healthy.
  • -w, --watch[=false] β€” Watch source code and rebuild/refresh containers when files are updated. Live-reload realness ⭐

πŸŽ€ OPTIONS INHERITED FROM PARENT COMMANDS πŸŽ€

  • --dry-run[=false] β€” Execute command in dry run mode. Practice round, no consequences ✨

πŸ’œ SEE ALSO πŸ’œ


okay that's the whole page, you're literally a Compose expert now, no cap 🫢✨

this lil writeup is from the Mar 2025 release of the DOCKER-COMPOSE-UP(1) manual, so if the docs ever update, check the fresh one β€” mwah πŸ’‹

πŸ“¦ where this page comes from