Native package manager (Debian / Ubuntu)
Recommended on Debian-family distributions for automatic security updates.
- 1. Installbash
sudo apt-get update sudo apt-get install -y apt-transport-https ca-certificates curl gnupg curl -fsSL https://pkgs.k8s.io/core:/stable:/v1.32/deb/Release.key | sudo gpg --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg echo 'deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v1.32/deb/ /' | sudo tee /etc/apt/sources.list.d/kubernetes.list sudo apt-get update sudo apt-get install -y kubectl
Verify install
bash
kubectl version --clientNative package manager (RHEL / Fedora / CentOS Stream)
- 1. Installinstall-kubectl.sh
cat <<EOF | sudo tee /etc/yum.repos.d/kubernetes.repo [kubernetes] name=Kubernetes baseurl=https://pkgs.k8s.io/core:/stable:/v1.32/rpm/ enabled=1 gpgcheck=1 gpgkey=https://pkgs.k8s.io/core:/stable:/v1.32/rpm/repodata/repomd.xml.key EOF sudo dnf install -y kubectl
Direct binary (curl)
Use this when you need a specific version or your distro is not supported.
- 1. Downloadbash
curl -LO "https://dl.k8s.io/release/v1.36.1/bin/linux/amd64/kubectl" - 2. Verify checksumbash
curl -LO "https://dl.k8s.io/v1.36.1/bin/linux/amd64/kubectl.sha256" echo "$(cat kubectl.sha256) kubectl" | sha256sum --check - 3. Installbash
sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl
Verify install
bash
kubectl version --clientSnap
- 1. Installbash
sudo snap install kubectl --classic
Always verify your binary
Treat every command on the internet with care. Each install command here is mirrored from official Kubernetes documentation. When piping a remote script to a shell, click View script to read it first, or download and verify the binary directly using the steps on the Verify page.