How do I install Docker and Docker Compose on Amazon Linux 2023?

September 30, 2026 4 answers
Asked by MellowPine47
I'm setting up an Amazon Linux 2023 instance and followed Docker's installation instructions for RHEL. However, running `sudo dnf install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin --assumeyes --quiet` fails with `Unable to find a match` for every package. What is the correct way to install Docker and Docker Compose on Amazon Linux 2023?

Answers

QuietMaple6
The packages in that command arenโ€™t part of the default Amazon Linux repositories. You need to configure an appropriate RPM repository before trying to install `docker-ce`, or use the Docker package provided through Amazon Linux if it meets your needs. After installation, start and enable the service with `sudo systemctl enable --now docker`, then add your account to the Docker group with `sudo usermod -aG docker ec2-user` and sign in again.
Reply to this answer
CedarFox_82
Amazon Linux 2023 isnโ€™t the same distribution as RHEL, even though both use RPM packages and DNF. The Docker CE packages wonโ€™t be available until you add a compatible Docker repository, and the RHEL instructions arenโ€™t guaranteed to work on Amazon Linux. Start with AWSโ€™s Amazon Linux or Docker installation instructions instead of installing the CE packages blindly.

MellowPine47: Docker doesnโ€™t provide a dedicated Amazon Linux section, so I was unsure whether the RHEL or CentOS instructions were supposed to apply.

Reply to this answer
OrbitingKite29
AWSโ€™s Docker setup documentation is the better starting point for Amazon Linux. It covers installing the distribution-supported Docker package, starting the daemon, and configuring access for the `ec2-user`. Docker Compose may need to be installed separately as the Compose plugin, depending on which Docker package and repositories you use; verify it afterward with `docker compose version`.
Reply to this answer
BrightWalrus5
Installing from the Ubuntu instructions wonโ€™t fix this because Ubuntu uses APT while Amazon Linux uses RPM and DNF. The important part is adding a repository that actually publishes packages for your operating system, or using Amazon Linuxโ€™s own Docker package. If you specifically need Docker CE, configure Dockerโ€™s RPM repository only after confirming that its packages support Amazon Linux 2023.
Reply to this answer

Add your answer

Answers are reviewed before publication.

Related Discussions