If you are receiving the error message “docker-compose: command not found” it means that the docker-compose utility is not installed on your system or it is not in your system’s PATH environment variable.
To resolve this issue, you can try the following steps:
Install docker-compose if it is not already installed. You can download and install docker-compose from the official Docker website: https://docs.docker.com/compose/install/
After installation, make sure to restart your terminal or shell to update your environment variables with the new installation.
Verify that docker-compose is now working by running the following command:
docker-compose --version
This should display the version number of docker-compose installed on your system.
- If step 3 did not work, check if docker-compose executable file exists in /usr/local/bin/ directory. If it doesn’t exist, create a symbolic link for it using below command
sudo ln -s /path/to/docker/compose /usr/local/bin/docker-compose
Replace “/path/to/docker/compose” with the actual path to where docker-compose is installed on your system.
- Finally verify that you have added correct path by executing
echo $PATH
and check if above path exists there or not.
By following these steps, you should be able to resolve “docker-compose: command not found” error and use Docker Compose utility on your system without any issues.