Installation guides

Installing Docker on RHEL

Step-by-Step Guide

  1. Update the Package Index
    Open a terminal and update the package index to ensure you have the latest information about available packages:
   sudo yum update -y
  1. Install Required Packages
    Install the required packages for Docker:
   sudo yum install -y yum-utils device-mapper-persistent-data lvm2
  1. Add Docker Repository
    Add the Docker repository to your system:
   sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
  1. Install Docker
    Install Docker using the yum package manager:
   sudo yum install -y docker-ce docker-ce-cli containerd.io
  1. Start and Enable Docker
    Start the Docker service:
   sudo systemctl start docker

Enable Docker to start on boot:

   sudo systemctl enable docker
  1. Verify Docker Installation
    Check the Docker version to ensure it is installed correctly:
   docker --version

You should see the Docker version information displayed.

  1. Add Your User to the Docker Group (Optional)
    To run Docker commands without sudo, add your user to the Docker group:
   sudo usermod -aG docker $USER

Log out and log back in for the changes to take effect, or use the following command to apply the changes immediately:

   newgrp docker
  1. Test Docker Installation
    To test Docker, run the hello-world container:
   docker run hello-world

If Docker is installed correctly, you should see a message saying “Hello from Docker!”

  1. Install Docker Compose (Optional)
    Docker Compose is a tool for defining and running multi-container Docker applications. To install Docker Compose, download the binary:
   sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

Apply executable permissions to the binary:

   sudo chmod +x /usr/local/bin/docker-compose

Verify the installation:

   docker-compose --version
  1. Enable Docker at Boot
    Ensure Docker starts at boot:
    bash sudo systemctl enable docker
Other Recent Posts