I'm trying to find a way to install Docker Compose using the 'yum' package manager on Amazon Linux 2023, but I'm running into issues. The installation instructions say it should be available, but I'm getting a message that there's no match for the 'docker-compose-plugin'. I'm not sure if I need to add a repository or something else to find it. Just for context, I'm using Docker version 25.0.14, which was pre-installed on my Lightsail instance. I'd prefer to install Docker Compose this way if possible.
3 Answers
I remember needing to replace 'yum' with 'dnf' for similar installations. You might try updating with these commands:
sudo dnf update -y
sudo dnf install -y docker
sudo usermod -a -G docker your_username
newgrp docker
# reboot
After that, check the version with 'docker compose version'. It might work without needing a separate install for Compose.
Just to confirm, Docker on AWS Linux does not come with the Compose plugin. You'll definitely need to install it manually as others have suggested.
The only way I found to install Docker Compose on Amazon Linux 2023 is through a manual process. You can do this by running these commands:
sudo mkdir -p /usr/libexec/docker/cli-plugins
sudo curl -SL https://github.com/docker/compose/releases/latest/download/docker-compose-linux-$(uname -m) -o /usr/libexec/docker/cli-plugins/docker-compose
sudo chmod +x /usr/libexec/docker/cli-plugins/docker-compose

I already have Docker installed as part of Amazon Linux 2023, and it doesn't include the Compose plugin by default. So, my only option was a separate installation.