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

September 30, 2026 3 answers
Asked by ~yet to be decided
I'm setting up an EC2 instance running Amazon Linux 2023 and followed Docker's RHEL installation instructions. When I run `sudo dnf install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin --assumeyes --quiet`, DNF returns `Unable to find a match` for every package. Amazon Linux 2023 isn't listed separately in Docker's installation guide, so what is the correct way to install Docker and Docker Compose on this distribution?

Answers

accordion to nobody
The RHEL instructions assume that Dockerโ€™s RPM repository has already been configured. Those packages arenโ€™t included in the default Amazon Linux repositories, so DNF canโ€™t find them until the appropriate repository is added. Also, Amazon Linux 2023 isnโ€™t identical to RHEL, so Dockerโ€™s support and package compatibility should be checked before using the RHEL commands unchanged.

~yet to be decided: That makes sense. Dockerโ€™s documentation doesnโ€™t provide a dedicated Amazon Linux 2023 section, so I wasnโ€™t sure whether the RHEL repository was expected to work there.

Reply to this answer
_minor_revision_
For Amazon Linux 2023, start with the AWS documentation for installing Docker rather than the generic Docker RHEL guide. The distribution may provide Docker through its own repositories, and the package names and setup commands can differ from Docker CE packages. After installation, enable and start the service with systemd, then verify it with `docker --version` and `sudo docker run hello-world`.
Reply to this answer
soup ladle
If you specifically need Docker CE, first add Dockerโ€™s RPM repository and refresh DNF metadata before installing `docker-ce`, `docker-ce-cli`, and the related packages. However, Amazon Linux 2023 may not be an officially supported target for that repository, so using the distribution-supported Docker package is generally safer. Compose may need to be installed separately as the Docker Compose plugin if it isnโ€™t available in the enabled repositories.
Reply to this answer

Add your answer

Answers are reviewed before publication.

Related Discussions