This guide provides a step-by-step walkthrough for setting up Minikube on your local machine. Minikube allows you to run a single-node Kubernetes cluster locally, providing an excellent environment for learning Kubernetes, developing, and testing applications.
- Project Goals
- Prerequisites
- Core Concepts
- Installation Guide
- Verifying the Installation
- Basic Minikube Usage
- Troubleshooting
- Evidence for Submission
By the end of this project, you will have:
- A comprehensive understanding of Kubernetes and its fundamental concepts.
- Hands-on experience setting up a local Kubernetes cluster using Minikube.
- The ability to build and deploy simple applications on your local cluster.
- CPU: 2 or more
- Memory: 2GB of free memory
- Disk Space: 20GB of free disk space
- Internet Connection: Required for downloading Minikube, Docker, and container images.
- Containerization Software: Docker installed and running on your machine.
Kubernetes is an open-source container orchestration platform that automates the deployment, scaling, and management of containerized applications. It groups containers that make up an application into logical units for easy management and discovery.
Minikube is a tool that makes it easy to run Kubernetes locally. It runs a single-node Kubernetes cluster inside a Virtual Machine (VM) or a Docker container on your personal computer. This is ideal for users looking to try out Kubernetes or to develop with it day-to-day.
If you don't have Chocolatey, a package manager for Windows, install it by following the official instructions.
Open a PowerShell terminal as Administrator and run the following command:
choco install minikubeMinikube requires a container driver. We will use Docker. If you don't have it, install Docker Desktop for Windows.
Once Docker Desktop is running, start the Minikube cluster:
minikube start --driver=dockerFirst, we need to install Docker, which will act as the driver for Minikube.
-
Update package lists:
sudo apt-get update
-
Install prerequisite packages:
sudo apt-get install -y ca-certificates curl gnupg
-
Add Docker’s official GPG key:
sudo install -m 0755 -d /etc/apt/keyrings curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg sudo chmod a+r /etc/apt/keyrings/docker.gpg -
Set up the Docker repository:
echo \ "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \ $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \ sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
-
Install Docker Engine:
sudo apt-get update sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
-
Verify Docker Installation:
sudo systemctl status docker
-
Download the Minikube binary:
curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
-
Install Minikube:
sudo install minikube-linux-amd64 /usr/local/bin/minikube
While Minikube includes a version of kubectl, it's best practice to install kubectl separately to interact with your cluster. You can do this via snap:
sudo snap install kubectl --classicStart the Minikube cluster using the Docker driver:
minikube start --driver=dockerOnce Minikube has started, you can check the status of your local cluster.
minikube statusYou can also use kubectl, the Kubernetes command-line tool, which is automatically installed with Minikube.
kubectl get pods -AHere are a few essential commands for managing your Minikube cluster:
- Stop the cluster:
minikube stop
- Delete the cluster:
minikube delete
- Access the Kubernetes dashboard:
minikube dashboard
- SSH into the Minikube VM/container:
minikube ssh
-
Minikube fails to start:
- Solution: Ensure your system meets the prerequisites (CPU, memory, disk space). Make sure Docker is running correctly. Try running
minikube deleteand thenminikube startagain.
- Solution: Ensure your system meets the prerequisites (CPU, memory, disk space). Make sure Docker is running correctly. Try running
-
Docker driver issues:
- Solution: Verify that the Docker service is active. On Linux, you might need to run Docker commands with
sudoor add your user to thedockergroup:sudo usermod -aG docker $USER && newgrp docker.
- Solution: Verify that the Docker service is active. On Linux, you might need to run Docker commands with
-
Insufficient Resources:
- Solution: If you encounter resource-related errors, you can start Minikube with specific memory and CPU allocations:
minikube start --memory 4096 --cpus 2
- Solution: If you encounter resource-related errors, you can start Minikube with specific memory and CPU allocations:







