Please bear in mind that the purpose of this guide is purely informational and as such cPanel, LLC will not assume responsibility for any potential adverse outcomes that might arise from its adoption. You may, therefore, wish to seek assistance from a qualified system administrator for further assistance regarding the provisioning and configuration of Docker Compose, as one would have the tools and knowledge in order to adjust this for you.
Run this command to download the current stable release of Docker Compose:
sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
To install a different version of Compose, substitute
1.29.2with the version of Compose you want to use.
Apply executable permissions to the binary:
sudo chmod +x /usr/local/bin/docker-compose
Note: If the command
docker-composefails after installation, check your path. You can also create a symbolic link to
/usr/binor any other directory in your path.
sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
Optionally, install command completion for the
Test the installation.
$ docker-compose --version docker-compose version 1.29.2, build 1110ad01
Note: You might run into the following error when checking the version of Docker-Compose:
docker-compose: error while loading shared libraries: libz.so.1: failed to map segment from shared object: Operation not permitted
This is a permission issue and you need to remount /tmp with the "exec" flag in order to get around it:
sudo mount /tmp -o remount,exec
Please bear in mind that remounting the /tmp file system with the "exec" flag is not considered to be good security best practice and therefore is not recommended by cPanel.
After this you should be able to check the version.
For further information about Docker compose's installation, you can refer to the instructions mentioned in the following link:
And any further assistance you should always reach out to Docker's support channels: