Install Docker
Which Docker should I install?
Linux
Docker only runs natively on Linux. If you are running Linux on your computer, you must install Docker locally.
### macOS
If you have macOS 10.10.3 Yosemite or newer, you can install Docker Desktop for macOS. Docker Desktop for Mac runs as a native Mac application.
If you have an older version of macOS (10.8 Mountain Lion and later) you need to install Docker Toolbox for macOS, which includes Docker Machine, a Linux virtual machine that runs Docker.
Windows
If you have Windows 10 you can install Docker Desktop for Windows. Docker Desktop for Windows runs as a native Windows application. It uses the Hyper-V feature of the Windows OS to virtualize the Docker Engine environment and Linux kernel-specific features for the Docker daemon.
If you have Windows 7 or 8 you need to install Docker Toolbox for Windows, which includes Docker Machine, a Linux virtual machine that runs Docker. It allows you to run Docker commands from your terminal, or from a 'Quickstart terminal' application on your computer.
Installing Docker on Linux
- If you are running Linux you will need to install Docker directly. You should be logged in as a user with sudo privileges. First, you will need to ensure that you have the command line utility
cURL
. Do this by opening a terminal and typing:
$ which curl
If cURL
is not installed, update your package manager and install it, using:
$ sudo apt-get update
$ sudo apt-get install curl
- Now that you have cURL, you can use it to get the latest Docker package:
$ curl -fsSL https://get.docker.com/ | sh
- Add your account to the
docker
group.
sudo usermod -aG docker <your_username>
This step is required to be able to run Docker commands as a non-root user. You will have to log out and log back in for the change to take effect.
- Now you should have Docker! Verify that it is installed by running the
hello-world
container:
$ docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
b901d36b6f2f: Pull complete
0a6ba66e537a: Pull complete
Digest: sha256:8be990ef2aeb16dbcb9271ddfe2610fa6658d13f6dfb8bc72074cc1ca36966a7
Status: Downloaded newer image for hello-world:latest
Hello from Docker.
This message shows that your installation appears to be working correctly.
Tip
If you see the message "Cannot connect to the Docker daemon", you may need to restart the Docker service.
$ sudo service docker restart
You can see a list of common Docker commands here.
## Installing Docker on macOS
If you have macOS 10.10.3 Yosemite or newer, you can install Docker Desktop for Mac. Docker Desktop for Mac runs as a native Mac application and uses xhyve to virtualize the Docker Engine environment and Linux kernel-specific features for the Docker daemon.
If you have an older version of macOS (10.8 Mountain Lion and later) you need to install Docker Toolbox for macOS, which includes Docker Machine, a Linux virtual machine that runs Docker.
Docker Desktop for Mac
If you are running macOS 10.10.3 (Yosemite) or later, follow these instructions to install Docker Desktop for Mac.
-
Download and install Docker Desktop for Mac.
After the installation is complete, the Docker icon will be displayed in the menu bar. -
Click the Docker icon and you will see the Docker Desktop is running information.
- To use Docker, open a terminal and enter your Docker commands. You can see a list of common Docker commands here.
Tip
To make sure Docker for Mac is always running:
- Click the Docker icon in the menu bar in the upper right corner of your screen.
- Choose Preferences.
- Enable Start Docker Desktop when you log in.
Docker Toolbox for older versions of macOS
if you are running macOS 10.8 (Mountain Lion) or later, follow these instructions to install Docker Toolbox. Note that if you are running are running macOS 10.10.3 (Yosemite) or later, you should install Docker for macOS instead.
- Download Docker Toolbox. To install Docker Toolbox, follow the installation instructions shown on the screen.
- Once you have completed the installation steps for Docker Toolbox, you're ready to create a new Docker virtual machine. To do this, go to your Launchpad and select Docker Quickstart Terminal.
This opens a terminal like the one shown below.
Tip
You need to run Docker Quickstart Terminal every time you want to use Docker.
You can see a list of common Docker commands here.
Installing Docker on Windows
If you have Windows 10 you can install Docker for Windows. Docker for Windows runs as a native Windows application. It uses the Hyper-V feature of the Windows OS to virtualize the Docker Engine environment and Linux kernel-specific features for the Docker daemon.
If you have Windows 7 or 8 you need to install Docker Toolbox for Windows, which includes Docker Machine, a Linux virtual machine that runs Docker. It allows you to run Docker commands from your terminal, or from a 'Quickstart terminal' application on your computer.
Docker Desktop for Windows
If you are running Windows 10, follow these instructions to install Docker Desktop for Windows.
- Download and install Docker Desktop for Windows.
- After installation is complete the screen prompting you to enable to the Hyper-V feature will be displayed. Click Yes to enable it.
- Restart your computer.
- Click the Docker Desktop icon on your desktop.
- Open the terminal of your choice, and issue the following command: docker run
hello-world
. If the installation was successful you will see the confirmation message.
Tip
To make sure Docker for Windows is always running:
- Right-click Docker icon in the system tray.
- Choose Settings.
- Enable the Start Docker when you log in option.
You can see a list of common Docker commands here.
Docker Toolbox for older versions of Windows
If you are running Windows 7 or Windows 8, follow these instructions to install Docker Toolbox for Windows.
- Download Docker Toolbox for windows from this page.
- Click DockerToolbox.exe and follow the onscreen instructions.
Once the installation is completed, click the Docker Quickstart Terminal icon on your desktop.
The terminal window will open and Docker Toolbox will perform an additional set of tasks to complete the setup. Once the setup is completed, you will see the following screen.
Tip
You need to run Docker Quickstart Terminal every time you want to use Docker.
You can see a list of common Docker commands here.
Updated less than a minute ago