Installing Docker for Mac
Docker for Mac is the fastest and most reliable way to run Docker on a Mac. It installs all of the tools required to set up a complete Docker development environment on your Mac. It includes the Docker command line, Docker Compose, and Docker Notary. It also works well with VPNs and proxies to make it easier when used in a corporate environment.
Recent releases have also added Kubernetes support so that you can easily create a full Kubernetes environment on your machine with just the click of a button.
Getting ready
Docker for Mac has the following system requirements:
- macOS El Capitan 10.11, or a newer macOS release
- At least 4 GB of RAM
- The Mac hardware must be a 2010 or newer model, with Intel's hardware support for Memory Management Unit (MMU) virtualization, including Extended Page Tables (EPT) and unrestricted mode. To see whether your machine supports this, run the following command in a terminal:
$ sysctl kern.hv_support kern.hv_support: 1
Note
If your system does not satisfy these requirements, fear not—all is not lost. You can install Docker Toolbox (https://docs.docker.com/toolbox/overview/), which uses Oracle VirtualBox instead of HyperKit. It isn't as good, but it is better than nothing.
How to do it
To install Docker for Mac, go through the following steps:
- Download Docker for Mac from the Docker Store at https://store.docker.com/editions/community/docker-ce-desktop-mac. You will need to log in in order to download the installer. If you do not have a Docker account, you can create one at https://store.docker.com/signup.
- Open the installation file that you downloaded from the store. It should be called something like
Docker.dmg
.
- Drag and drop the whale icon into the
Applications
folder:

- Double-click the
Docker.app
icon in theApplications
folder to start Docker, as shown in the following screenshot:

- You will be prompted to authorize
Docker.app
with your system password. This is normal—Docker.app
needs privileged access to install some of its components. ClickOK
and enter your password so it can finish installing:

- When Docker is finished, a little whale icon will show up in the status menu in the top right of your screen, as shown in the following screenshot:

- If you click on the whale, you can access the application preferences and other options.
- Select the
About Docker
button to verify that you have the latest version. - Check to make sure that it is installed and working. Open up a terminal window and type the following:
$ docker container run hello-world
How it works...
The preceding recipe will download and install a Docker development environment on your Mac.
There's more...
Now that you have Docker for Mac installed, here are a few more tips for getting started:
- Docker for Mac will automatically check for new updates and let you know when a new version is available for you to install. If you agree to upgrade, it will do all the work, downloading the new version and installing it for you.
- Kubernetes isn't running by default. If you want to turn it on, you will need to click on the Docker whale icon in your
Status
menu, then selectPreferences
. Inside ofPreferences
, there is aKubernetes
tab. Click on the tab, then click theEnable Kubernetes
option, and hit theApply
button:

See also
Visit the Get Started with Docker for Mac guide to help you learn about the application and how best to use it. You can find it at https://docs.docker.com/docker-for-mac/.