Minikube Installation Guide for Linux [Ubuntu] ๐Ÿ™‚๐Ÿ‘

Minikube Installation Guide for Linux [Ubuntu] ๐Ÿ™‚๐Ÿ‘

ยท

3 min read

Minikube is a great tool for running a single-node Kubernetes cluster locally on your Ubuntu machine for development and testing purposes. This guide will walk you through the installation process step-by-step.

Before you begin:

  • Make sure you are using Ubuntu.

  • You have sudo privileges (ability to run commands as an administrator).

  • Your computer has internet access.

  • Virtualization support is enabled on your machine (check by running the command egrep -c '(vmx|svm)' /proc/cpuinfo. If the output is 0, virtualization is disabled; if it's 1, it's enabled).

Steps to install Minikube on Ubuntu:

  1. Update your system packages:

This ensures you have the latest versions of software and dependencies.

sudo apt update
  1. Install required packages:

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

This installs some basic packages that Minikube needs to run.

  1. Install Docker:

Minikube can run a Kubernetes cluster in a virtual machine (VM) or locally via Docker. This guide will use Docker.

sudo apt install -y docker.io

This installs Docker on your system.

Next, start and enable Docker so it runs in the background.

sudo systemctl enable --now docker

Then, add your current user to the docker group so you can use Docker without needing root privileges.

sudo usermod -aG docker $USER && newgrp docker

Note: After adding yourself to the group, you will need to log out and log back in for the changes to take effect.

  1. Install Minikube:

First, download the Minikube binary using curl:

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

Then, make the downloaded file executable and move it to your path so you can run it from anywhere in your terminal.

chmod +x minikube
sudo mv minikube /usr/local/bin/
  1. Install kubectl:

kubectl is a command-line tool for interacting with Kubernetes clusters. Download it using curl.

curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"

Make the downloaded file executable and move it to your path.

chmod +x kubectl
sudo mv kubectl /usr/local/bin/
  1. Start Minikube:

Now you can start Minikube with the following command:

minikube start --driver=docker --vm=true

This command will start a single-node Kubernetes cluster inside a Docker container on your machine.

  1. Verify the installation:

Check the status of your Kubernetes cluster using the following command:

minikube status

You should see output indicating that the cluster is running.

You can also use kubectl to interact with your cluster. Try running the following command to see the list of nodes in your cluster:

kubectl get nodes
  1. Stop Minikube (optional):

When you're finished using Minikube, you can stop the cluster with this command:

minikube stop
  1. Delete Minikube (optional):

If you no longer need Minikube, you can completely remove it from your system using the following command:

minikube delete

Congratulations! You have now successfully installed Minikube on your Ubuntu machine. You can now start deploying Kubernetes applications for development and testing purposes.

ย