Installing Docker

Learn how to install Docker on your machine.

Docker set-up

Let’s get you set up with Docker on your machine. We are going to be using the free, Community Edition (CE), rather than the Enterprise Edition (EE).

Docker CE itself comes in two versions: Edge, which contains the latest features being developed, and Stable, which is, well, more stable. Make sure to install the latter as we do not want any unexpected surprises getting in the way of your learning.

Read the following instructions for your OS and then install Docker.

macOS

Docker provides a downloadable installer called Docker for Mac, which has everything you need in one neat package (it is currently a 115.6 MB download). Install this following the installation instructions.

Once installed, Docker for Mac adds a menu bar app in the top right of the screen featuring Docker’s logo, which is its whale mascot named “Moby Dock.” The menu bar not only tells you whether Docker is running, but it also provides other useful information and settings. You can find more about the advanced settings available in docs.

Linux

Unfortunately, getting started with Docker on Linux is a bit more complicated than it is on other platforms. As you would probably expect, how you install it depends on your Linux distribution.

Visit the Docker CE installation docs, select your Linux distribution from the navigation menu, then follow the instructions. Typically, this involves installing Docker with your distro’s package manager, which may need to get the latest packages from Docker’s repository, as the distro packages are often outdated.

You will also need to review Docker’s post-installation instructions to make sure you have everything set up correctly. It will help you troubleshoot any issues you may encounter.

Docker Compose, on Linux, is installed separately. Install this using the documentation provided. If you happen to have it installed already, you should recommend upgrade to the latest, stable version.

Windows

How to install Docker on Windows depends on whether your system supports Hyper-V, Microsoft’s homegrown virtualization technology. Professional, Enterprise, or Education editions (64-bit versions) of Windows 8 and up do support it—hardware permitting—but Windows Home edition, notably, does not.

If your system supports Hyper-V, download the Docker for Windows installer, launch it, and follow the instructions. Docker for Windows installs a widget in the Windows notification area at the bottom right of your screen (you may need to click to reveal it). Clicking the widget will open up a menu where you can find more info and adjust various settings.

If your system does not support Hyper-V, you will need to download and install Docker Toolbox, a legacy way of running Docker on Windows.

Verifying your install

Now we will check if Docker is installed and running correctly. Since Docker is a command-line tool, crack open your favorite terminal, and enter the following command:

$ docker version

If all is well, you should see some output like the following:

Client:
 Version:           19.03.8
 API version:       1.40
 Go version:        go1.13.8
 Git commit:        afacb8b7f0
 Built:             Wed Oct 14 19:43:43 2020
 OS/Arch:           linux/amd64
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          20.10.0
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.13.15
  Git commit:       eeddea2
  Built:            Tue Dec  8 18:57:45 2020
  OS/Arch:          linux/amd64
  Experimental:     false

🍀 Practice

Connect the terminal below and try running the docker version command in it:

Get hands-on with 1400+ tech skills courses.