How To Install Minikube And Run Your First Kubernetes App

Getting Started with Minikube: Your Local Kubernetes Playground

Kubernetes is the industry standard for container orchestration, but setting up a full cluster can be complex. Minikube makes it simple—letting you run a local Kubernetes cluster on your laptop or workstation. In this guide, you’ll learn how to install Minikube and deploy your very first app.


What is Minikube?

Minikube is a tool that lets you run a single-node Kubernetes cluster locally. It’s perfect for learning, prototyping, and development before deploying to a real production cluster.


Prerequisites

  • Operating System: Linux, macOS, or Windows

  • Virtualization: Enable VT-x/AMD-v in your BIOS if you want to use a VM driver

  • Package Managers: Homebrew (macOS), Chocolatey (Windows), or apt/yum (Linux)


1. Install Kubectl

Kubectl is the command-line tool to interact with Kubernetes clusters.

On Linux:

curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl
kubectl version --client

On macOS:

brew install kubectl
kubectl version --client

On Windows:

choco install kubernetes-cli
kubectl version --client

2. Install Minikube

On Linux:

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

On macOS:

brew install minikube
minikube version

On Windows:

choco install minikube
minikube version

3. Start Minikube Cluster

minikube start
  • This command will download a VM image and set up your cluster.

  • By default, it uses the Docker driver if available; you can specify another driver if needed (e.g., --driver=virtualbox).


4. Verify Your Cluster

Check the status:

minikube status

Check cluster info:

kubectl cluster-info

5. Deploy Your First App

Let’s deploy a simple Hello World app to your Minikube cluster.

Create a Deployment:

kubectl create deployment hello-minikube --image=kicbase/echo-server:1.0

Expose the Deployment as a Service:

kubectl expose deployment hello-minikube --type=NodePort --port=8080

View the App in Your Browser:

minikube service hello-minikube
  • This command opens the app in your default browser.

6. Useful Minikube Commands

  • View all pods:

      kubectl get pods
    
  • View all services:

      kubectl get svc
    
  • SSH into the minikube VM:

      minikube ssh
    
  • Stop Minikube:

      minikube stop
    
  • Delete the cluster:

      minikube delete
    

7. Troubleshooting Tips

  • If minikube start fails, try specifying a driver: minikube start --driver=docker or minikube start --driver=virtualbox

  • If you use Windows, make sure Hyper-V or VirtualBox is installed and enabled.

  • Use minikube logs to troubleshoot startup problems.


8. Next Steps

  • Deploy more complex applications (databases, multi-tier apps)

  • Explore Minikube add-ons (minikube addons list)

  • Learn about YAML configuration and Kubernetes manifests


💡 Conclusion

Minikube is your go-to tool for learning Kubernetes locally. With just a few commands, you can have a running cluster and start deploying containerized applications. Play around, break things, and enjoy the world of Kubernetes!


Happy Kubernetes-ing! If you have any questions, drop them in the comments below.

0
Subscribe to my newsletter

Read articles from Pappuraj Bhottacharjee directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Pappuraj Bhottacharjee
Pappuraj Bhottacharjee