Skip to main content

Fix "unable to locate package docker-compose-plugin"

If you are trying to install Docker Compose on Ubuntu or Debian and see this error:

E: Unable to locate package docker-compose-plugin

It means your package manager (apt) cannot find the docker-compose-plugin package in your configured repositories. This usually happens because you are using the default OS repositories instead of the official Docker repository.

The Fix

To fix this, you need to set up the official Docker repository.

1. Update apt and install prerequisites

sudo apt-get update
sudo apt-get install ca-certificates curl gnupg

2. Add Docker's GPG key

sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg

3. Add the repository

echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

4. Update and Install

Now that the repository is added, update the package index and install the plugin:

sudo apt-get update
sudo apt-get install docker-compose-plugin

5. Verify

Check if it works:

docker compose version

Why did this happen?

The docker-compose-plugin package is specific to Docker's modern installation method (Docker Desktop or Docker Engine via their repo). Older guides might suggest installing docker-compose (the standalone python binary), but the modern standard is the plugin which adds the compose subcommand to the docker CLI.

Still stuck?

If you just want to get your app running without fighting Linux package managers, try Hostim.

Deploy on Hostim

Hostim.dev gives you a pre-configured Docker environment. Just bring your code or Compose file.