Home › Kubernetes Tutorial › Kubernetes installation
Kubernetes installation
Set up kubectl and a free practice cluster on your own computer.
Before you start
- Install Docker Desktop (or Docker Engine on Linux) from
docker.comand start it. - You need about 2 CPUs, 2 GB of free memory and 20 GB of disk.
Windows
- Open PowerShell and run
winget install Kubernetes.kubectl. - Run
winget install Kubernetes.minikube. - Close and reopen PowerShell, then run
minikube start.
macOS
- Install Homebrew from
brew.shif you do not have it. - Run
brew install kubectl minikube. - Run
minikube start.
Linux
- Install kubectl with your package manager or from
kubernetes.io. - Download minikube from
minikube.sigs.k8s.ioand put it in your PATH. - Run
minikube start. Add your user to the docker group if you get a permission error.
Check it works
- Run
kubectl version --clientto see the kubectl version. - Run
kubectl get nodes. The node should showReady.
Other options
- kind runs a cluster inside Docker containers:
kind create cluster. - Docker Desktop has a built-in Kubernetes switch in its settings.
If something goes wrong
minikube startfails: make sure Docker is running, then runminikube deleteand try again.kubectlnot found: close and reopen the terminal.- Stop the cluster with
minikube stop.
Example code
kubectl get nodes