Minikube is a lightweight Kubernetes distribution for local development and testing purposes.
Uninstalling Minikube can be necessary when you need to free up system resources or switch to a different Kubernetes solution.
Some users may want to remove Minikube to resolve conflicts with other Kubernetes tools or due to performance issues on their local machines.
When Minikube versions become outdated, uninstalling and reinstalling may be a good practice to ensure you’re using the latest features and updates.
Let us discuss how to remove Minikube from your system. Depending on your OS and installation method the way to remove Minikube differs. We cover how to uninstall Minikube on Mac and Linux both with and without brew.
Uninstall Minikube on Mac
To uninstall Minikube on macOS, you can follow these steps:[1]
- Open a terminal and run the following command to stop your Minikube cluster:
minikube stop
- To remove Minikube’s virtual machine, run this command:
minikube delete
- Remove the Minikube binary from your system. The binary is often located in the
/usr/local/bin
directory. You can remove it using therm
command:sudo rm /usr/local/bin/minikube
- Minikube stores configuration files and data in the
~/.minikube
directory. You can remove this directory and its contents to completely uninstall Minikube:rm -rf ~/.minikube
- If you’ve created a Kubeconfig context for Minikube, you should remove it. You can do this using the
kubectl
command:kubectl config delete-context minikube
Uninstall Minikube on Linux
To uninstall Minikube from your Linux system, you can follow these steps:
- Open a terminal and stop the running Minikube cluster using the following command:
minikube stop
- You can delete the Minikube cluster using the following command:
minikube delete
- If you installed Minikube using a package manager like
apt
,dnf
, oryum
, you can uninstall it using the package manager. For example, if you usedapt
to install Minikube, you can uninstall it with the following command:sudo apt-get remove minikube
- If you installed Minikube manually, you might have downloaded the binary and placed it in a directory such as
/usr/local/bin
. In that case, you can remove it with the following command:sudo rm /usr/local/bin/minikube
- If you want to remove Minikube’s configuration and data files, you can delete the directory
.minikube
in your home folder by running:rm -rf ~/.minikube
- If you want to remove the Minikube Kubernetes cluster from your
kubeconfig
file, you can use thekubectl config delete-cluster
andkubectl config delete-context
commands. Replaceyour-cluster-name
with the name of your Minikube cluster: [2]kubectl config delete-cluster your-cluster-name
kubectl config delete-context your-cluster-name
Uninstall Minikube on Homebrew (brew) on Mac or Linux
To uninstall Minikube installed using Homebrew, you can use the brew
command to remove it. Here are the steps to uninstall Minikube:
- Open your terminal.
- First, stop any running Minikube clusters if you have any:
minikube stop
- Now, you can uninstall Minikube using Homebrew:
brew uninstall minikube
- After running the uninstall command, you may also want to remove any residual configuration files or data associated with Minikube. You can remove the Minikube configuration directory manually if needed:
rm -rf ~/.minikube
References
- Borisov, B. (2023, October 27). How to install MiniKube on Linux: A Step-by-Step guide. Linuxiac. https://linuxiac.com/how-to-install-minikube-on-linux/ ↩︎
- kubectl config delete-cluster. (2024, January 6). Kubernetes. https://kubernetes.io/docs/reference/kubectl/generated/kubectl_config/kubectl_config_delete-cluster/ ↩︎