Skip to main content

How to Install Minikube on Ubuntu server

How to Install Minikube on Ubuntu server

How to Install Minikube on Ubuntu server

This post will show you how to install Minikube on Ubuntu 22.04 or 20.04 LTS. Minikube is a single-node Kubernetes (k8s) cluster. If you're new to Kubernetes and want to learn about it and test deploying apps on it, minikube is the way to do it. It gives you a command line interface for managing a Kubernetes (k8s) cluster and all of its parts.

Prerequisites

  • Super user or any normal user with SUDO privileges.
  • Ubuntu server with up to date security patches
  • Machine with pre-installed docker containers. If you did not installed Docker in you machine yet, kindly follow this article to install Docker on Ubuntu.

Steps to install Minikube on Ubuntu

Step 1: Update your apt repositories and make sure you have installed all security patches

 # apt update && apt upgrade -y 

**Step 2:**Run the following command to install the necessary requirements for Minikube,

# apt install -y curl wget apt-transport-https 

Step 3: Use the curl command below to get the newest minikube binaries,

# curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 

Step 4: Once the binary has been downloaded, transfer it to /usr/local/bin and make sure it can be run.

# install minikube-linux-amd64 /usr/local/bin/minikube 

Step 5: Now verify the installed minikube version

# minikube version 

installed Minikube version

Installed Minikube version

Install Kubectl binary

Step 6: Kubectl is a command line tool that lets you talk to a Kubernetes cluster. It is used to control deployments, services, pods, and other things. Use the curl command shown below to get the most recent 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

Step 7: Once kubectl is downloaded, configure the kubectl binary to be executable and transfer it to /usr/local/bin.

 # chmod +x kubectl  

mv kubectl /usr/local/bin/

Step 8: Now, let's check the installed version of kubectl.

# kubectl version -o yaml 

Installed version of kubectl

Installed version of kubectl

Start the Minikube

Step 9: As we said in the beginning, we would be using docker as the foundation for minikube, so start the minikube with the docker driver, execute

$ minikube start --driver=docker 

Note:: If you run the above command with root privileges, you will encounter the below error. To overcome this, either use --force argument or execute the above command with any normal user.

Error while starting minikube with super user

# minikube start --drive=docker --force 

start the minikube with the docker driver

start the minikube with the docker driver

Note: If you wish to start minikube with custom resources and have the installer choose the driver automatically, you may execute the following command:

minikube start --addons=ingress --cpus=3 --cni=flannel --install-addons=true --kubernetes-version=stable --memory=4g

Step 10: Run the minikube command below to see what's going on.

# minikube status 
Output:

minikube
type: Control Plane
host: Running
kubelet: Running
apiserver: Running
kubeconfig: Configured

Step 11: Run the following kubectl command to check the version of Kubernetes, the status of each node, and cluster information.

kubectl cluster-info && kubectl get nodes

Cluster information after installing minikube

Cluster information after installing minikube