advancedTop 100 Interview Questions

What's the difference between `docker compose up` and `docker compose up -d`?

Without `-d`, Compose runs in the foreground, streaming all services' logs to the terminal and stopping them on Ctrl+C. With `-d` (detached), services start in the background and the terminal returns immediately, with `docker compose logs` used separately to view output.

Ready to master this question?

Generate a complete walkthrough — background, the full answer in plain language, a working code example explained line by line, a real-world scenario, common mistakes, and how this same question gets asked in different ways.

Sign in to generate a response

Next Step

Continue to Why doesn't `depends_on` alone guarantee a dependency is ready to accept connections?← Back to all Docker questions