Deploy on Kubernetes with Docker Desktop
Docker Desktop includes a standalone Kubernetes server and client, as well as Docker CLI integration that runs on your machine.
The Kubernetes server runs locally within your Docker instance, is not configurable, and is a single-node cluster. It runs within a Docker container on your local system, and is only for local testing.
Turning on Kubernetes allows you to deploy your workloads in parallel, on Kubernetes, Swarm, and as standalone containers. Turning on or off the Kubernetes server does not affect your other workloads.
From the Docker Dashboard, select the Settings.
Select Kubernetes from the left sidebar.
Next to Enable Kubernetes, select the checkbox.
Select Apply & Restart to save the settings and then select Install to confirm. This instantiates images required to run the Kubernetes server as containers, and installs the
/usr/local/bin/kubectlcommand on your machine.
kubectlbinary is not automatically packaged with Docker Desktop for Linux. To install the kubectl command for Linux, see Kubernetes documentation. It should be installed at
By default, Kubernetes containers are hidden from commands like
docker ps, because managing them manually is not supported. Most users do not need this option. To see these internal containers, select Show system containers (advanced).
When Kubernetes is turned on and running, an additional status bar in the Docker Dashboard footer and Docker menu displays.
Docker Desktop does not upgrade your Kubernetes cluster automatically after a new update. To upgrade your Kubernetes cluster to the latest version, select Reset Kubernetes Cluster.
Kubernetes integration provides the Kubernetes CLI command
/usr/local/bin/kubectl on Mac and at
C:\Program Files\Docker\Docker\Resources\bin\kubectl.exe on Windows. This location may not be in your shell's
variable, so you may need to type the full path of the command or add it to
If you have already installed
kubectl and it is
pointing to some other environment, such as
minikube or a GKE cluster, ensure you change the context so that
kubectl is pointing to
$ kubectl config get-contexts
$ kubectl config use-context docker-desktop
kubectlcommand in a CMD or PowerShell terminal, otherwise
kubectl config get-contextsmay return an empty result.
If you are using a different terminal and this happens, you can try setting the
kubeconfigenvironment variable to the location of the
If you installed
kubectl using Homebrew, or by some other method, and
experience conflicts, remove
You can test the command by listing the available nodes:
$ kubectl get nodes
NAME STATUS ROLES AGE VERSION
docker-desktop Ready master 3h v1.19.7
For more information about
kubectl, see the
To turn off Kubernetes in Docker Desktop:
- From the Docker Dashboard, select the Settings icon.
- Select Kubernetes from the left sidebar.
- Next to Enable Kubernetes, clear the checkbox
- Select Apply & Restart to save the settings.This stops and removes Kubernetes containers, and also removes the