Installing Docker on different platforms is a straightforward process. Here are step-by-step instructions for installing Docker on macOS, Linux, and Windows:
Installing Docker on macOS:
- macOS 10.13 (High Sierra) or later.
- An Intel-based Mac. Docker does not support Apple Silicon (M1) natively at the time of my last knowledge update in September 2021, so for M1 users, you may need additional workarounds like using Rosetta or an emulator.
- Visit the Docker Desktop for Mac download page: Docker Desktop for Mac
- Click the “Download for Mac” button to download the Docker Desktop for Mac installer.
- Open the downloaded DMG file and drag the Docker application to your Applications folder.
- Launch Docker by searching for “Docker” in your Applications folder or using Spotlight.
- Once Docker is running, you should see a Docker icon in your menu bar. Click on it to access Docker settings and manage containers.
- Docker is now installed and ready to use on your macOS.
Installing Docker on Linux:
Note: The steps for installing Docker on Linux can vary depending on your distribution. Here, we’ll cover the installation process for Ubuntu, a popular Linux distribution.
Installation Steps (for Ubuntu):
- Open a terminal window.
- Update the package list on your system:
sudo apt-get update
- Install the necessary packages to allow apt to use a repository over HTTPS and ensure compatibility:
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
- Download and add the Docker GPG key to your system:
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
- Add the Docker repository to your APT sources:
echo "deb [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
- Update the package list again:
sudo apt-get update
- Finally, install Docker:
sudo apt-get install docker-ce docker-ce-cli containerd.io
- Start and enable Docker to run on system boot:
sudo systemctl start docker sudo systemctl enable docker
- You can verify the installation by running:
sudo docker --version
Installing Docker on Windows:
- Windows 10 64-bit: Pro, Enterprise, or Education editions.
- Hyper-V and Containers Windows features enabled.
- Visit the Docker Desktop for Windows download page: Docker Desktop for Windows
- Click the “Download for Windows” button to download the Docker Desktop for Windows installer.
- Run the downloaded installer. If prompted, allow the installer to make changes to your device.
- Follow the installation wizard, which includes enabling Hyper-V and Containers features if they are not already enabled.
- Once the installation is complete, Docker Desktop for Windows will launch automatically. You should see the Docker icon in your system tray.
- Docker is now installed and ready to use on your Windows machine.
Depending on your Linux distribution or specific Windows version, there may be slight variations, so it’s always a good idea to consult the official Docker documentation for the most up-to-date and detailed instructions.