Installing Docker

Installing Docker on Ubuntu/Debian #

  1. Update the apt package index:

    sudo apt-get update
    
  2. Install packages to allow apt to use a repository over HTTPS:

    sudo apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common
    
  3. Add Docker’s official GPG key:

    curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
    
  4. Set up the stable Docker repository:

    sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
    
  5. Update the apt package index:

    sudo apt-get update
    
  6. Install Docker:

    sudo apt-get install docker-ce docker-ce-cli containerd.io
    

Installing Docker on Centos #

  1. Uninstall old versions:

    sudo yum remove docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate docker-logrotate docker-engine
    
  2. Install required packages:

    sudo yum install -y yum-utils device-mapper-persistent-data lvm2
    
  3. Set up the stable Docker repository:

    sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
    
  4. Install Docker:

    sudo yum install docker-ce docker-ce-cli containerd.io
    
  5. Start Docker:

    sudo systemctl start docker
    

Installing Docker on Windows #

  1. Download the Docker Desktop installer:

    https://hub.docker.com/editions/community/docker-ce-desktop-windows/
    
  2. Double-click Docker Desktop Installer.exe to run the installer.

  3. Follow the installer prompts to accept the default configuration.

  4. Docker Desktop starts automatically after installation.

Installing Docker on MacOS #

  1. Download the Docker Desktop installer:

    https://hub.docker.com/editions/community/docker-ce-desktop-mac/
    
  2. Double-click Docker.dmg to open the installer, then drag Moby the whale to the Applications folder.

  3. Double-click Docker.app in the Applications folder to start Docker Desktop.

  4. Docker Desktop starts automatically after installation.