Note: This guide to install Minikube on Ubuntu will work on all Ubuntu 16.04, Ubuntu 18.04, and Ubuntu 20.04 distributions.
1. Ensure you have the prerequisite packages installed. These packages are needed for later steps.
sudo apt update && sudo apt-get install -y apt-transport-https curl
2. Install the Virtualbox hypervisor. Although you can use other hypervisors with Minikube Virtualbox is the most widely used.
sudo apt install -y virtualbox virtualbox-ext-pack
3. Accept the license agreement. You will see a screen pop up that looks like the image below. To get past it, hit the ‘tab‘ button to highlight the ‘ok‘ button and hit enter.
This will take you to the next screen. Use the arrow keys to navigate over the ‘Yes‘ text and hit enter.
4. Download the latest Minikube binary. Minikube is just a binary so we can use wget to get the latest version:
5. Move the Minikube binary into your /usr/local/bin directory. This will ensure that your terminal can find the minikube binary when you run those commands.
sudo mv minikube-linux-amd64 /usr/local/bin/minikube
6. Make the Minikube binary executable. Skipping this step will result in an error about incorrect permissions when you run minikube commands.
sudo chmod 755 /usr/local/bin/minikube
At this point you should be able to see your minikube version by running:
[email protected]> minikube version minikube version: v1.16.0 commit: 9f1e482427589ff8451c4723b6ba53bb9742fbb1
7. Install kubectl. We have minikube installed, but it won’t be very useful if we don’t have the kubectl binary used to manage kubernetes.
curl -LO https://storage.googleapis.com/kubernetes-release/release/`curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt`/bin/linux/amd64/kubectl
8. Move the kubectl binary to the /usr/local/bin directory. Just like with the minikube binary, our terminal needs to be able to find kubectl.
sudo mv ./kubectl /usr/local/bin/kubectl
9. Make the kubectl binary executable.
sudo chmod +x /usr/local/bin/kubectl
10. Start Minikube. In the background the Minikube binary is essentially making a call to Virtualbox to spin up a single node kubernetes VM. If you’re curious, you can pull up the Virtualbox UI and see the VM that minikube started up.
That’s it! Minikube should be up and running. Thanks for reading this guide on how to install Minikube on Ubuntu. For additional resources on Docker and Kubernetes check out our Kubernetes Cheat Sheet, Helm Cheat Sheet, and Docker Cheat Sheet.