Menu
User

DropVPS Team

Writer: Cooper Reagan

How to install kubectl on ubuntu 25.04

How to install kubectl on ubuntu 25.04

Publication Date

11/21/2025

Category

Articles

Reading Time

1 Min

Table of Contents

kubectl is the command-line tool used to manage Kubernetes clusters. Installing it on Ubuntu 25.04 is simple and only requires a few commands.

Step 1: Update System Packages

Start with a clean, updated system:

sudo apt update && sudo apt upgrade -y

Step 2: Install Required Dependencies

Make sure your system can access HTTPS repositories:

sudo apt install -y apt-transport-https ca-certificates curl

Step 3: Add the Kubernetes Repository

Download Google's signing key:

curl -fsSLo /usr/share/keyrings/kubernetes-archive-keyring.gpg https://packages.cloud.google.com/apt/doc/apt-key.gpg

 Add the Kubernetes repo to your system:

echo "deb [signed-by=/usr/share/keyrings/kubernetes-archive-keyring.gpg] https://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee /etc/apt/sources.list.d/kubernetes.list

Update package lists:

sudo apt update

Step 4: Install kubectl

Install the latest stable kubectl package:

sudo apt install -y kubectl

Check the version:

kubectl version --client

You should see something similar to:

Client Version: v1.30.x

Step 5: Enable Shell Auto-Completion (Optional)

For easier command usage, enable auto-completion:

echo "source <(kubectl completion bash)" >> ~/.bashrc
source ~/.bashrc

Zsh users:

echo "source <(kubectl completion zsh)" >> ~/.zshrc
source ~/.zshrc

Step 6: Test kubectl (Optional)

If you already have a Kubernetes cluster configured:

kubectl get nodes

If it returns a list of nodes, your kubectl is connected and ready.

Linux VPS
U
Loading...

Related Posts

How to install kubectl on ubuntu 25.04