Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

For a current CentOS installation, use CentOS Stream 9 or 10, Docker’s official CentOS repository, and the Docker Engine package set. CentOS Linux 7 and 8 instructions are legacy guidance. RHEL 8, 9, and 10 have a separate repository procedure; Rocky Linux and AlmaLinux can often use the corresponding RHEL-family method, but Docker says derivative distributions are not tested or verified, so validate the result against the exact release and your support policy.

Which CentOS-era platform should you use?

CentOS Linux was replaced by CentOS Stream. Docker’s current CentOS installation documentation names CentOS Stream 10 and CentOS Stream 9 as its supported CentOS versions. A guide written for CentOS Linux 7 or 8 may contain commands that no longer match current repositories, package availability, or security-update expectations.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The practical choice is therefore:

  • CentOS Stream 10 or 9: follow the CentOS repository procedure below.
  • RHEL 8, 9, or 10: use Docker’s RHEL repository and remove conflicting packages such as Podman and runc when they are installed.
  • Rocky Linux or AlmaLinux: treat the RHEL-family procedure as a compatibility path, not as a Docker-verified platform. Test it on the exact release you operate before placing it in production.
  • CentOS Linux 7 or 8: plan a migration rather than building a new Docker host from old instructions.
Platform Docker documentation position Repository path Architectures named by Docker Important qualification
CentOS Stream 10 Supported download.docker.com/linux/centos/docker-ce.repo x86_64/amd64, arm64/aarch64, ppc64le Enablement of centos-extras is expected; Docker says it is enabled by default.
CentOS Stream 9 Supported download.docker.com/linux/centos/docker-ce.repo x86_64/amd64, arm64/aarch64, ppc64le Use the current Stream repositories, not CentOS Linux 7/8 directions.
RHEL 10 Supported download.docker.com/linux/rhel/docker-ce.repo x86_64/amd64, arm64/aarch64, s390x Remove conflicting podman and runc packages where present.
RHEL 9 Supported download.docker.com/linux/rhel/docker-ce.repo x86_64/amd64, arm64/aarch64, s390x Use the RHEL repository rather than the CentOS repository.
RHEL 8 Supported download.docker.com/linux/rhel/docker-ce.repo x86_64/amd64, arm64/aarch64, s390x Check your organization’s RHEL subscription and support requirements separately.
Rocky Linux or AlmaLinux Derivative; not tested or verified by Docker Usually the RHEL-family repository procedure Depends on the exact distribution build Validate package dependencies, updates, security policy, and vendor support before production use.

The table separates what Docker explicitly documents from what administrators commonly do on compatible RHEL-family systems. Docker’s general platform guidance says that derivative distributions may work but are not tested or verified. That distinction matters when you need a supportable incident path or a vendor-backed production configuration.

Prepare a CentOS Stream host

Log in with an account that can use sudo. Confirm the release and architecture before changing packages:

cat /etc/centos-release
uname -m

For a supported CentOS procedure, the release should identify CentOS Stream 9 or 10. The architecture output should match the image and application workload you intend to run. Record any existing containers and storage locations before removing packages, especially on a host that may already run a container engine.

CentOS Stream’s centos-extras repository is required by Docker’s instructions and is enabled by default. If your image-management policy disabled it, restore that repository according to your organization’s repository policy before continuing.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Install Docker Engine on CentOS Stream 9 or 10

1. Remove conflicting Docker packages

Removing older or differently packaged Docker components prevents a mixed installation. Run:

sudo dnf remove docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate docker-logrotate docker-engine

This command removes matching packages only. Docker states that it does not automatically delete images, containers, volumes, or networks stored under /var/lib/docker/. Review the transaction before accepting it, and do not assume that package removal is a data backup.

2. Add Docker’s official repository

Install the DNF repository-management plugin, then add Docker’s CentOS repository:

sudo dnf -y install dnf-plugins-core
sudo dnf config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo

The repository method is Docker’s recommended routine installation method because it exposes package updates through DNF. If your organization mirrors external repositories, import or mirror this repository through that controlled process instead of bypassing it.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

3. Install Engine, containerd, Buildx, and Compose

Install the complete package set Docker documents for the current Engine workflow:

sudo dnf install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

The packages provide the daemon, command-line client, container runtime, Buildx builder, and Compose plugin. DNF may ask you to accept a GPG key. Docker instructs you to verify this fingerprint before accepting it:

060A 61C5 1B55 8A7F 742B 77AA C52F EB6B 621E 9F35

Package installation creates the docker group, but it does not add users to that group and it does not start the service.

4. Start Docker and enable it at boot

For a normal server installation, start the daemon now and configure automatic startup:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
sudo systemctl enable --now docker

If a separate service manager or orchestration system should control startup, start it without enabling boot-time activation:

sudo systemctl start docker

Check the service state if the command returns an error:

sudo systemctl status docker --no-pager

5. Run Docker’s smoke test

Verify the daemon, client, image download path, and basic container execution with:

sudo docker run hello-world

Docker says this command downloads a test image, runs it, prints a confirmation message, and exits. A successful result confirms the basic installation, but it does not test your application images, storage driver, registry authentication, network policy, or production security controls.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Enable non-root Docker use safely

A newly installed docker group has no members. If an ordinary user runs docker ps immediately, the command can fail with a permission error because the Docker socket is normally protected for privileged access.

Docker documents post-install steps for adding a user to the group and also documents rootless mode for users who need a daemon without root privileges. Treat group membership as a privilege decision: access to the Docker daemon can effectively provide host-level control. Review your organization’s access model before adding users, and log out and back in after any group change so the new session receives the updated membership.

Rootless mode has a different operating model and should be evaluated separately for service management, networking, storage, and application compatibility. Do not present it as merely a permission toggle for an existing rootful daemon.

Install Docker Engine on RHEL 8, 9, or 10

RHEL uses Docker’s RHEL repository, not the CentOS repository. Confirm the release first:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
cat /etc/redhat-release
uname -m

1. Remove conflicting packages

Docker’s RHEL procedure includes common Docker package names plus Podman and runc:

sudo dnf remove docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate docker-logrotate docker-engine podman runc

Read DNF’s proposed transaction carefully. Removing Podman or runc can affect workloads or services that depend on them. Schedule the change, stop dependent applications, and confirm that you have a rollback or migration plan before accepting removal.

2. Add the RHEL repository

sudo dnf -y install dnf-plugins-core
sudo dnf config-manager --add-repo https://download.docker.com/linux/rhel/docker-ce.repo

3. Install and start Docker

sudo dnf install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
sudo systemctl enable --now docker
sudo docker run hello-world

The same package set and smoke test apply, but repository metadata and dependency resolution come from the RHEL path. Confirm that your RHEL subscription, internal mirrors, and security baseline permit the resulting packages.

Use Rocky Linux or AlmaLinux as a CentOS successor

Rocky Linux and AlmaLinux are RHEL-family distributions frequently selected for workloads that previously ran on CentOS Linux. Their package layouts often make the RHEL procedure a useful starting point:

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  1. Confirm the exact distribution and major version with /etc/os-release.
  2. Review whether your release supports the required Docker repository and architecture.
  3. Use the RHEL-family repository procedure only after checking repository compatibility and package dependencies.
  4. Run sudo docker run hello-world, then test your actual images, Compose files, storage, networking, and security controls.
  5. Document who supports the operating system, Docker packages, kernel, and container workloads when an incident occurs.

Docker explicitly warns that derivative distributions are not tested or verified. A successful test container is evidence that this host works; it is not a statement that every release, update, kernel, or support combination is certified.

Install from RPMs on an air-gapped RHEL host

Repository installation is simplest when the server can reach a repository. For an air-gapped system, Docker documents manual RPM installation:

  1. From a connected system, download matching RPMs from Docker’s RHEL repository: containerd.io, docker-ce, docker-ce-cli, docker-buildx-plugin, and docker-compose-plugin.
  2. Transfer the RPM files and any required dependencies through your approved media or artifact pipeline.
  3. Install the local files with DNF, using the actual filenames:
sudo dnf install ./containerd.io-*.rpm ./docker-ce-*.rpm ./docker-ce-cli-*.rpm ./docker-buildx-plugin-*.rpm ./docker-compose-plugin-*.rpm

Pinning exact filenames is preferable in a controlled build because it makes the installed versions auditable. After installation, enable and verify the service:

sudo systemctl enable --now docker
sudo docker run hello-world

Maintain a repeatable process for refreshing those RPMs and their dependencies. An air-gapped installation does not remove the need for vulnerability review or update planning.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Upgrade Docker without changing installation methods casually

For a repository installation, repeat the repository-based installation procedure and select the desired newer package version through DNF. Before upgrading a production host, review release notes, test a representative workload, and confirm that your image, volume, and Compose backups are usable.

For manually downloaded RPMs, download the newer matching files and use DNF to upgrade them. Keep the package set aligned; upgrading only the daemon while leaving the CLI or plugins at unrelated versions can make troubleshooting harder.

Docker’s convenience script is available at https://get.docker.com, but Docker does not recommend it for production. The script installs dependencies without confirmation, can cause unexpected major upgrades, and is not designed to upgrade an existing installation. If you use it for development or a provisioning experiment, preview it first with:

curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh --dry-run

For managed servers, the explicit repository and package commands are easier to review, pin, audit, and reproduce.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Uninstall Docker and understand what remains

Remove Docker’s packages with:

sudo dnf remove docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin docker-ce-rootless-extras

Docker states that package removal does not automatically remove images, containers, volumes, or custom configuration. This behavior allows a later reinstall without immediately destroying local state, but it also means sensitive or large data can remain on disk.

If you intentionally want to erase all local Docker data, stop the service first and remove the data directories only after confirming backups and the destructive scope:

sudo systemctl stop docker
sudo rm -rf /var/lib/docker /var/lib/containerd

Deleting those directories removes local images, containers, volumes, networks, and containerd state. Treat the command as irreversible from the host’s perspective; export anything you need before running it.

Troubleshoot the most common installation failures

DNF reports package conflicts

Inspect installed container packages and repeat the conflict-removal step. On RHEL, check specifically for podman and runc. Do not blindly accept a transaction that removes an application dependency; identify the service using it and schedule the change.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The repository cannot be added or has no matching packages

Check the release and architecture, verify outbound access or your internal mirror, and confirm that you used the CentOS repository for CentOS Stream or the RHEL repository for RHEL. A CentOS Linux 7/8 host may be following obsolete instructions rather than a currently documented baseline.

DNF asks for a different GPG key

Stop and verify the key fingerprint rather than accepting an unexpected key. For the CentOS procedure, Docker gives 060A 61C5 1B55 8A7F 742B 77AA C52F EB6B 621E 9F35 as the fingerprint to check. A mismatch should be resolved through your repository or security administrator.

The service is installed but not running

Package installation does not start Docker automatically. Run sudo systemctl enable --now docker, then inspect sudo systemctl status docker --no-pager. If it still fails, read the service journal with sudo journalctl -u docker -b and correct the reported dependency, configuration, storage, or permission problem before retrying.

docker works only with sudo

This is expected until you configure an access method. Review Docker’s post-install group guidance or evaluate rootless mode. Do not weaken socket permissions globally as a shortcut.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The smoke test downloads but application containers fail

hello-world proves only basic daemon operation. Check the application image architecture, registry credentials, required ports, volumes, environment variables, Compose version, and host security policy separately. A successful installation does not guarantee that an application designed for another architecture or distribution will run unchanged.

Migrate a legacy CentOS Linux Docker host

A migration from CentOS Linux 7 or 8 is an operating-system project as well as a Docker project. Do not treat it as a simple repository URL edit.

  1. Inventory images, containers, named volumes, bind mounts, networks, Compose files, secrets, firewall rules, and service dependencies.
  2. Export application data and verify that backups can be restored on a test host.
  3. Choose CentOS Stream 9 or 10, RHEL 8/9/10, or a validated RHEL-family successor according to your lifecycle and support requirements.
  4. Build a clean target host and install Docker using the matching repository procedure.
  5. Restore configuration and data, pull or import the correct image architectures, and run application-level tests.
  6. Move traffic only after health checks, logging, scheduled jobs, backups, and rollback procedures have been verified.

This approach avoids carrying obsolete repositories and unknown package state into a new operating-system generation. Keep the old host intact until the new host has passed your acceptance checks and the rollback window has ended.

What a supportable installation looks like

  • The host is CentOS Stream 9/10 or RHEL 8/9/10, or a derivative whose exact release has been validated.
  • The correct Docker repository is configured for the operating system.
  • The required package set is installed together: Engine, CLI, containerd, Buildx, and Compose.
  • The GPG key is verified before package trust is accepted.
  • The service is explicitly started and its boot behavior is intentional.
  • sudo docker run hello-world succeeds, followed by tests of real workloads.
  • Non-root access is granted only after its security implications are understood.
  • Upgrade, backup, uninstall, and data-erasure procedures are documented.

For most new deployments, CentOS Stream 9 or 10 is the direct CentOS path, while RHEL 8–10 is the directly documented enterprise path. Rocky Linux and AlmaLinux may be practical successors for CentOS Linux workloads, but their use with Docker should remain an explicitly validated compatibility decision rather than an assumed certification.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.