compose is a free, open source orchestration & scheduling project written in Go and released under Apache-2.0. It has 38,175 GitHub stars, 5,817 forks and 111 open issues, and was last pushed 9 hours ago. On this registry it ranks #1 of 64 tracked projects in Orchestration & Scheduling, with 5 head-to-head comparisons available. It gained 9 stars over the last 3 tracked days.

What is compose?

Docker Compose is an Apache-2.0 licensed Go tool that defines and runs multi-container applications on Docker from a single Compose file, aimed at developers and operators who need several containers to start together as one isolated application.

What it is

Docker Compose is a tool for running multi-container applications on Docker, where the application is described in a Compose file. That file defines how one or more containers that make up the application are configured, and once it exists the whole application can be created and started with a single command, docker compose up. The project is written in Go, lives in the Docker ecosystem, and is published under the Apache-2.0 licence.

The concrete problem it solves is the manual coordination of several containers that belong to one application. Without a Compose file, each container has to be launched, networked and configured separately, and the resulting environment is hard to reproduce. Compose replaces that with a declarative file, normally compose.yaml, which is paired with a Dockerfile so the application environment can be reproduced anywhere and the services run together in an isolated environment. It also replaces the legacy Python implementation of Compose, which remains available only under the v1 branch.

Key capabilities

  • Runs a full multi-container application with one command, docker compose up.
  • Defines services in the Compose file format maintained at the Compose specification, compose-spec.io.
  • Builds services from source through a Dockerfile declared in the Compose file with build: ..
  • Maps container ports to the host, for example ports: - "5000:5000".
  • Mounts host paths into containers through volumes, for example volumes: - .:/code.
  • Pulls prebuilt images for supporting services, for example image: redis.
  • Ships on Windows and macOS inside Docker Desktop, and on Linux as a standalone binary renamed to docker-compose and placed in a Docker CLI plugins directory such as $HOME/.docker/cli-plugins, /usr/local/lib/docker/cli-plugins or /usr/lib/docker/cli-plugins.

Who uses it and how

  • Developers who define an application in a Dockerfile and a compose.yaml, then bring the entire stack up locally in an isolated environment.
  • Docker Desktop users on Windows and macOS, where Compose is included and needs no separate installation step.
  • Linux users who install the binary from the release page and copy it into a CLI plugins folder, either under the home directory or system-wide, sometimes after making the downloaded file executable with chmod +x.
  • Go developers who consume the project as a library, since documentation is published at pkg.go.dev/github.com/docker/compose/v5.
  • Contributors to the tool itself, who follow the contributing documentation and report problems on the issue tracker.

Getting started

On Windows and macOS, Docker Compose is included in Docker Desktop, so no separate install is required. On Linux, download the relevant binary from the GitHub release page, rename it to docker-compose, and copy it into $HOME/.docker/cli-plugins or one of the system-wide Docker CLI plugins directories.

How it compares

Docker Swarm used to rely on the legacy Compose file format but never adopted the Compose specification, so some Compose features are not accessible to Swarm users, and after the Mirantis acquisition Swarm is not maintained by Docker Inc. The legacy Python version of Compose is available only under the v1 branch of this repository, while the current Go implementation is the maintained line.

When to use it — and when not to

Anyone self-hosting must still have a working Docker installation, since Compose drives Docker rather than replacing it; the README does not describe any additional database, storage or mail services that Compose itself requires. Swarm users should not expect the newest Compose syntax to be available to them, and teams already committed to a different orchestrator gain little from adding Compose alongside it. The README excerpt is sparse, so readers looking for a full command reference should rely on the project documentation rather than the repository front page.

project readme (upstream, from github) — read inline

Table of Contents

Docker Compose

GitHub release PkgGoDev Build Status Codecov OpenSSF Scorecard Docker Compose

Docker Compose is a tool for running multi-container applications on Docker defined using the Compose file format. A Compose file is used to define how one or more containers that make up your application are configured. Once you have a Compose file, you can create and start your application with a single command: docker compose up.

Note: About Docker Swarm Docker Swarm used to rely on the legacy compose file format but did not adopt the compose specification so is missing some of the recent enhancements in the compose syntax. After acquisition by Mirantis swarm isn't maintained by Docker Inc, and as such some Docker Compose features aren't accessible to swarm users.

Where to get Docker Compose

Windows and macOS

Docker Compose is included in Docker Desktop for Windows and macOS.

Linux

You can download Docker Compose binaries from the release page on this repository.

Rename the relevant binary for your OS to docker-compose and copy it to $HOME/.docker/cli-plugins

Or copy it into one of these folders to install it system-wide:

  • /usr/local/lib/docker/cli-plugins OR /usr/local/libexec/docker/cli-plugins
  • /usr/lib/docker/cli-plugins OR /usr/libexec/docker/cli-plugins

(might require making the downloaded file executable with chmod +x)

Quick Start

Using Docker Compose is a three-step process:

  1. Define your app's environment with a Dockerfile so it can be reproduced anywhere.
  2. Define the services that make up your app in compose.yaml so they can be run together in an isolated environment.
  3. Lastly, run docker compose up and Compose will start and run your entire app.

A Compose file looks like this:

services:
  web:
    build: .
    ports:
      - "5000:5000"
    volumes:
      - .:/code
  redis:
    image: redis

Contributing

Want to help develop Docker Compose? Check out our contributing documentation.

If you find an issue, please report it on the issue tracker.

Legacy

The Python version of Compose is available under the v1 branch.

Frequently asked questions

Is compose free to use?

compose is open source under the Apache-2.0 licence. There is no licence fee and no seat count — you can self-host it or, where the project offers one, pay a vendor for a managed version instead.

What does compose do?

Define and run multi-container applications with Docker

What is compose written in?

compose is primarily written in Go. Its source is publicly available at https://github.com/docker/compose, and it has 38,175 GitHub stars.