You can read lots of blogs about this. This is the simple minimal version 🙂
Assuming you’re doing everything as root, but if you aren’t then prefix these commands with sudo as appropriate for your environment.
dnf config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
dnf install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
systemctl enable --now docker
That’s it. Done. Now if you want to allow non-root users to use docker.
usermod -aG docker user # user is the non-root user you want to be able to use docker