Are you ready to discover the power of Kubernetes? In this step-by-step tutorial we show you how to install Minikube on Ubuntu Linux system with the base hypervisor being Libvirt(KVM) or VirtualBox. We’ll kickstart with a basic introduction to Minikube then dive into the actual installation of Minikube and how to start using it.

Minikube is an open source tool that was developed to enable developers and system administrators to run a single cluster of Kubernetes on their local machine. Minikube starts a single node kubernetes cluster locally with small resource utilization. This is ideal for development tests and POC purposes.

🏆 BESTSELLER

The Ultimate Ubuntu Desktop Handbook

Master Ubuntu like a pro - from beautiful desktop customization to powerful terminal automation. Perfect for developers, system admins, and power users who want total control of their workspace.

Only $15 $30
Get Instant Access →

For CentOS, check out: Installing Minikube on CentOS 7/8 with KVM.

In a nutshell, Minikube packages and configures a Linux VM, then installs Docker and all Kubernetes components into it.

Minikube supports Kubernetes features such as:

  • DNS
  • NodePorts
  • ConfigMaps and Secrets
  • Dashboards
  • Container Runtime: Docker, CRI-O, and containerd
  • Enabling CNI (Container Network Interface)
  • Ingress
  • PersistentVolumes of type hostPath

Let’s begin to install Minikube on Ubuntu Linux.

Install KVM or VirtualBox Hypervisor

Run the following commands to update all system packages to the latest release:

sudo apt update && sudo apt upgrade -y

If a reboot is required after the upgrade then perform the process.

[ -f /var/run/reboot-required ] && sudo reboot -f

For VirtualBox users, install VirtualBox using:

KVM Hypervisor Users

For those interested in using KVM hypervisor, check our guide on how to Install KVM on CentOS / Ubuntu / Debian

Then follow How to run Minikube on KVM instead.

Download and Configure Minikube on Ubuntu

You need to download the minikube binary. I will put the binary under /usr/local/bin directory since it is inside $PATH.

wget https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
chmod +x minikube-linux-amd64
sudo mv minikube-linux-amd64 /usr/local/bin/minikube

Confirm version installed

$ minikube version
minikube version: v1.33.1
commit: 5883c09216182566a63dff4c326a6fc9ed2982ff

We need kubectl which is a command line tool used to deploy and manage applications on Kubernetes:

curl -LO https://storage.googleapis.com/kubernetes-release/release/`curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt`/bin/linux/amd64/kubectl

Make the kubectl binary executable.

chmod +x ./kubectl

Move the binary in to your PATH:

sudo mv ./kubectl /usr/local/bin/kubectl

Check version:

$ kubectl version -o json  --client
{
  "clientVersion": {
    "major": "1",
    "minor": "30",
    "gitVersion": "v1.30.2",
    "gitCommit": "39683505b630ff2121012f3c5b16215a1449d5ed",
    "gitTreeState": "clean",
    "buildDate": "2024-06-11T20:29:44Z",
    "goVersion": "go1.22.4",
    "compiler": "gc",
    "platform": "linux/amd64"
  },
  "kustomizeVersion": "v5.0.4-0.20230601165947-6ce0bf390ce3"
}

Starting minikube on Ubuntu

Now that components are installed, you can start minikube. VM image will be downloaded and configure d for Kubernetes single node cluster.

  • Minikube with KVM driver
minikube start --driver=kvm2
minikube start --driver=virtualbox

Example output from execution commands.

...................................
* Using the kvm2 driver based on user configuration
*   https://minikube.sigs.k8s.io/docs/reference/drivers/none/
* Downloading driver docker-machine-driver-kvm2:
    > docker-machine-driver-kvm2-...:  65 B / 65 B [---------] 100.00% ? p/s 0s
    > docker-machine-driver-kvm2-...:  13.46 MiB / 13.46 MiB  100.00% ? p/s 100
* Downloading VM boot image ...
    > minikube-v1.33.1-amd64.iso....:  65 B / 65 B [---------] 100.00% ? p/s 0s
    > minikube-v1.33.1-amd64.iso:  314.16 MiB / 314.16 MiB  100.00% 37.68 MiB p
* Starting "minikube" primary control-plane node in "minikube" cluster
* Downloading Kubernetes v1.30.0 preload ...
    > preloaded-images-k8s-v18-v1...:  342.90 MiB / 342.90 MiB  100.00% 38.75 M
* Creating kvm2 VM (CPUs=2, Memory=2200MB, Disk=20000MB) ...
* Preparing Kubernetes v1.30.0 on Docker 26.0.2 ...
  - Generating certificates and keys ...
  - Booting up control plane ...
  - Configuring RBAC rules ...
* Configuring bridge CNI (Container Networking Interface) ...
* Verifying Kubernetes components...
  - Using image gcr.io/k8s-minikube/storage-provisioner:v5
* Enabled addons: default-storageclass, storage-provisioner
* Done! kubectl is now configured to use "minikube" cluster and "default" namespace by default

Wait for the download and setup to finish then confirm that everything is working fine.

To set default Minikube driver, use:

# VirtualBox
minikube config set driver virtualbox

# KVM
minikube config set driver kvm

Minikube Basic operations

To check cluster status, run:

$ kubectl cluster-info

Kubernetes master is running at https://192.168.39.117:8443
KubeDNS is running at https://192.168.39.117:8443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy

To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.

Note that Minikube configuration file is located under ~/.minikube/machines/minikube/config.json

To View Config, use:

$ kubectl config view
apiVersion: v1
clusters:
- cluster:
    certificate-authority: /root/.minikube/ca.crt
    extensions:
    - extension:
        last-update: Sat, 13 Jul 2024 15:29:47 UTC
        provider: minikube.sigs.k8s.io
        version: v1.33.1
      name: cluster_info
    server: https://192.168.39.249:8443
  name: minikube
contexts:
- context:
    cluster: minikube
    extensions:
    - extension:
        last-update: Sat, 13 Jul 2024 15:29:47 UTC
        provider: minikube.sigs.k8s.io
        version: v1.33.1
      name: context_info
    namespace: default
    user: minikube
  name: minikube
current-context: minikube
kind: Config
preferences: {}
users:
- name: minikube
  user:
    client-certificate: /root/.minikube/profiles/minikube/client.crt
    client-key: /root/.minikube/profiles/minikube/client.key

To check running nodes:

$ kubectl get nodes
NAME       STATUS   ROLES           AGE     VERSION
minikube   Ready    control-plane   5m29s   v1.30.0

Access minikube VM using ssh:

$ minikube ssh

                         _             _            
            _         _ ( )           ( )           
  ___ ___  (_)  ___  (_)| |/')  _   _ | |_      __  
/' _ ` _ `\| |/' _ `\| || , <  ( ) ( )| '_`\  /'__`\
| ( ) ( ) || || ( ) || || |\`\ | (_) || |_) )(  ___/
(_) (_) (_)(_)(_) (_)(_)(_) (_)`\___/'(_,__/'`\____)

$ sudo su -

To stop a running local kubernetes cluster, run:

$ minikube stop

To delete a local kubernetes cluster, use:

$ minikube delete

Kubernete ships with a web dashboard which allows you to manage your cluster without interacting with a command line. The dashboard addon is installed and enabled by default on minikube.

$ minikube addons list
...
|-----------------------------|----------|--------------|--------------------------------|
|         ADDON NAME          | PROFILE  |    STATUS    |           MAINTAINER           |
|-----------------------------|----------|--------------|--------------------------------|
| ambassador                  | minikube | disabled     | 3rd party (Ambassador)         |
| auto-pause                  | minikube | disabled     | minikube                       |
| cloud-spanner               | minikube | disabled     | Google                         |
| csi-hostpath-driver         | minikube | disabled     | Kubernetes                     |
| dashboard                   | minikube | disabled     | Kubernetes                     |
| default-storageclass        | minikube | enabled ✅   | Kubernetes                     |
| efk                         | minikube | disabled     | 3rd party (Elastic)            |
| freshpod                    | minikube | disabled     | Google                         |
| gcp-auth                    | minikube | disabled     | Google                         |
| gvisor                      | minikube | disabled     | minikube                       |
| headlamp                    | minikube | disabled     | 3rd party (kinvolk.io)         |
| helm-tiller                 | minikube | disabled     | 3rd party (Helm)               |
| inaccel                     | minikube | disabled     | 3rd party (InAccel             |
|                             |          |              | [[email protected]])            |
| ingress                     | minikube | disabled     | Kubernetes                     |
| ingress-dns                 | minikube | disabled     | minikube                       |
| inspektor-gadget            | minikube | disabled     | 3rd party                      |
|                             |          |              | (inspektor-gadget.io)          |
| istio                       | minikube | disabled     | 3rd party (Istio)              |
| istio-provisioner           | minikube | disabled     | 3rd party (Istio)              |
| kong                        | minikube | disabled     | 3rd party (Kong HQ)            |
| kubeflow                    | minikube | disabled     | 3rd party                      |
| kubevirt                    | minikube | disabled     | 3rd party (KubeVirt)           |
| logviewer                   | minikube | disabled     | 3rd party (unknown)            |
| metallb                     | minikube | disabled     | 3rd party (MetalLB)            |
| metrics-server              | minikube | disabled     | Kubernetes                     |
| nvidia-device-plugin        | minikube | disabled     | 3rd party (NVIDIA)             |
| nvidia-driver-installer     | minikube | disabled     | 3rd party (Nvidia)             |
| nvidia-gpu-device-plugin    | minikube | disabled     | 3rd party (Nvidia)             |
| olm                         | minikube | disabled     | 3rd party (Operator Framework) |
| pod-security-policy         | minikube | disabled     | 3rd party (unknown)            |
| portainer                   | minikube | disabled     | 3rd party (Portainer.io)       |
| registry                    | minikube | disabled     | minikube                       |
| registry-aliases            | minikube | disabled     | 3rd party (unknown)            |
| registry-creds              | minikube | disabled     | 3rd party (UPMC Enterprises)   |
| storage-provisioner         | minikube | enabled ✅   | minikube                       |
| storage-provisioner-gluster | minikube | disabled     | 3rd party (Gluster)            |
| storage-provisioner-rancher | minikube | disabled     | 3rd party (Rancher)            |
| volumesnapshots             | minikube | disabled     | Kubernetes                     |
| yakd                        | minikube | disabled     | 3rd party (marcnuri.com)       |
|-----------------------------|----------|--------------|--------------------------------|

To enable a module use command:

minikube addons enable <module>

Example:

$ minikube addons enable portainer
! portainer is a 3rd party addon and is not maintained or verified by minikube maintainers, enable at your own risk.
! portainer does not currently have an associated maintainer.
  - Using image docker.io/portainer/portainer-ce:2.15.1
* The 'portainer' addon is enabled

To open directly on your default browser, use:

$ minikube dashboard

To get the URL of the dashboard

$ minikube dashboard --url
http://192.168.39.117:30000

Access Kubernetes Dashboard by opening the URL on your favorite browser. For further reading, check:

More guides on Kubernetes:

LEAVE A REPLY

Please enter your comment!
Please enter your name here