docker compose up
Packages and runtimes
Usage
docker compose up [-d] [--build] [<service>...]Starts every service in compose.yaml as one project; the hyphenated docker-compose is the retired v1 while docker compose is the v2 plugin, and existing containers are reused unless you pass --build or --force-recreate.
Common flags
| Flag | Meaning |
|---|---|
| -d | start in the background |
| --build | rebuild images before starting |
| --force-recreate | replace containers even if nothing changed |
| --remove-orphans | clean up containers of services you deleted |
| --wait | return only once healthchecks pass |
| --scale <svc>=<n> | run n copies of one service |
Examples
docker compose up -dstarts every service in compose.yaml in the background
docker compose up --build webrebuilds and starts one service
docker compose down -vstops everything and deletes the named volumes, database data included
The question is always what goes where: inside this project, or on the whole machine.
How to read this
- Square brackets [ ] mark a part you may leave out.
- An ellipsis … means you can list more than one.
- Flags are case-sensitive — in some commands -r and -R do different things.
Questions
Q. What does docker compose up do?
Starts every service in compose.yaml as one project; the hyphenated docker-compose is the retired v1 while docker compose is the v2 plugin, and existing containers are reused unless you pass --build or --force-recreate.
Q. How do I type it?
docker compose up [-d] [--build] [<service>...] — square brackets mark the parts you can leave out.
Q. How many flags are worth knowing?
6 are listed here; the full set is in man docker. This command sits under Packages and runtimes.
Related commands
man page: man docker-compose-up