Compare

Docker Compose Up vs Run

When to start a service stack and when to launch a one-off command with Compose.

`docker compose up` starts long-lived services from your compose file. `docker compose run` launches a one-off container for a service, usually for tasks like migrations, shells, or admin commands.

Use Up When

You want your application stack running continuously.

You need attached logs, dependency startup, and normal service orchestration.

Use Run When

You need a one-time command inside a service definition.

You are running migrations, opening a shell, or executing an ad hoc task.

Rule of Thumb

Up starts the environment. Run does one job inside it.

Want the short version? Browse the compact sheet views and save the commands you use most into a Cheatbook.