Docker Installation on Ubuntu

If you're using Ubuntu, you should use the official Docker package, which is called docker-ce (Docker Community Edition) for Ubuntu. Here's how you can install Docker on Ubuntu:

  1. Update the package list:

     sudo apt update
    
  2. Install the required dependencies:

     sudo apt install -y apt-transport-https ca-certificates curl software-properties-common
    
  3. Add the Docker repository:

     curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
     echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
    

    This will add the official Docker repository for Ubuntu.

  4. Update the package list again to include the Docker repository:

     sudo apt update
    
  5. Install Docker:

     sudo apt install docker-ce
    
  6. Start the Docker service and enable it to start on boot:

     sudo systemctl start docker
     sudo systemctl enable docker
    
  7. Verify that Docker is installed and running:

     sudo docker --version
    

This process should install Docker on your Ubuntu system using the official Docker package. Remember that the package name may vary for different Linux distributions, so it's essential to use the appropriate package name for your distribution when installing Docker.