How to Install Kubernetes with kubeadm on Ubuntu 24.04
Learn how to install kubernetes with kubeadm on ubuntu 24.04 with containerd runtime, kernel module configuration, CNI networking, and node joining.

5 min read
Learn how to install kubernetes with kubeadm on ubuntu 24.04 with containerd runtime, kernel module configuration, CNI networking, and node joining.
- Prerequisites and Supported Releases
- Step 1: System Preparation and Disabling Swap
- Step 2: Configuring Kernel Modules and Sysctl Packet Routing
Kubernetes has become the industry-standard container orchestration platform for running containerized microservices at global scale.
While managed cloud offerings (like EKS, GKE, or AKS) abstract the underlying infrastructure, deploying Kubernetes directly using kubeadm provides complete architectural control and deep operational knowledge.
Setting up a production-ready Kubernetes cluster on Ubuntu 24.04 LTS (Noble Numbat) requires precise operating system preparation, including disabling swap memory, enabling kernel packet routing modules, and configuring the container runtime interface (CRI).
Using the modern community-owned pkgs.k8s.io package repository ensures you deploy verified upstream Kubernetes components (kubelet, kubeadm, and kubectl) supported by the Cloud Native Computing Foundation (CNCF).
In this guide, we walk through how to install kubernetes with kubeadm on ubuntu 24.04 from bare OS preparation to running your first pod.
Complete production-grade administrator tutorial for building a Kubernetes cluster on Ubuntu 24.04 LTS (Noble Numbat) using kubeadm. Covers disabling swap, loading kernel overlay and br_netfilter modules, configuring containerd with systemd cgroups, initializing the control plane, and deploying a Calico/Flannel CNI network plugin.
Prerequisites and Supported Releases
This guide is thoroughly verified on Ubuntu 24.04 LTS (Noble Numbat) & Ubuntu 22.04 LTS. The instructions apply cleanly to cloud instances (AWS EC2, Google Compute Engine, DigitalOcean, Hetzner), bare-metal servers, and local virtual machines.
Before proceeding, ensure you have the following requirements satisfied:
- At least two servers or virtual machines running Ubuntu 24.04 LTS (1 control plane node, 1+ worker nodes).
- Minimum 2 GB RAM and 2 CPU cores for the control plane node; 1 GB RAM for worker nodes.
- Unique hostnames and static internal IP addresses configured for each node.
- A non-root user account with
sudoadministrative privileges.
Step 1: System Preparation and Disabling Swap
The Kubernetes scheduler requires deterministic resource accounting; running with swap memory enabled causes unpredictable memory latency and scheduler instability.
First, disable swap memory immediately and comment out any swap partitions in /etc/fstab to keep swap disabled across reboots:
Execute the following commands on all participating cluster nodes:
# Disable active swap memory immediately:
sudo swapoff -a
# Permanently disable swap in /etc/fstab:
sudo sed -i '/swap/s/^/#/' /etc/fstab
# Verify swap status (swap total should be 0):
free -h
Step 2: Configuring Kernel Modules and Sysctl Packet Routing
Kubernetes networking requires the Linux kernel to load the overlay filesystem module and the br_netfilter bridge packet filtering module.
Furthermore, Linux iptables must be configured to inspect bridged IPv4 and IPv6 network packets.
Create configuration drop-in files to load modules and apply sysctl parameters permanently on all nodes:
# Configure kernel modules to load on boot:
cat << 'EOF' | sudo tee /etc/modules-load.d/k8s.conf
overlay
br_netfilter
EOF
# Load modules immediately:
sudo modprobe overlay
sudo modprobe br_netfilter
# Configure sysctl networking parameters:
cat << 'EOF' | sudo tee /etc/sysctl.d/k8s.conf
net.bridge.bridge-nf-call-iptables = 1
net.bridge.bridge-nf-call-ip6tables = 1
net.ipv4.ip_forward = 1
EOF
# Apply sysctl parameters without reboot:
sudo sysctl --system
Step 3: Installing and Configuring the Containerd Runtime
Kubernetes communicates with containers through the Container Runtime Interface (CRI).
containerd is the premier lightweight CRI runtime utilized across modern Kubernetes clusters.
Install containerd from the official Ubuntu repositories and configure it to use the systemd cgroup driver:
# Install containerd:
sudo apt update
sudo apt install -y containerd
# Generate default configuration:
sudo mkdir -p /etc/containerd
containerd config default | sudo tee /etc/containerd/config.toml > /dev/null
# Enable systemd cgroup driver in config.toml:
sudo sed -i 's/SystemdCgroup = false/SystemdCgroup = true/g' /etc/containerd/config.toml
# Restart containerd to apply changes:
sudo systemctl restart containerd
sudo systemctl enable containerd
Step 4: Installing kubeadm, kubelet, and kubectl
Kubernetes packages are distributed via the official CNCF repository hosted at pkgs.k8s.io.
Add the repository signing key and repository list for Kubernetes v1.30 or v1.31:
Install kubelet, kubeadm, and kubectl, and hold their package versions to prevent unintended upgrades:
# Install repository transport prerequisites:
sudo apt install -y apt-transport-https ca-certificates curl gpg
# Download official Kubernetes GPG signing key:
curl -fsSL https://pkgs.k8s.io/core:/stable:/v1.30/deb/Release.key | sudo gpg --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg
# Add official Kubernetes APT repository:
echo 'deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v1.30/deb/ /' | sudo tee /etc/apt/sources.list.d/kubernetes.list
# Install Kubernetes tools:
sudo apt update
sudo apt install -y kubelet kubeadm kubectl
# Hold package versions to prevent automatic updates:
sudo apt-mark hold kubelet kubeadm kubectl
Step 5: Initializing the Control Plane Node
Run the kubeadm init command exclusively on your designated control plane node.
Specify the pod network CIDR matching your chosen Container Network Interface (e.g. 192.168.0.0/16 for Calico):
# Run on the CONTROL PLANE node only:
sudo kubeadm init --pod-network-cidr=192.168.0.0/16 --control-plane-endpoint=control-plane-ip
# Expected success output snippet:
# Your Kubernetes control-plane has initialized successfully!
# To start using your cluster, you need to run the following as a regular user:
# mkdir -p $HOME/.kube
# sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
# sudo chown $(id -u):$(id -g) $HOME/.kube/config
Configuring kubectl for Your Regular User
Copy the administrative kubeconfig credentials into your user home directory so you can run kubectl without sudo:
mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config
# Verify cluster connectivity:
kubectl cluster-info
kubectl get nodes
Step 6: Deploying a Container Network Interface (Calico CNI)
Until a Container Network Interface (CNI) is deployed, all nodes remain in the NotReady state because pod-to-pod networking cannot function.
Install Calico, the industry standard CNI plugin, using the official manifest:
# Deploy Calico CNI manifest:
kubectl apply -f https://raw.githubusercontent.com/projectcalico/calico/v3.28.0/manifests/calico.yaml
# Watch pod initialization across kube-system namespace:
kubectl get pods -n kube-system
# Confirm nodes transition to Ready:
kubectl get nodes
# NAME STATUS ROLES AGE VERSION
# control-plane Ready control-plane 2m v1.30.4
Step 7: Deploying and Testing a Sample Workload
With both the control plane and worker nodes reporting Ready status, verify pod scheduling and service networking by launching an Nginx deployment.
Create a deployment and expose it as a NodePort service:
Test connectivity to the exposed NodePort service from your terminal shell:
# Create a sample deployment with two replicas:
kubectl create deployment nginx-test --image=nginx:alpine --replicas=2
# Expose deployment on a cluster node port:
kubectl expose deployment nginx-test --type=NodePort --port=80
# Inspect the allocated NodePort:
kubectl get services nginx-test
# Test HTTP response against worker node IP:
curl -I http://worker-ip:NODE_PORT
Troubleshooting and Common Errors
When configuring Ubuntu servers, unexpected permission errors, network timeouts, or lock contention can occur. Review these common issues and verified resolutions:
[ERROR CRI]: container runtime is not running
Cause: containerd is not using the systemd cgroup driver, or the socket path is misconfigured.
Resolution: Verify SystemdCgroup = true in /etc/containerd/config.toml and restart containerd.
sudo systemctl restart containerd && sudo systemctl status containerd
Nodes stuck in NotReady state
Cause: The CNI network plugin (Calico or Flannel) has not been installed or has failed pods.
Resolution: Check pod logs in the kube-system namespace using kubectl get pods -n kube-system.
kubectl get pods -n kube-system
[ERROR Swap]: running with swap on is not supported
Cause: Swap memory is enabled on the system.
Resolution: Execute sudo swapoff -a and comment out swap partitions in /etc/fstab.
sudo swapoff -a
Security Best Practices and Hardening
Protect your admin.conf and ~/.kube/config files with strict 600 permissions, as they contain full cluster administrator credentials.
Do not run untrusted workloads in privileged containers or with host network namespaces.
Implement NetworkPolicies in production to isolate inter-namespace traffic.
Related Ubuntu Tutorials and Documentation
Deepen your Linux system administration skills with our related production-tested guides:
- Initial Server Setup on Ubuntu 24.04 LTS — Configure static IP addresses, sudo users, and firewalls for Kubernetes nodes.
- How to Install Podman on Ubuntu: Rootless Container Alternative to Docker — Explore lightweight single-node container alternatives to full Kubernetes clusters.
- How to Configure Networking with Netplan on Ubuntu — Set up persistent network interfaces and bridge routing on Ubuntu.
Authoritative References and Official Documentation

The Linux Command Line, 2nd Edition: A Complete Introduction
Frequently Asked Questions
Quick answers to common questions and configurations
kubeadm init, a join token command is generated. On worker nodes, run the command: sudo kubeadm join :6443 --token --discovery-token-ca-cert-hash sha256:.kubectl taint nodes --all node-role.kubernetes.io/control-plane-.kubeadm builds conformant upstream Kubernetes clusters ideal for production environments. Minikube is tailored for local desktop testing inside VMs, and K3s is a lightweight, single-binary distribution optimized for edge and IoT.Editorial Disclosure: Website Vidya is supported by our readers. When you purchase hosting, tools, or software through our verified partner links, we may earn an affiliate commission at no extra cost to you. We only recommend solutions we trust and rigorously verify.
Rajesh Ray
I’m Rajesh Rai, a full-stack developer, Linux administrator, and technology enthusiast passionate about making complex technology easier to understand and use.
Most Read Guides
TrendingUbuntu Server Not Booting? 10 Simple Steps to Fix It Fast
How to Create a 3D Button in HTML and CSS: Easy Steps
How to Install Python and Pip on Ubuntu 24.04 LTS
How to Install Nginx on Ubuntu 24.04
How to Install Python on Ubuntu 24.04 LTS
Related Technical Guides
Tested runbooks, server administration walkthroughs, and troubleshooting guides
Join the Conversation & Perspective
Have thoughts, counterpoints, or reflections on this story? Engage directly with fellow readers and editorial contributors.
No comments on this guide yet. Be the first to share your thoughts or ask a question!