{"metadata":{"image":[],"title":"","description":""},"api":{"url":"","auth":"required","results":{"codes":[]},"settings":"","params":[]},"next":{"description":"","pages":[]},"title":"Install Docker","type":"basic","slug":"install-docker","excerpt":"","body":"## Which Docker should I install?\n\n### Linux\n\nDocker only runs natively on Linux. If you are running Linux on your computer, you must [install Docker locally](#section-installing-docker-on-linux).\n\n### macOS\n\nIf you have macOS 10.10.3 Yosemite or newer, you can [install Docker Desktop for macOS](#section-docker-desktop-for-mac). Docker Desktop for Mac runs as a native Mac application.\n\nIf you have an older version of macOS (10.8 Mountain Lion and later) you need to [install Docker Toolbox for macOS](#section-docker-toolbox-for-older-versions-of-macos), which includes Docker Machine, a Linux virtual machine that runs Docker. \n\n### Windows\n\nIf you have Windows 10 you can [install Docker Desktop for Windows](#section-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.\n\nIf you have Windows 7 or 8 you need to [install Docker Toolbox for Windows](#section-docker-toolbox-for-older-versions-of-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.\n\n## Installing Docker on Linux\n\n1. 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:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"$ which curl\",\n      \"language\": \"text\",\n      \"name\": \"Step 1\"\n    }\n  ]\n}\n[/block]\nIf `cURL` is not installed, update your package manager and install it, using:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"$ sudo apt-get update\\n$ sudo apt-get install curl\",\n      \"language\": \"text\",\n      \"name\": \"Step 1.1\"\n    }\n  ]\n}\n[/block]\n2. Now that you have cURL, you can use it to get the latest Docker package:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"$ curl -fsSL https://get.docker.com/ | sh\",\n      \"language\": \"text\",\n      \"name\": \"Step 2\"\n    }\n  ]\n}\n[/block]\n3. Add your account to the `docker` group.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"sudo usermod -aG docker <your_username>\",\n      \"language\": \"text\",\n      \"name\": \"Step 3\"\n    }\n  ]\n}\n[/block]\nThis 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.\n\n4. Now you should have Docker! Verify that it is installed by running the `hello-world` container:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"$ docker run hello-world\\n \\nUnable to find image 'hello-world:latest' locally\\nlatest: Pulling from library/hello-world\\nb901d36b6f2f: Pull complete \\n0a6ba66e537a: Pull complete \\nDigest: sha256:8be990ef2aeb16dbcb9271ddfe2610fa6658d13f6dfb8bc72074cc1ca36966a7\\nStatus: Downloaded newer image for hello-world:latest\\n\\n\\nHello from Docker.\\n\\nThis message shows that your installation appears to be working correctly.\",\n      \"language\": \"text\",\n      \"name\": \"Step 4\"\n    }\n  ]\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"body\": \"If you see the message \\\"Cannot connect to the Docker daemon\\\", you may need to restart the Docker service.\",\n  \"title\": \"Tip\"\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"$ sudo service docker restart\",\n      \"language\": \"text\"\n    }\n  ]\n}\n[/block]\nYou can see a list of common Docker commands [here](doc:core-docker-commands).\n\n## Installing Docker on macOS\n\nIf you have macOS 10.10.3 Yosemite or newer, you can [install Docker Desktop for Mac](#section-docker-desktop-for-mac). Docker Desktop for Mac runs as a native Mac application and uses [xhyve](https://github.com/mist64/xhyve/) to virtualize the Docker Engine environment and Linux kernel-specific features for the Docker daemon.\n\nIf you have an older version of macOS (10.8 Mountain Lion and later) you need to [install Docker Toolbox for macOS](#section-docker-toolbox-for-older-versions-of-macos), which includes Docker Machine, a Linux virtual machine that runs Docker.\n\n### Docker Desktop for Mac\n\nIf you are running macOS 10.10.3 (Yosemite) or later, follow these instructions to install Docker Desktop for Mac.\n\n1. Download and install [Docker Desktop for Mac](https://docs.docker.com/docker-for-mac/install/).\nAfter the installation is complete, the Docker icon will be displayed in the menu bar.\n\n2. Click the Docker icon and you will see the **Docker Desktop is running** information.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/007bfea-docker-desktop-for-mac-running.png\",\n        \"docker-desktop-for-mac-running.png\",\n        245,\n        368,\n        \"#2d2e34\"\n      ],\n      \"border\": true\n    }\n  ]\n}\n[/block]\n3. To use Docker, open a terminal and enter your Docker commands. You can see a list of common Docker commands [here](doc:core-docker-commands).\n[block:callout]\n{\n  \"type\": \"info\",\n  \"body\": \"To make sure Docker for Mac is always running:\\n1. Click the Docker icon in the menu bar in the upper right corner of your screen.\\n2. Choose **Preferences**.\\n3. Enable **Start Docker Desktop when you log in**.\",\n  \"title\": \"Tip\"\n}\n[/block]\n### Docker Toolbox for older versions of macOS\n\nif 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](#section-docker-for-mac-os) instead.\n\n1. Download [Docker Toolbox](https://docs.docker.com/toolbox/toolbox_install_mac/). To install Docker Toolbox, follow the installation instructions shown on the screen.\n\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/HVBniUqXQouoBgt8jKg3_docker-toolbox.png\",\n        \"docker-toolbox.png\",\n        \"1238\",\n        \"874\",\n        \"#d9101b\",\n        \"\"\n      ],\n      \"border\": true\n    }\n  ]\n}\n[/block]\n2. 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. \n\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/93e1646-docker-quickstart-terminal.png\",\n        \"docker-quickstart-terminal.png\",\n        100,\n        77,\n        \"#706352\"\n      ]\n    }\n  ]\n}\n[/block]\nThis opens a terminal like the one shown below. \n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/0EgnKSkNTXWgAfVnXpSk_terminal-window.png\",\n        \"terminal-window.png\",\n        \"1896\",\n        \"820\",\n        \"#507dc0\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Tip\",\n  \"body\": \"You need to run Docker Quickstart Terminal every time you want to use Docker.\"\n}\n[/block]\nYou can see a list of common Docker commands [here](doc:core-docker-commands).\n\n## Installing Docker on Windows\n\nIf you have Windows 10 you can [install Docker for Windows](#section-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.\n\nIf you have Windows 7 or 8 you need to [install Docker Toolbox for Windows](#section-docker-toolbox-for-older-versions-of-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.\n\n### Docker Desktop for Windows\n\nIf you are running Windows 10, follow these instructions to install Docker Desktop for Windows.\n\n1. Download and install [Docker Desktop for Windows](https://docs.docker.com/docker-for-windows/install/).\n2. After installation is complete the screen prompting you to enable to the Hyper-V feature will be displayed. Click **Yes** to enable it.\n3. Restart your computer.\n4. Click the **Docker Desktop** icon on your desktop.\n5. 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. \n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/0f093bc-docker-successfully-installed.png\",\n        \"docker-successfully-installed.png\",\n        1145,\n        746,\n        \"#042454\"\n      ],\n      \"border\": true\n    }\n  ]\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"body\": \"To make sure Docker for Windows is always running:\\n\\n1. Right-click Docker icon in the system tray.\\n2. Choose **Settings**.\\n3. Enable the **Start Docker when you log in** option.\",\n  \"title\": \"Tip\"\n}\n[/block]\nYou can see a list of common Docker commands [here](doc:core-docker-commands).\n\n### Docker Toolbox for older versions of Windows\n\nIf you are running Windows 7 or Windows 8, follow these instructions to install Docker Toolbox for Windows.\n\n1. Download Docker Toolbox for windows from [this page](https://docs.docker.com/toolbox/toolbox_install_windows/).\n2. Click **DockerToolbox.exe** and follow the onscreen instructions.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/574cfae-install-docker-toolbox1.jpg\",\n        \"install-docker-toolbox1.jpg\",\n        522,\n        405,\n        \"#dfdfe0\"\n      ]\n    }\n  ]\n}\n[/block]\nOnce the installation is completed, click the **Docker Quickstart Terminal** icon on your desktop.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/849783b-docker-quickstart-terminal-icon.jpg\",\n        \"docker-quickstart-terminal-icon.jpg\",\n        64,\n        114,\n        \"#2ac0e7\"\n      ]\n    }\n  ]\n}\n[/block]\nThe 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.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/ce5e8f9-docker-toolbox-terminal.jpg\",\n        \"docker-toolbox-terminal.jpg\",\n        678,\n        341,\n        \"#040505\"\n      ],\n      \"border\": true\n    }\n  ]\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"body\": \"You need to run Docker Quickstart Terminal every time you want to use Docker.\",\n  \"title\": \"Tip\"\n}\n[/block]\nYou can see a list of common Docker commands [here](doc:core-docker-commands).","updates":[],"order":2,"isReference":false,"hidden":false,"sync_unique":"","link_url":"","link_external":false,"_id":"5c41b251bde7e20062897d0c","project":"55faf11ba62ba1170021a9a7","version":{"version":"1.0","version_clean":"1.0.0","codename":"","is_stable":true,"is_beta":true,"is_hidden":false,"is_deprecated":false,"categories":["55faf11ca62ba1170021a9ab","55faf8f4d0e22017005b8272","55faf91aa62ba1170021a9b5","55faf929a8a7770d00c2c0bd","55faf932a8a7770d00c2c0bf","55faf94b17b9d00d00969f47","55faf958d0e22017005b8274","55faf95fa8a7770d00c2c0c0","55faf96917b9d00d00969f48","55faf970a8a7770d00c2c0c1","55faf98c825d5f19001fa3a6","55faf99aa62ba1170021a9b8","55faf99fa62ba1170021a9b9","55faf9aa17b9d00d00969f49","55faf9b6a8a7770d00c2c0c3","55faf9bda62ba1170021a9ba","5604570090ee490d00440551","5637e8b2fbe1c50d008cb078","5649bb624fa1460d00780add","5671974d1b6b730d008b4823","5671979d60c8e70d006c9760","568e8eef70ca1f0d0035808e","56d0a2081ecc471500f1795e","56d4a0adde40c70b00823ea3","56d96b03dd90610b00270849","56fbb83d8f21c817002af880","573c811bee2b3b2200422be1","576bc92afb62dd20001cda85","5771811e27a5c20e00030dcd","5785191af3a10c0e009b75b0","57bdf84d5d48411900cd8dc0","57ff5c5dc135231700aed806","5804caf792398f0f00e77521","58458b4fba4f1c0f009692bb","586d3c287c6b5b2300c05055","58ef66d88646742f009a0216","58f5d52d7891630f00fe4e77","59a555bccdbd85001bfb1442","5a2a81f688574d001e9934f5","5b080c8d7833b20003ddbb6f","5c222bed4bc358002f21459a","5c22412594a2a5005cc9e919","5c41ae1c33592700190a291e","5c8a525e2ba7b2003f9b153c","5cbf14d58c79c700ef2b502e","5db6f03a6e187c006f667fa4","5f894c7d3b0894006477ca01"],"_id":"55faf11ba62ba1170021a9aa","releaseDate":"2015-09-17T16:58:03.490Z","createdAt":"2015-09-17T16:58:03.490Z","project":"55faf11ba62ba1170021a9a7","__v":47},"category":{"sync":{"isSync":false,"url":""},"pages":["56268b3cc2781f0d00364bc0","5637bfa84dbdd919001b277d","5637e6fe97666c0d008656b6","5637e74acfaa870d00cdeb7a","5637e764f7e3990d007b2c52","5640baf604c3eb0d006fc43c","56cccb6894c8f00b00b83f24","56ddf68dba70f50e0033c6df"],"title":"DOCKER","slug":"bring-your-tools","order":16,"from_sync":false,"reference":false,"_id":"55faf958d0e22017005b8274","__v":8,"createdAt":"2015-09-17T17:33:12.687Z","project":"55faf11ba62ba1170021a9a7","version":"55faf11ba62ba1170021a9aa"},"user":"5767bc73bb15f40e00a28777","createdAt":"2019-01-18T11:02:41.622Z","__v":0,"parentDoc":null}
## 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](#section-installing-docker-on-linux). ### macOS If you have macOS 10.10.3 Yosemite or newer, you can [install Docker Desktop for macOS](#section-docker-desktop-for-mac). 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](#section-docker-toolbox-for-older-versions-of-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](#section-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](#section-docker-toolbox-for-older-versions-of-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 1. 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: [block:code] { "codes": [ { "code": "$ which curl", "language": "text", "name": "Step 1" } ] } [/block] If `cURL` is not installed, update your package manager and install it, using: [block:code] { "codes": [ { "code": "$ sudo apt-get update\n$ sudo apt-get install curl", "language": "text", "name": "Step 1.1" } ] } [/block] 2. Now that you have cURL, you can use it to get the latest Docker package: [block:code] { "codes": [ { "code": "$ curl -fsSL https://get.docker.com/ | sh", "language": "text", "name": "Step 2" } ] } [/block] 3. Add your account to the `docker` group. [block:code] { "codes": [ { "code": "sudo usermod -aG docker <your_username>", "language": "text", "name": "Step 3" } ] } [/block] 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. 4. Now you should have Docker! Verify that it is installed by running the `hello-world` container: [block:code] { "codes": [ { "code": "$ docker run hello-world\n \nUnable to find image 'hello-world:latest' locally\nlatest: Pulling from library/hello-world\nb901d36b6f2f: Pull complete \n0a6ba66e537a: Pull complete \nDigest: sha256:8be990ef2aeb16dbcb9271ddfe2610fa6658d13f6dfb8bc72074cc1ca36966a7\nStatus: Downloaded newer image for hello-world:latest\n\n\nHello from Docker.\n\nThis message shows that your installation appears to be working correctly.", "language": "text", "name": "Step 4" } ] } [/block] [block:callout] { "type": "info", "body": "If you see the message \"Cannot connect to the Docker daemon\", you may need to restart the Docker service.", "title": "Tip" } [/block] [block:code] { "codes": [ { "code": "$ sudo service docker restart", "language": "text" } ] } [/block] You can see a list of common Docker commands [here](doc:core-docker-commands). ## Installing Docker on macOS If you have macOS 10.10.3 Yosemite or newer, you can [install Docker Desktop for Mac](#section-docker-desktop-for-mac). Docker Desktop for Mac runs as a native Mac application and uses [xhyve](https://github.com/mist64/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](#section-docker-toolbox-for-older-versions-of-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. 1. Download and install [Docker Desktop for Mac](https://docs.docker.com/docker-for-mac/install/). After the installation is complete, the Docker icon will be displayed in the menu bar. 2. Click the Docker icon and you will see the **Docker Desktop is running** information. [block:image] { "images": [ { "image": [ "https://files.readme.io/007bfea-docker-desktop-for-mac-running.png", "docker-desktop-for-mac-running.png", 245, 368, "#2d2e34" ], "border": true } ] } [/block] 3. To use Docker, open a terminal and enter your Docker commands. You can see a list of common Docker commands [here](doc:core-docker-commands). [block:callout] { "type": "info", "body": "To make sure Docker for Mac is always running:\n1. Click the Docker icon in the menu bar in the upper right corner of your screen.\n2. Choose **Preferences**.\n3. Enable **Start Docker Desktop when you log in**.", "title": "Tip" } [/block] ### 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](#section-docker-for-mac-os) instead. 1. Download [Docker Toolbox](https://docs.docker.com/toolbox/toolbox_install_mac/). To install Docker Toolbox, follow the installation instructions shown on the screen. [block:image] { "images": [ { "image": [ "https://files.readme.io/HVBniUqXQouoBgt8jKg3_docker-toolbox.png", "docker-toolbox.png", "1238", "874", "#d9101b", "" ], "border": true } ] } [/block] 2. 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. [block:image] { "images": [ { "image": [ "https://files.readme.io/93e1646-docker-quickstart-terminal.png", "docker-quickstart-terminal.png", 100, 77, "#706352" ] } ] } [/block] This opens a terminal like the one shown below. [block:image] { "images": [ { "image": [ "https://files.readme.io/0EgnKSkNTXWgAfVnXpSk_terminal-window.png", "terminal-window.png", "1896", "820", "#507dc0", "" ] } ] } [/block] [block:callout] { "type": "info", "title": "Tip", "body": "You need to run Docker Quickstart Terminal every time you want to use Docker." } [/block] You can see a list of common Docker commands [here](doc:core-docker-commands). ## Installing Docker on Windows If you have Windows 10 you can [install Docker for Windows](#section-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](#section-docker-toolbox-for-older-versions-of-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. 1. Download and install [Docker Desktop for Windows](https://docs.docker.com/docker-for-windows/install/). 2. After installation is complete the screen prompting you to enable to the Hyper-V feature will be displayed. Click **Yes** to enable it. 3. Restart your computer. 4. Click the **Docker Desktop** icon on your desktop. 5. 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. [block:image] { "images": [ { "image": [ "https://files.readme.io/0f093bc-docker-successfully-installed.png", "docker-successfully-installed.png", 1145, 746, "#042454" ], "border": true } ] } [/block] [block:callout] { "type": "info", "body": "To make sure Docker for Windows is always running:\n\n1. Right-click Docker icon in the system tray.\n2. Choose **Settings**.\n3. Enable the **Start Docker when you log in** option.", "title": "Tip" } [/block] You can see a list of common Docker commands [here](doc:core-docker-commands). ### 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. 1. Download Docker Toolbox for windows from [this page](https://docs.docker.com/toolbox/toolbox_install_windows/). 2. Click **DockerToolbox.exe** and follow the onscreen instructions. [block:image] { "images": [ { "image": [ "https://files.readme.io/574cfae-install-docker-toolbox1.jpg", "install-docker-toolbox1.jpg", 522, 405, "#dfdfe0" ] } ] } [/block] Once the installation is completed, click the **Docker Quickstart Terminal** icon on your desktop. [block:image] { "images": [ { "image": [ "https://files.readme.io/849783b-docker-quickstart-terminal-icon.jpg", "docker-quickstart-terminal-icon.jpg", 64, 114, "#2ac0e7" ] } ] } [/block] 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. [block:image] { "images": [ { "image": [ "https://files.readme.io/ce5e8f9-docker-toolbox-terminal.jpg", "docker-toolbox-terminal.jpg", 678, 341, "#040505" ], "border": true } ] } [/block] [block:callout] { "type": "info", "body": "You need to run Docker Quickstart Terminal every time you want to use Docker.", "title": "Tip" } [/block] You can see a list of common Docker commands [here](doc:core-docker-commands).