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?
3 Answers
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.
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`.
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.

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.