AMZ DIGICOM

Digital Communication

AMZ DIGICOM

Digital Communication

Install Docker Compose on Mac

PARTAGEZ

Docker Compose makes it easy to management and orchestration of your Docker containers. This tool, which is installed on MacOS in a few steps using the MacOS terminal, constitutes a relevant complement to container management with Docker.

Step 1: Install Docker

Before you begin installing Docker Compose on your Mac, make sure you have downloaded and installed Docker. This simple command from the terminal allows you to check if this is indeed the case:

If the program is already present, you will see the version of Docker displayed.

Screenshot of Mac terminal after running docker –version
In the terminal on Mac, it is possible to consult the version of Docker installed.

Otherwise, download Docker for your operating system from the Docker official website. When doing this, be sure to select the correct microprocessor : in fact, Apple computers equipped with an Apple chip differ from those equipped with an Intel chip. Once the file is downloaded, open it and follow the instructions in the installation wizard to finish installing Docker. If you have any questions during the process, Docker tutorials are here to help.

Step 2: Download Docker Compose for Mac

Now it’s time to move on to installing Docker Compose. This is done directly from the terminal. Open a terminal window on your Mac and enter the following command to download the last 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

This command may result in an error message: perhaps you do not have write permission in the required directory. If applicable, start the installation process from a super user profile or admin. To do this, enter the following command in the terminal:

Then repeat step 2 of the instructions and continue with the following steps.

Docker Compose is not only available for Mac. If you want to work with Docker under another operating system, check out our tutorials to help you download and install Docker Compose:

Step 3: Mark Docker Compose as executable file

To use Docker Compose, you will first need to make the program executable by modifying the rights. To do this, use the terminal command chmod :

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

bash

The parameter +x means executable and allows you to make Docker Compose an executable program.

Step 4: Verify that the installation was successful

To ensure that the installation of Docker Compose under MacOS was done without errors, simply call * in the terminalcurrent version of Docker Compose :

docker compose version

bash

If the process was successful, your system should then display the installed version of Docker Compose in the terminal window.

Screenshot of Mac terminal after running docker compose version
It is possible to view the version of Docker Compose installed from the Mac terminal.

If no version appears but you see an error message, this means that the installation did not complete normally. In this case, it is recommended to repeat the installation steps.

To learn how to use Docker Compose, check out our Docker Compose tutorial.

Télécharger notre livre blanc

Comment construire une stratégie de marketing digital ?

Le guide indispensable pour promouvoir votre marque en ligne

En savoir plus

Souhaitez vous Booster votre Business?

écrivez-nous et restez en contact