How to set up Kubernetes cluster on local machine using minikube ?

Last Updated : 7 Oct, 2026

Minikube is a tool that allows you to run a Kubernetes cluster locally on your computer. It creates a local Kubernetes cluster with a single node. The cluster can run inside a container or a virtual machine depending on the selected driver.

Prerequisites

Before starting, make sure the following are installed:

  • Docker
  • kubectl
  • Minikube

You should also have basic knowledge of Kubernetes concepts such as Pods, Deployments, and Services.

Install Minikube

Minikube provides installation packages for Linux, macOS, and Windows.

For Linux, Minikube can be installed using:

curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
sudo install minikube-linux-amd64 /usr/local/bin/minikube

Verify the installation:

minikube version

Install kubectl

kubectl is the command-line tool used to communicate with the Kubernetes cluster.

Verify whether kubectl is already installed:

kubectl version --client

If it is not installed, install it according to your operating system.

Start the Minikube Cluster

Start the local Kubernetes cluster using the Docker driver:

minikube start --driver=docker

Minikube creates the Kubernetes cluster and configures kubectl to communicate with it.

Once the cluster starts successfully, you can verify its status.

minikube status

A running cluster should show the Minikube components in a Running state.

Verify the Kubernetes Cluster

Check the available nodes:

kubectl get nodes

You should see a node with the status:

get_nodes

Open the Minikube Dashboard

Minikube provides a Kubernetes Dashboard that can be used to view and manage cluster resources.

Enable the Dashboard:

minikube addons enable dashboard

Start the Dashboard:

minikube dashboard

The Dashboard opens in the default web browser.

It can be used to view resources such as:

  • Nodes
  • Pods
  • Deployments
  • Services
  • ConfigMaps
  • Secrets
minikube_dashboard

Deploy an Application on Minikube

After creating the cluster, we can deploy a simple Nginx application.

Create an Nginx Deployment:

kubectl create deployment nginx --image=nginx

Check the Deployment:

kubectl get deployments

Check the Pod created by the Deployment:

kubectl get pods

The Pod should eventually show the Running status.

image-nginx

Expose the Application

A Kubernetes Service can be used to expose the Nginx application.

Create a NodePort Service:

kubectl expose deployment nginx --type=NodePort --port=80

Check the Service:

kubectl get services

The Service exposes the Nginx application through a port on the Minikube node.

Services

Access the Application

Minikube provides a simple command to open a Service in the browser.

Run:

minikube service nginx

Minikube opens the Nginx application in the default browser.

welcome_page_nginx

You can also get the Service URL without opening the browser:

minikube service nginx --url

Check Kubernetes Resources

You can use kubectl commands to inspect the resources running in the cluster.

List all Pods:

kubectl get pods

List Deployments:

kubectl get deployments

List Services:

kubectl get services

List all resources:

kubectl get all
resources

Stop the Minikube Cluster

When you finish working with the cluster, you can stop it without deleting the cluster.

minikube stop

The cluster and its resources are preserved and can be started again later.

Start it again using:

minikube start

Delete the Minikube Cluster

If you no longer need the cluster, you can delete it completely.

minikube delete

This removes the Minikube cluster and its associated resources.

Common Commands

CommandDescription
minikube startStarts the Minikube cluster
minikube statusChecks the cluster status
minikube stopStops the cluster
minikube deleteDeletes the cluster
minikube dashboardOpens the Kubernetes Dashboard
minikube addons listLists available Minikube add-ons
minikube addons enable dashboardEnables the Dashboard
minikube service nginxOpens the Nginx Service
minikube service nginx --urlDisplays the Nginx Service URL
kubectl get nodesLists Kubernetes nodes
kubectl get podsLists Pods
kubectl get deploymentsLists Deployments
kubectl get servicesLists Services
Comment

Explore