Frequently Asked Question

Installing Docker on Linux
Last Updated 4 days ago

Installing Docker on Linux

Installing Docker on RHEL-Based Distributions

To install Docker on Red Hat Enterprise Linux (RHEL) and its variants, such as CentOS or Fedora, follow these steps:

   sudo dnf install -y dnf-plugins-core
  1. Install the Required Package Manager Plugin:
   sudo dnf config-manager --add-repo https://download.docker.com/linux/rhel/docker-ce.repo
  1. Add the Docker Repository:
   sudo dnf install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
  1. Install Docker CE and Related Packages:
   sudo systemctl enable --now docker
  1. Start the Docker Service and Enable It to Start on Boot:
   sudo usermod -aG docker $USER
  1. Add Your User to the Docker Group:

Installing Docker on Debian-Based Distributions

To install Docker on Debian-based distributions, such as Ubuntu or Linux Mint, follow these steps:

   sudo apt-get update
   sudo apt-get install -y apt-transport-https ca-certificates curl gnupg lsb-release
  1. Update and Install Required Packages:
   curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
  1. Add Docker’s Official GPG Key to Your Package Management System:
   echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
  1. Add the Docker Repository:
   sudo apt-get update
   sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin
  1. Update the Package Index and Install Docker:
   sudo systemctl enable --now docker
  1. Start the Docker Service and Enable It to Start on Boot:
   sudo usermod -aG docker $USER
  1. Add Your User to the Docker Group (Optional):

Troubleshooting Tips

  • Ensure that your system is up-to-date before installing Docker.
  • Verify if your distribution is supported by checking the official Docker documentation.
  • If you encounter permission issues, log out and back in after adding yourself to the docker group.

By following these steps, you should be able to install and configure Docker on both RHEL-based and Debian-based distributions.

This answer was generated by GEN's AI assistant and may not be 100% accurate. If you are unsure about any information provided, please raise a support ticket for clarification.
This website relies on temporary cookies to function, but no personal data is ever stored in the cookies.
OK
Powered by GEN UK CLEAN GREEN ENERGY

Loading ...