How to install Docker?

0596

To install Docker on your system, follow these steps based on your operating system:

For Ubuntu

  1. Update your package index:

    sudo apt update
  2. Install required packages:

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

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

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

    sudo apt update
  6. Install Docker:

    sudo apt install docker-ce
  7. Verify Docker installation:

    docker --version

For Windows

  1. Download Docker Desktop:
    Visit the Docker Desktop for Windows page and download the installer.

  2. Run the installer:
    Follow the installation wizard and ensure that the "Install required Windows components for WSL 2" option is checked.

  3. Start Docker Desktop:
    After installation, launch Docker Desktop from the Start menu.

  4. Verify installation:
    Open a command prompt and run:

    docker --version

For macOS

  1. Download Docker Desktop:
    Go to the Docker Desktop for Mac page and download the installer.

  2. Install Docker:
    Open the downloaded .dmg file and drag the Docker icon to your Applications folder.

  3. Start Docker Desktop:
    Launch Docker from your Applications folder.

  4. Verify installation:
    Open a terminal and run:

    docker --version

Post-Installation Steps

After installing Docker, it's a good idea to manage Docker as a non-root user. You can do this by adding your user to the Docker group:

sudo usermod -aG docker $USER

Log out and back in for the changes to take effect.

Further Learning

For more detailed instructions and troubleshooting, you can refer to the official Docker documentation: Get Docker.

If you have any questions or need further assistance, feel free to ask!

0 Comments

no data
Be the first to share your comment!