SoFunction
Updated on 2025-03-10

Note: -bash: docker-compose: command not found Problem solution

docker-compose: command not foundError indicates that the system cannot be founddocker-composeOrder. This may be becausedocker-composeIt is not installed correctly, or the path to its executable is not included in the system's PATH variable.

Here is the solution when I encounter it:

1. Make sure Docker and Docker Compose are installed:
First, make sure you have Docker and Docker Compose installed correctly. You can download and install them from the official Docker website.

2. Check whether it is in PATH:
make suredocker-composeThe path to which the executable file is located is contained in the system's PATH environment variable.

which docker-compose

If installed successfully and in PATH, you can seedocker-composeThe path to the executable file.

3. Manually install Docker Compose:
If you finddocker-composeIt is not installed or in PATH, and can be manually installed.

sudo curl -L "/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose

Note: Administrator is required to run orsudo

4. Restart the terminal:
After the installation is complete, close the current terminal and reopen a new terminal to ensure that the new PATH environment variable takes effect.

5. Verify installation:
Execute the following command to verifydocker-composeIs it installed correctly:

docker-compose --version

Installation is successful and should be displayeddocker-composeversion information.

This is the article about solving the problem of -bash: docker-compose: command not found. For more related docker-compose: command not found, please search for my previous articles or continue browsing the related articles below. I hope everyone will support me in the future!