Chapter 1 Getting Started
Windows
Go to https://docs.docker.com/docker-for-windows/install/ and
click the “Docker Desktop for Windows” button to download Docker, as
shown in Figure 1-1.
Figure 1-1. The Docker Desktop for Windows download button
1. Double-click Docker Desktop Installer.exe to run
the installer.
2. When prompted, ensure the Enable Hyper-V
Windows Features. If you have previously
configured WSL and are comfortable with it,
then make sure the “Install required Windows
components for WSL 2” option is selected on the
Configuration page.
3. Follow the instructions in the installation wizard to
authorize the installer and proceed with the install.
4. When the installation is successful, click Close to
complete the installation process.
5. If your admin account is different to your user
account, you must add the user to the docker-
users group. Run Computer Management as an
5
Chapter 1 Getting Started
administrator and navigate to Local Users and
Groups ➤ Groups ➤ docker-users. Right-click to
add the user to the group. Log out and log back in
for the changes to take effect.
Docker Desktop does not start automatically after installation. To
start Docker Desktop, search for Docker, and select Docker Desktop in the
search results. When the whale icon in the status bar stays steady, Docker
Desktop is up, running, and accessible from any terminal window.
Mac OS
Go to https://docs.docker.com/docker-for-mac/install/, shown in
Figure 1-2.
Figure 1-2. Download options for Docker for Mac
Double-click Docker.dmg to open the installer and then drag the
Docker icon to the Applications folder, as shown in Figure 1-3.
6
Chapter 1 Getting Started
Figure 1-3. Moving the Docker application to the Applications folder
Double-click Docker.app in the Applications folder to start Docker.
(In Figure 1-4, the Applications folder is in grid view mode.)
Figure 1-4. Docker Applications folder
The Docker menu in the top status bar indicates that Docker Desktop
is running and accessible from a terminal.
Linux
Go to https://docs.docker.com/engine/install/. Here you will find
links to instructions on how to install Docker on several popular Linux
7
Chapter 1 Getting Started
distributions. If you are using Debian/Ubuntu, you can follow these
instructions (https://docs.docker.com/engine/install/ubuntu/):
1) Ensure that any older installation is removed from
the system.
<code>
sudo apt-get remove docker docker-engine docker.io
containerd runc
</code>
2) Update the apt package index and install packages
to allow apt to use a repository over HTTPS.
<code>
sudo apt-get update
sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
gnupg \
lsb-release
</code>
3) Add Docker’s official GPG key.
<code>
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo
gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
</code>
4) Use the following command to set up the stable
repository. To add the nightly or test repository,
add the word nightly or test (or both) after the
word stable.