followed the link to install the docker-compose link

Basically, thee are only two steps as below:

Copysudo curl -L https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose

sudo chmod +x /usr/local/bin/docker-compose

docker-compose version
Answer from Santosh Garole on Stack Overflow
🌐
GitHub
gist.github.com › npearce › 6f3c7826c7499587f00957fee62f8ee9
Amazon Linux 2 - install docker & docker-compose using 'sudo amazon-linux-extras' command · GitHub
Amazon changed the install in Linux 2. One no-longer using 'yum' See: https://aws.amazon.com/amazon-linux-2/release-notes/ sudo amazon-linux-extras install docker sudo service docker start sudo usermod -a -G docker ec2-user ...
Discussions

Q: Installing docker-compose on Amazon EC2 Linux 2

Rather than dynamically looking up the OS type, just specify the linux version...

sudo curl -L https://github.com/docker/compose/releases/download/1.26.2/docker-compose-Linux-x86_64" -o /usr/local/bin/docker-compose
More on reddit.com
🌐 r/docker
12
1
September 2, 2020
Updating docker engine and docker compose plugin in Amazon Linux 2?
I have an Amazon AWS EC2 instance running Amazon Linux 2. It has Docker engine 25.0.5 installed (which is an old version that comes with Docker compose v2.3.3). Via yum, the docker package is already up to date. There exists a vulnerability in this version of Docker Engine (Docker Engine | ... More on forums.docker.com
🌐 forums.docker.com
4
0
November 20, 2024
Install docker compose v2 on aws linux 2 - Stack Overflow
CopyLast metadata expiration check: 2:53:00 ago on Sun Oct 1 22:27:32 2023. No match for argument: docker-compose-plugin Error: Unable to find a match: docker-compose-plugin ... Amazon Linux diverged from CentOS long ago. More on stackoverflow.com
🌐 stackoverflow.com
EC2 with docker services
Hello, I have some questions to ... better Amazon Linux or Ubuntu? 2- What would an initialization script be like, that is, user data to make a launch template with docker for both AMIs? 3- To keep the volumes persistent if the services go down or an error occurs, how is a reference from a docker-compose to a volume ... More on repost.aws
🌐 repost.aws
1
0
September 9, 2024
🌐
Medium
medium.com › @geeekfa › docker-and-docker-compose-on-aws-linux-2-9e90f79502db
Docker and Docker Compose on AWS Linux 2 | by GeeekFa | Medium
December 13, 2023 - Start by launching an AWS EC2 instance with the Amazon Linux 2 AMI. 3. Open a terminal and SSH to the AWS EC2 instance: ssh -i <YOUR_PRIVATE_KEY.pem> <YOUR_USER_NAME>@<THE_AWS_EC2_PUBLIC_DNS_ADDRESS> ... sudo yum install -y amazon-linux-extras sudo amazon-linux-extras install docker sudo systemctl start docker sudo usermod -a -G docker $USER sudo systemctl enable docker ... Close and reopen the terminal to run the following command. ... sudo curl -L https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose sudo chmod +x /usr/local/bin/docker-compose
🌐
nixCraft
cyberciti.biz › nixcraft › howto › amazon cloud computing › how to install docker on amazon linux 2
How to install Docker on Amazon Linux 2 - nixCraft
October 8, 2024 - This page explains how to install Docker and docker-compose on Amazon Linux 2 to containerized applications on AMI on EC2/Lightsail cloud.
🌐
Saturn Cloud
saturncloud.io › blog › how-to-install-dockercompose-on-amazon-ec2-linux-2-and-run-a-9kb-dockercompose-file
How to Install Docker-Compose on Amazon EC2 Linux 2 and Run a hello-world Docker-Compose File | Saturn Cloud Blog
May 1, 2026 - In this tutorial, we'll walk through the steps of installing Docker-Compose on an Amazon EC2 Linux 2 instance and running a hello-world Docker-Compose file. Docker-Compose is a tool for defining and managing multi-container Docker applications. It ...
🌐
Medium
medium.com › @fredmanre › how-to-configure-docker-docker-compose-in-aws-ec2-amazon-linux-2023-ami-ab4d10b2bcdc
How To configure Docker & Docker-Compose in AWS EC2 [Amazon Linux 2023 AMI] (Updated September, 2025) | by Freddy Manrique | Medium
September 26, 2025 - $-> 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 # finally $-> docker compose version
🌐
Reddit
reddit.com › r/docker › q: installing docker-compose on amazon ec2 linux 2
r/docker on Reddit: Q: Installing docker-compose on Amazon EC2 Linux 2
September 2, 2020 -

Hi,

First of all, let me state I'm not the most virtuous of Linux users, so bare with me...

Below is a brief run-down of all the steps I took. Ultimately the question/issue is is that it seems impossible for me to get a proper docker-compose installation downloaded.

  1. Followed instructions to install docker https://docs.aws.amazon.com/AmazonECS/latest/developerguide/docker-basics.html

sudo curl -L "https://github.com/docker/compose/releases/download/1.26.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

Tried 4 variations of the above command to try to install docker-compose. As shown in the URLs below.

https://www.codegrepper.com/code-examples/php/how+to+install+docker+compose+in+ec2
https://portal.cloud303.io/forum/aws-1/question/i-want-to-install-docker-compose-on-an-amazon-linux-2-ec2-instance-9
https://acloudxpert.com/how-to-install-docker-compose-on-amazon
https://gist.github.com/npearce/6f3c7826c7499587f00957fee62f8ee9

When typing "docker-compose", "sudo docker-compose" etc. All it will say is

 "Line 1: Not: command not found".

It seems to be the issue that the docker-compose file is only 9kb in size. Because this is what I get back every time I use the above mentioned docker-compose install sequences.

% Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100     9  100     9    0     0     58      0 --:--:-- --:--:-- --:--:--    58

This issue is sort of addressed here:
https://github.com/docker/compose/issues/6268

Where it is said that the OS is not supported or that we're running a 32bit instance, but of which seem to be strange because all the above tutorials are specifically for AWS EC2 Linux 2.

fwiw 'uname -m' returns aarch64.

So, does anyone have an idea of how to get a full-sized version of docker-compose instead of the 9kb file?

Thanks!

Find elsewhere
🌐
AWS
docs.aws.amazon.com › aws elastic beanstalk › developer guide › deploying with docker containers to elastic beanstalk › legacy platforms › migrating to elastic beanstalk docker running on amazon linux 2 from multi-container docker running on amazon linux
Migrating to Elastic Beanstalk Docker running on Amazon Linux 2 from Multi-container Docker running on Amazon Linux - AWS Elastic Beanstalk
After migrating, you will no longer have this limitation, because the Amazon Linux 2 Docker platform also allows Elastic Beanstalk to build your container images during deployment. Your applications will continue to run in multi-container environments with the added benefits from the Docker Compose ...
🌐
DevCoops
devcoops.com › install-docker-compose-on-amazon-linux-2
Install Docker Compose on Amazon Linux 2 | DevCoops
April 25, 2022 - Step 2. Move the Docker Compose file into the system binaries. sudo mv docker-compose-$(uname -s)-$(uname -m) /usr/local/bin/docker-compose · Step 3. Apply the right permissions. ... Step 4. Verify installation. ... Feel free to leave a comment below and if you find this tutorial useful, follow our official channel on Telegram. docker docker-compose containers aws aws ec2 amazon linux 2 linux cloud
🌐
Floating Cloud
floatingcloud.io › home › how to install docker and compose on amazon linux 2
How to install Docker and Compose on Amazon Linux 2 - Floating Cloud
March 28, 2023 - Log in to your Amazon Linux 2 instance. Open a terminal and run the following command to update your system: ... Install the required packages: Docker, containerd, git, and screen, by running the following command: ... wget https://github.c...
🌐
Docker Community
forums.docker.com › docker engine › general
Updating docker engine and docker compose plugin in Amazon Linux 2? - General - Docker Community Forums
November 20, 2024 - I have an Amazon AWS EC2 instance running Amazon Linux 2. It has Docker engine 25.0.5 installed (which is an old version that comes with Docker compose v2.3.3). Via yum, the docker package is already up to date. There …
🌐
AWS re:Post
repost.aws › questions › QUcH0NvVJ_TQ282DssLg2AfQ › ec2-with-docker-services
EC2 with docker services | AWS re:Post
September 9, 2024 - For both Amazon Linux 2 and Ubuntu, you can add a user data script in the EC2 launch template to automate the installation and setup of Docker and Docker Compose.
Top answer
1 of 1
1

Hope you are having a great day. I faced the same issue.

The issue is that you are using community.docker.docker_compose_v2 with docker compose version 1. I would like to say that I don't recommend you go back to community.docker.docker_compose as it is deprecated.

I am facing the same issue with Amazon Linux and I got could get around by two ways. not ideal but it is temporary:

1st work around:

Copy    - name: Start containers from compose 
  ansible.builtin.command:
    cmd: docker-compose up -d

2nd work around:

Copy      become: yes
  vars_files:
    - project-vars
  tasks:
    - name: Copy Docker compose
      copy: 
        src: /root/ansible/Ansible/docker-compose.yaml
        dest: /home/ec2-user  
    - name: Docker login
      docker_login:
        registry_url: https://index.docker.io/v1
        username: ibrahimosama
        password: "{{docker_password}}"
    - name: Start containers from compose 
      community.docker.docker_compose_v2:
        project_src: /home/ec2-user

The ultimate fix is to install docker compose version 2 instead:

Copy    - name: Install docker compose V2 
  hosts: ec2
  become: yes
  tasks:
    - name: Create directory for Docker CLI plugins
      file:
        path: /usr/local/lib/docker/cli-plugins
        state: directory
        mode: '0755'
    - name: Download Docker Compose V2 binary
      get_url:
        url: https://github.com/docker/compose/releases/download/v2.18.0/docker-compose-linux-x86_64
        dest: /usr/local/lib/docker/cli-plugins/docker-compose
        mode: '0755'
    - name: Make Docker Compose binary executable
      file:
        path: /usr/local/lib/docker/cli-plugins/docker-compose
        mode: '0755'
    - name: Verify Docker Compose installation
      command: docker compose version
      register: docker_compose_version
      ignore_errors: yes
    - name: Show Docker Compose version
      debug:
        msg: "{{ docker_compose_version.stdout }}"
      when: docker_compose_version.rc == 0

My full project is on https://github.com/ibrahim-osama-amin/Ansible/blob/main/deploy-docker.yaml

🌐
GitHub
gist.github.com › thimslugga › 36019e15b2a47a48c495b661d18faa6d
Setup Docker on Amazon Linux 2023 · GitHub
The following guide is for setting up Docker with docker-compose v2 on Amazon Linux 2023.
🌐
GitHub
gist.github.com › basaran › c5d2829b05b8f0ca64e59f41104f488f
Setup Docker and docker-compose on Amazon Linux 2023 · GitHub
mkdir -p "$HOME/.docker/cli-plugins" touch "$HOME/.docker/config.json" cp /usr/local/lib/docker/cli-plugins/docker-compose "$HOME/.docker/cli-plugins/docker-compose" touch ~/.{bashrc,bash_profile,bash_login,bash_logout} cat <<'EOF' | tee -a "${HOME}/.bashrc" #export DOCKER_CONFIG=/usr/local/lib/docker export DOCKER_CONFIG="${DOCKER_CONFIG:-$HOME/.docker}" EOF · Verify the plugin is installed correctly with the following command(s): ... aws ecr-public get-login-password --region us-east-1 \ | docker login \ --username AWS \ --password-stdin public.ecr.aws ... docker pull public.ecr.aws/amazonlinux/amazonlinux:2023 docker run -it \ --security-opt seccomp=unconfined \ public.ecr.aws/amazonlinux/amazonlinux:2023 /bin/bash
Top answer
1 of 5
4
Here is what has worked for me: ``` sudo dnf update -y # Remove old version sudo dnf remove -y docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate docker-logrotate docker-engine # Install dnf plugin sudo dnf -y install dnf-plugins-core # Add CentOS repository sudo dnf config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo # Adjust release server version in the path as it will not match with Amazon Linux 2023 sudo sed -i 's/$releasever/9/g' /etc/yum.repos.d/docker-ce.repo # Install as usual sudo dnf -y install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin # Enable the docker service sudo systemctl enable --now docker ```
2 of 5
1
`My EC2 VM currently has Docker version 25.0.5, build 5dc9bcc installed, but this version has a security flaw that has been patched in versions 27.1.1 and above.` Are you referring to CVE-2024-41110? Affected versions include `<= v25.0.5` and `<= v27.1.0` You can refer to Amazon Linux Security Center ALAS-2024-674 which mentions `AWS is aware of CVE-2024-41110, an issue affecting the Moby open source project, packaged in Amazon Linux as "docker". Docker is a component of several open source container management systems.` `Updated docker packages addressing the issue are available for Amazon Linux 2 (docker-20.10.25-1.amzn2.0.5 and docker-25.0.6-1.amzn2.0.1) and for Amazon Linux 2023 (docker-25.0.6-1amzn2023.0.1). AWS recommends that customers using docker upgrade to these or later versions. (CVE-2024-41110)` On my AL2023, docker 25.0.6 is installed ``` $ cat /etc/os-release | grep PRETTY PRETTY_NAME="Amazon Linux 2023.6.20241121" $ dnf info docker Installed Packages Name : docker Version : 25.0.6 Release : 1.amzn2023.0.2 Architecture : aarch64 Size : 150 M Source : docker-25.0.6-1.amzn2023.0.2.src.rpm Repository : @System From repo : amazonlinux Summary : Automates deployment of containerized applications URL : http://www.docker.com License : ASL 2.0 and MIT and BSD and MPLv2.0 and WTFPL Description : Docker is an open-source engine that automates the deployment of any : application as a lightweight, portable, self-sufficient container that will : run virtually anywhere. : : Docker containers can encapsulate any payload, and will run consistently on : and between virtually any server. The same container that a developer builds : and tests on a laptop will run at scale, in production*, on VMs, bare-metal : servers, OpenStack clusters, public instances, or combinations of the above. ```