Maintenance

Site is under maintenance — quizzes are still available.

Go to quizzes

Install Minikube

Step-by-step guide to install minikube on your machine for Kubernetes local development.

Focus: install minikube on your machine

Sponsored

If you've ever tried setting up a full-blown Kubernetes cluster just to test a YAML manifest, you know the pain: expensive cloud instances, complicated configurations, and a steep learning curve that has nothing to do with learning Kubernetes itself. You need a local, lightweight, single-node cluster that starts in minutes, costs nothing, and is perfect for experimentation. That's exactly what minikube provides—a portable Kubernetes playground for your laptop.

The problem this lesson solves

Kubernetes is powerful, but its initial setup can be daunting. Installing a proper production-grade cluster (using kubeadm, for instance) requires at least two machines, networking setup, certificate management, and a lot of patience. For developers learning Kubernetes, that overhead kills momentum. You want to write YAML, deploy pods, and see them run—not wrestle with infrastructure.

minikube eliminates this barrier. It runs a single-node Kubernetes cluster inside a virtual machine (or container) on your local machine. You get all the core Kubernetes components—API server, scheduler, controller manager, etcd, and kubelet—without the complexity of multi-node networking or cloud provider integration. The result: a kubectl CLI that behaves exactly like a real cluster, but runs on your laptop.

Core concept / mental model

Think of minikube as a Kubernetes simulator for your laptop. Just as you might use an emulator to run console games on your PC, minikube emulates a real Kubernetes environment. It creates a lightweight VM (using drivers like VirtualBox, HyperKit, KVM, or Docker) and installs Kubernetes components inside that VM. You interact with it via the standard kubectl command-line tool, exactly as you would with any other Kubernetes cluster.

How it's different from other local options

  • Minikube vs. kind (Kubernetes IN Docker): kind runs Kubernetes nodes as Docker containers; minikube can use VMs or Docker. Minikube is more feature-rich (it supports addons like a dashboard, ingress, and metrics server out of the box), whereas kind is simpler and faster for CI/CD pipelines.
  • Minikube vs. k3s / MicroK8s: These are more lightweight than minikube. Minikube is designed for developers who want an authentic, full-featured Kubernetes experience with minimal setup. It's the recommended choice for the official Kubernetes documentation.

Pro tip: Minikube runs Kubernetes v1.28+ (as of 2024) and supports multiple container runtimes (Docker, containerd, CRI-O). You can even switch between them for testing.

How it works step by step

Here's the high-level flow of installing and starting minikube:

  1. Install a hypervisor (if you want VM-based approach) or Docker (for container-based).
  2. Download the minikube binary for your operating system.
  3. Start minikube with a command like minikube start.
  4. minikube downloads a boot2docker ISO (or uses your local Docker) and creates a VM.
  5. Inside that VM, it installs Kubernetes components (kubeadm, kubelet, etc.).
  6. It configures kubectl on your host to point to the new cluster.
  7. You can now run kubectl get nodes and see a ready node.

Prerequisites

  • A machine with 2+ CPUs and 2GB+ free RAM (4GB recommended for serious work).
  • Virtualization enabled in BIOS (Intel VT-x or AMD-V) if using VM drivers.
  • A package manager installed: brew on macOS, choco on Windows, apt on Linux.

Hands-on walkthrough

Install minikube on macOS (Homebrew)

# Install minikube
brew install minikube

# Start minikube with Docker driver (requires Docker Desktop)
minikube start --driver=docker

Install minikube on Linux (Debian/Ubuntu)

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

# Start minikube with KVM2 driver (requires libvirt)
# Install KVM if needed: sudo apt install libvirt-daemon libvirt-clients virt-manager
minikube start --driver=kvm2

Install minikube on Windows (Chocolatey)

# Install minikube
choco install minikube

# Start minikube with Hyper-V driver (requires Windows Pro/Enterprise)
minikube start --driver=hyperv

Verify the installation

After starting, run:

# Check cluster status
minikube status

# Get node info
kubectl get nodes

Expected output looks like:

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

NAME       STATUS   ROLES           AGE     VERSION
minikube   Ready    control-plane   2m34s   v1.28.3

Optional: Enable useful addons

minikube addons enable dashboard
minikube addons enable ingress
minikube addons enable metrics-server

# Launch the Kubernetes dashboard
minikube dashboard

Pro tip: Always use the Docker driver if you already have Docker Desktop installed—it's the fastest to start and requires no additional hypervisor.

Compare options / when to choose what

Driver Platform Speed Features Best for
docker macOS, Linux, Windows Fastest Minimal, uses your Docker Developers already using Docker
hyperv Windows Pro/Enterprise Medium Best Windows VM integration Windows users without Docker
virtualbox All Medium Widely compatible Users with VirtualBox installed
kvm2 Linux Fast Native Linux virtualization Linux users without Docker
hyperkit macOS Fast Lightweight macOS VM macOS users without Docker

Which driver should you choose?

  • If you have Docker Desktop: Always choose docker driver. It's the fastest and most straightforward.
  • If you're on Linux without Docker: Use kvm2 or virtualbox.
  • If you're on macOS without Docker: Use hyperkit or virtualbox.
  • If you're on Windows without Docker (Pro): Use hyperv.
  • If you're on Windows without Docker (Home): Install VirtualBox first, then use virtualbox.

Troubleshooting & edge cases

minikube start stalls or fails

This is the most common issue. Causes and fixes:

Symptom Likely cause Fix
"Exiting due to DRV_NOT_DETECTED" No hypervisor or Docker installed Install Docker Desktop or a VM driver
"Exiting due to NOT_ENOUGH_RESOURCES" Your machine doesn't meet RAM/CPU requirements Allocate more resources via --cpus=4 --memory=4096
"Unable to start VM" Virtualization disabled in BIOS Enable VT-x/AMD-V in BIOS/UEFI
"Error validating network info" Network issues (e.g., VPN) Restart your network or try using --network=cni

kubectl commands return "connection refused"

# Check if minikube is running
minikube status

# If not running, start it again
minikube start

# If running but not connected, reset kubeconfig
kubectl config use-context minikube

minikube uses too much memory

# Start with limited resources
minikube start --memory=2048 --cpus=1

Docker driver: "Docker Desktop is not running"

Start Docker Desktop first, then run minikube start --driver=docker.

What you learned & what's next

You now have a fully functional local Kubernetes cluster running on your machine. You understand:

  • What minikube is and how it differs from other local clusters.
  • How to install minikube on macOS, Linux, and Windows.
  • How to choose the right driver (docker, hyperv, virtualbox, etc.) based on your environment.
  • How to verify the cluster with kubectl get nodes.
  • How to enable addons like the dashboard and ingress.
  • Common pitfalls and how to fix them.

Next step: Now that you have a running cluster, it's time to deploy your first application. The next lesson covers Deploying your first pod—where you'll write a simple YAML manifest, create a pod, and check its logs.

Pro tip: Keep minikube running during the next lesson. You'll use it to create your first pod and service.

Practice recap

Now that minikube is running, try deploying a simple nginx pod: kubectl create deployment nginx --image=nginx and expose it with kubectl expose deployment nginx --port=80 --type=NodePort. Then run minikube service nginx to open it in your browser. This solidifies the connection between kubectl and your local cluster.

Common mistakes

  • Starting minikube without installing a driver first — leads to 'Exiting due to DRV_NOT_DETECTED' error. Always install Docker Desktop (for Docker driver) or a VM hypervisor before running minikube start.
  • Forgetting to enable virtualization in BIOS — minikube cannot create a VM if Intel VT-x or AMD-V is disabled. Check your BIOS settings if minikube start hangs or fails early.
  • Using a different kubeconfig context — if you have multiple Kubernetes clusters configured (e.g., from Docker Desktop or cloud providers), kubectl might point to the wrong one. Run kubectl config use-context minikube to force the correct context.
  • Allocating too many resources — starting minikube with --memory=2048 --cpus=1 is fine for learning; requesting 6+ GB can cause performance issues on laptops with limited RAM.

Variations

  1. Instead of minikube, you can use kind (Kubernetes IN Docker) for extremely lightweight, container-based clusters optimized for CI/testing.
  2. For ARM-based machines (like Apple Silicon Macs), consider MicroK8s or k3s which run natively without emulation and are more efficient.
  3. If you need a multi-node cluster for development, look at kubeadm—though it's more complex, it gives you a real (non-simulated) multi-node setup.

Real-world use cases

  • Local development and testing of Kubernetes manifests before deploying to a cloud cluster (e.g., EKS, AKS, GKE).
  • CI/CD pipelines: spin up minikube inside GitHub Actions to run integration tests against a real K8s API.
  • Learning and certification prep: practice kubectl commands, test RBAC policies, and explore Kubernetes internals without a cloud bill.

Key takeaways

  • Minikube creates a single-node Kubernetes cluster in a VM or Docker container—perfect for local learning and testing.
  • Choose your minikube driver based on your OS: Docker driver for macOS/Linux/Windows if you have Docker Desktop; hyperv for Windows Pro; virtualbox for compatibility.
  • Installation is just one command: brew install minikube (macOS), curl + install (Linux), or choco install minikube (Windows).
  • Always verify your cluster with kubectl get nodes after starting minikube to confirm everything is running.
  • Minikube supports addons like dashboard, ingress, and metrics-server to extend its functionality with a single command.
  • If minikube fails to start, check virtualization status, driver installation, and system resources as the first steps.

Sponsored

Sponsored

Discussion

Questions, corrections, and tips help everyone reading this page.

0 comments

Add a comment

Shown publicly with your comment.

Be constructive · max 4,000 characters

No comments yet — start the thread.

Related tutorials, quizzes, and articles for this topic.