Docker Compose helps you manage and or­ches­trate your Docker con­tain­ers. The tool can be installed on macOS in just a few steps in the terminal and is an ideal com­ple­ment for container man­age­ment with Docker.

Step 1: Install Docker

Before you can get started in­stalling Docker Compose on a Mac, ensure that you have down­loaded and installed Docker. You can check if this is the case with a simple terminal command:

docker --version
bash

If you’ve installed Docker, you’ll be able to view the Docker version.

Image: Screenshot of Mac terminal after running docker –version
View your Docker version in Mac terminal.

Al­ter­na­tive­ly, you can download Docker from the official Docker website. Ensure you’ve selected the correct chipset, because there’s a dis­tinc­tion between Apple computers using their own Apple chip and Apple PCs with an Intel chip. Once file download is complete, open it and follow the in­struc­tions of the in­stal­la­tion wizard to complete the Docker in­stal­la­tion. Should questions arise during this process, Docker tutorials offer useful guidance on in­stal­la­tion.

Step 2: Download Docker Compose for Mac

To begin the in­stal­la­tion of Docker Compose on your Mac, open a terminal window. Once the terminal is open, you can enter the following command, which will au­to­mat­i­cal­ly download the latest version of Docker Compose for Mac:

curl -L "https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
bash

If you encounter an error message while running the previous command, it’s likely due to in­suf­fi­cient per­mis­sions to write to the required directory. In such cases, it’s rec­om­mend­ed to perform the in­stal­la­tion as a superuser. To do this, enter the following command in the terminal:

sudo -i
bash

Now repeat step 2 of the in­struc­tions and continue with the following steps.

Tip

Docker Compose is not limited to Mac. To work with Docker on another operating system, our tutorials will guide you through down­load­ing and in­stalling Docker Compose:

Step 3: Mark Docker Compose as an ex­e­cutable file

To use Docker Compose, you must make the program ex­e­cutable by changing the per­mis­sions. The terminal command chmod helps with this:

chmod +x /usr/local/bin/docker-compose
bash

Mark Docker Compose as an ex­e­cutable program using +x, which stands for ex­e­cutable.

Step 4: Check whether the in­stal­la­tion was suc­cess­ful

To ensure no errors occurred during your in­stal­la­tion of Docker Compose on macOS, access the current version of Docker Compose in the terminal:

docker compose version
bash

If you’ve done every­thing correctly, the installed version of Docker Compose should now be displayed in the terminal window.

Image: Screenshot of the Mac terminal after running docker compose version
View the installed Docker compose version on a Mac.

If you encounter an error message instead of seeing the Docker Compose version, it indicates that an error occurred during the in­stal­la­tion process. We recommend that you repeat the above steps again.

Tip

Want to learn how to use Docker Compose? Check out our Docker Compose tutorial.

Reviewer

Go to Main Menu