Kubernetes has become the go-to platform for automating the deployment, scaling, and operation of application containers. With its popularity soaring, more developers and IT professionals are keen to master it. This guide will walk you through the steps to install Kubernetes on Ubuntu in 2025.
Before diving into the installation process, ensure you have:
First, update your system to ensure all packages are current. Open your terminal and execute the following commands:
1 2 |
sudo apt-get update sudo apt-get upgrade |
Kubernetes uses Docker as its container runtime. Install Docker by running:
1 2 3 |
sudo apt-get install -y docker.io sudo systemctl start docker sudo systemctl enable docker |
Verify the Docker installation:
1
|
docker --version |
Add the Kubernetes APT repository and install the required packages:
1 2 3 4 5 |
sudo apt-get update && sudo apt-get install -y apt-transport-https curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add - echo "deb https://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee /etc/apt/sources.list.d/kubernetes.list sudo apt-get update sudo apt-get install -y kubelet kubeadm kubectl |
Initialize your Kubernetes cluster with:
1
|
sudo kubeadm init |
After the initialization completes, set up your local kubeconfig:
1 2 3 |
mkdir -p $HOME/.kube sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config sudo chown $(id -u):$(id -g) $HOME/.kube/config |
Kubernetes requires a networking solution. Choose and deploy one, like Flannel, with:
1
|
kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml |
Your Kubernetes installation is now complete! You can create and manage your containers.
To further enhance your Kubernetes capabilities, consider exploring helm charts for efficient Kubernetes management:
By mastering these tools and processes, you’ll be well-equipped to manage complex Kubernetes deployments efficiently.