In this post, we will show you how to install of Minikube on Ubuntu 24.04 step-by-step.
Minikube is an open-source tool that allows you to run a single-node Kubernetes cluster locally on your system. Minikube is designed to make it easy for developers to set up a Kubernetes environment for local development and testing purposes. It creates a lightweight, isolated Kubernetes cluster that runs inside a virtual machine (VM) on your local system.
Prerequisites
- Pre-Install Ubuntu 24.04
- Sudo User with admin privileges
- 2 GB RAM or more
- 2 CPU / vCPU or more
- 20 GB free hard disk space or more
- Docker / Virtual Machine Manager – KVM & VirtualBox
- Stable Internet Connection
Note: In this post, we will be using Docker container as a base for minikube. In case, docker is not installed on your Ubuntu system then use following URL to install it.
Without any further delay, let’s deep dive into the Minikube Installation steps on Ubuntu 24.04.
1) Apply Updates
Install all updates of existing packages of your system by executing the following apt commands from the terminal.
$ sudo apt update $ sudo apt upgrade -y
Once all the updates are installed then reboot your system.
$ sudo reboot
2) Install Minikube Dependencies
Run the following to Install minikube dependencies.
$ sudo apt install -y curl wget apt-transport-https
3) Download and Install Minikube Binary
Use the following curl command to download latest minikube binary,
$ curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
Once the binary is downloaded then install it under the path /usr/local/bin.
$ sudo install minikube-linux-amd64 /usr/local/bin/minikube
Verify the minikube version
$ minikube version minikube version: v1.33.1 commit: 5883c09216182566a63dff4c326a6fc9ed2982ff $
Note: At the time of writing this tutorial, latest version of minikube was v1.33.1.
4) Install Kubectl Utility
Kubectl is a command line utility which is used to interact with Kubernetes cluster. It is used for managing deployments, service and pods etc. Use below curl command to download latest version of kubectl.
$ curl -LO https://storage.googleapis.com/kubernetes-release/release/`curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt`/bin/linux/amd64/kubectl
Once kubectl is downloaded then set the executable permissions on kubectl binary and move it to the path /usr/local/bin.
$ chmod +x kubectl $ sudo mv kubectl /usr/local/bin/
Now verify the kubectl version
$ kubectl version -o yaml
5) Start Minikube
As we are already stated in the beginning that we would be using docker as base for minikue, so start the minikube with the docker driver, run
$ minikube start --driver=docker
Perfect, above output confirms that minikube cluster has been configured and started successfully.
In case you want to start minikube with customize resources and want installer to automatically select the driver then you can run following command,
$ minikube start --addons=ingress --cpus=2 --cni=flannel --install-addons=true --kubernetes-version=stable --memory=6g
Run below minikube command to check status,
linuxtechi@ubuntu-24-04:~$ minikube status minikube type: Control Plane host: Running kubelet: Running apiserver: Running kubeconfig: Configured linuxtechi@ubuntu-24-04:~$
Run following kubectl command to verify the Kubernetes version, node status and cluster info.
$ kubectl cluster-info $ kubectl get nodes
Output of above commands would like below:
6) Managing Minikube Addons
Addons are the additional functionality to minikube cluster, by default, only couple of addons are enabled during minikube installation. To list the addons of minikube, run the below command.
$ minikube addons list
If you wish to enable any addons run the below minikube command,
$ minikube addons enable <addon-name>
Let’s suppose, we want to enable and access Kubernetes dashboard , run
$ minikube dashboard enable or $ minikube addons enable dashboard
It will also open the Kubernetes dashboard in the web browser automatically
To enable Ingress controller addon, run
$ minikube addons enable ingress
7) Verify Minikube Installation
To verify the minikube installation, let’s try to deploy nginx based deployment.
Run below kubectl command to install nginx based deployment.
$ kubectl create deployment my-app --image=nginx
Run following kubectl command to verify deployment status
$ kubectl get deployments.apps my-app $ kubectl get pods
Output of above commands would look like below:
Expose the deployment using following command,
$ kubectl expose deployment my-app --name=my-app-svc --type=NodePort --port=80 $ kubectl get svc my-app-svc
Use below command to get your service url,
$ minikube service my-app-svc --url http://192.168.49.2:31895 $
It will start the application in the web browser automatically. If you want to access your application from the command line then use the following url.
$ curl http://192.168.49.2:30636
Output,
Great, above confirms that NGINX application is accessible.
8) Managing Minikube Cluster
To stop the minikube, run
$ minikube stop
To delete the minikube, run
$ minikube delete
To start the minikube, run
$ minikube start
In case you want to start the minikube with higher resource like 8 GB RM and 4 CPU then execute following commands one after the another.
$ minikube config set cpus 4 $ minikube config set memory 8192 $ minikube delete $ minikube start
That’s all from this post, I hope you have learnt how to install Minikube on Ubuntu 24.04. Please don’t hesitate to share your feedback and queries in below comments section.
Also Read: How to Configure Static IP Address on Ubuntu 24.04 (Desktop)
Hi, I’m facing this error. How can I configure my docker to 2 CPUs instead of 1
Exiting due to RSRC_INSUFFICIENT_CORES: Requested cpu count 2 is greater than the available cpus of 1
I get this error. I guess it’s out of date?
❗ Enabling ‘storage-provisioner’ returned an error: running callbacks: [sudo KUBECONFIG=/var/lib/minikube/kubeconfig /var/lib/minikube/binaries/v1.30.0/kubectl apply –force -f /etc/kubernetes/addons/storage-provisioner.yaml: Process exited with status 1
stdout:
stderr:
error: error validating “/etc/kubernetes/addons/storage-provisioner.yaml”: error validating data: failed to download openapi: Get “https://localhost:8443/openapi/v2?timeout=32s”: dial tcp [::1]:8443: connect: connection refused; if you choose to ignore these errors, turn validation off with –validate=false
]
delete the minikube container (you can see it with a docker ps either you do a minikube delete or docker rm minikube) which was created at the time of your minikube start and you start again by typing minikube start –driver=docker