How to Install Minikube on Ubuntu?
When you want to develop and run applications on your local machine, Minikube is a great tool to run Kubernetes. Minikube allows you to run a Kubernetes cluster on your machine. You can install it on Windows, Linux, or macOS. With the help of Minikube, you can use the container environment or a virtual machine environment on your local machine for development work. If you are someone who develops, runs, and tests software single-handedly, you’ll need Minikube as it can aid you with the overall development process.
Minikube is an open-source tool that allows running a single Kubernetes cluster on your device. It creates a VM environment and also supports Docker and Kubernetes. It comes with features like Nodeports, Dashboard, Ingress, DNS, Secrets, CNI, etc.
If you are looking for help regarding the installation of Minikube on your Ubuntu system, you have come to the right place. This article will discuss all the steps that you need to follow for installing Minikube on your Ubuntu system.
So, without further ado, let’s get started.
How to Install Minikube on Your Ubuntu System?
There are five simple steps to install Minikube on a Ubuntu system that are listed as follows:
- Update the system and install required packages
- Install a hypervisor
- Install Minikube
- Install kubectl
- Start Minikube
We will discuss how to accomplish each step in detail. But before that, you need to know that these steps will allow you to install Minikube on Ubuntu 18.04 and 20.04 and even Debian 10.
1. Update System and Install Packages
Before installing Minikube, you must update your system repository cache. It is easy and can be updated with commands that are as follows:
sudo apt-get update sudo apt-get install apt-transport-https sudo apt-get upgrade
Also, install curl with the following command:
sudo apt-get install curl
2. Install a Hypervisor
As you know, Minikube creates a virtual machine environment because the Minikube cluster will be running on a virtual machine. You can use the VirtualBox Hypervisor for creating virtual machines for the Minikube. To install VirtualBox on your Ubuntu system, you need to run the following command:
sudo apt install Virtualbox virtual-ext-pack
It will ask you to confirm the installation. Input “y” to confirm and then hit “Enter”.
After confirming the installation, a license agreement will appear on your screen. You need to agree to it. Press the “Tab” button and then hit “Enter” on your keyboard to continue. The license agreement installer will ask you to agree by popping up a dialog box on your screen. Click on the “Yes” option.
Wait for the installation to complete.
3. Install Minikube
This step is quite important, so you need to be extra attentive.
Firstly, you must install the Minikube binary file using this command:
Now, copy the file and move it to the local directory with the following command:
sudo cp minikube-linux-amd64 /usr/local/bin/minikube
Now, you need to give the file permission to run by the system using the command mentioned below:
sudo chmod 755 /usr/local/bin/minikube
As the last step of the installation, check the version of the Minikube installed on your system by running the following command:
4. Install kubectl
It is a very important component of Kubernetes as it manages and deploys the clusters. It can be downloaded with the help of this command:
curl -LO https://storage.googleapis.com/kubernetes-release/release/`curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt`/bin/linux/amd64/kubectl
Now, execute the following command to make the kubectl binary executable:
chmod +x ./kubectl
Now, move this binary path to your local path with:
sudo mv ./kubectl /usr/local/bin/kubectl
Run the following command to verify the kubectl installation:
kubectl version -o json
5. Start Minikube
Everything has been installed, and you are ready to run Minikube. Initiate Minikube by running the following command:
$ minikube start
With this command, all the components will be installed, and a virtual machine will be created to start your local Kubernetes cluster; all the cluster components will be set up, and as it finishes, you can start working.
These are some common commands which will help you get started with your local cluster.
- Check the cluster status with the following command:
$ kubectl cluster-info
- To check the config view:
$ kubectl config view
- To view the nodes running on the cluster:
$ kubectl get nodes
- To see the pods running on Minikube:
$ kubectl get pod
- To get into the VM of the Minikube:
$ minikube ssh
- You can stop a cluster on Minikube with the help of the following command:
$ minikube stop
- To check the status of a running cluster::
$ minikube status
- To delete a cluster:
$ minikube delete
If you do not like working with the command line, you can manage your cluster from the web dashboard of Kubernetes. It is a default add-on installation in Minikube, so you don’t need to worry about installing it separately. To see the complete lists of add-ons, use the following command:
$ minikube add-ons list
You can access this dashboard with the following command:
$ minikube dashboard
And it will open the dashboard directly on your default browser.
You can also use the URL to open the dashboard by executing the command:
$ minikube dashboard –url
Hopefully, this article has made it clear how you can install Minikube on Ubuntu 18.04, 20.04 as well as Debian 10 Linux. If you follow all the steps mentioned above, you can install Minikube and run it on your system within a few minutes, and that too with relative ease.