Binaries
Install Kubectl by downloading precompiled binaries.
Install kubectl binary with curl on Linux / macOS
-
Define the following variable by OS:
-
Linux:
export os="linux/amd64"
-
macOS with an Intel core:
export os="darwin/amd64"
-
macOS with an Apple Silicon core:
export os="darwin/arm64"
-
-
Download the latest release with the command:
curl -LO "https://dl.k8s.io/release/$(curl -sL https://dl.k8s.io/release/stable.txt)/bin/$os/kubectl"
To download a specific version, replace the
$(curl -sL https://dl.k8s.io/release/stable.txt)
portion of the command with the specific version.For example, to download version v1.19.0 on Linux, type:
curl -LO "https://dl.k8s.io/release/v1.19.0/bin/$os/kubectl"
-
Make the kubectl binary executable.
chmod +x ./kubectl
-
Move the binary in to your PATH.
sudo mv ./kubectl /usr/local/bin/kubectl
-
Test to ensure the version you installed is up-to-date:
kubectl version --client
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.
Last modified May 12, 2023: doc: use dl.k8s.io, not kubernetes-release bucket (eef2799)