How to Manually Install the Latest Docker Compose Version on Linux (original) (raw)
Sign in to your MUO account
Docker Compose is available in the standard repositories on most distros. However, the most recent repository versions tend to be several versions behind the latest release.
This is increasingly becoming a problem and can throw a variety of errors that require workarounds. Here's how to install the latest version of Docker Compose on Linux.
Docker Compose Simplifies Your Life
Docker is an essential containerization tool that allows you to deploy software on your Linux PC or server without the risk that it will interfere with other apps you have installed.
It makes it easy to configure an environment for your software to run in, and can download images and automatically set up containers—all with a single compound command.
The Docker Compose add-on makes life even easier. With it, you can define environments in a YAML text file, then use short commands to manage them.
If you self-host projects on a Raspberry Pi, it's invaluable. You can even run entire operating systems, Ubuntu, for instance, as Docker containers.
Why Not Use the Repo Release of Docker Compose?
While it's easy to install Docker Compose on Linux, development moves fast, and there are multiple different versions of Docker Compose in active use today.
The schema and syntax they use is not always compatible, and as you spin up containers, you may encounter errors such as "services.web.depends_on contains an invalid type, it should be an array " or "Unsupported config option for networks".
Many of these errors relate to features that have been deprecated or added since your version of Docker Compose was released. While fiddling around and changing the version number in your docker-compose.yaml file or intensively searching for very specific errors can sometimes yield results, it's not the best option.
The most recent Docker Compose releases treat version numbers as advisory only, and will usually work seamlessly with YAML files created for previous releases of Docker Compose.
As the standard repository releases of Docker Compose tend to lag behind the most recent, you may have to install Docker Compose manually.
How to Install Docker Compose Manually
You can find the most recent Docker Compose release on the project's official GitHub Releases page.
Download: Docker Compose
Before you start, you should uninstall the version of Docker Compose you installed with your package manager. If you installed Docker Compose using APT, for instance, open a terminal and enter:
`sudo apt remove docker-compose`
Visit the GitHub Releases page in your browser, and select your system architecture from the list. Most modern desktop PCs will require the docker-compose-linux-x86_64 package. This might be hidden, and you may have to click Show all assets to find it.
For recent 64-bit Raspberry Pis, choose docker-compose-linux-aarch64, and for older ARM architecture, look for docker-compose-linux-armv7 or docker-compose-linux-armv6.
Right-click on the release you want, and then choose Copy link.
Now return to your terminal, and use the wget command to download the binary:
`wget https://github.com/docker/compose/releases/download/v2.19.1/docker-compose-linux-x86_64`
Rename the downloaded file, move it into a location in your PATH, and make it executable:
`sudo mv docker-compose-linux-x86_64 /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose`
Finally, check the version of Docker Compose that's installed with:
`docker-compose -v`
You would now have the latest Docker Compose release installed on your Linux PC.
Use Docker Compose to Run Some Great Projects
With an up-to-date Docker Compose release, you'll find that your projects and containerized apps run more smoothly.
If you find managing multiple Docker containers too onerous, even with Docker Compose, there are easy-to-use tools that can simplify the administration for you.