Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Minikube installation on Ubuntu 16.04 LTS

Minikube Installation on Ubuntu 16.04 LTS


  1. Install hypervisor (Virtualbox)
  2. Get and install Kubectl (repositories)
  3. Get and install Minikube last version
  4. Start and Test Minikube local cluster and expose demo service

Install VirtualBox hypervisor

We will install virtualbox 5.* via official reposiories

$ sudo apt-get update
$ sudo apt remove virtualbox*
$ wget -q -O- | sudo apt-key add -
$ wget -q -O- | sudo apt-key add -
$ sudo su
$ echo "deb xenial contrib" >> /etc/apt/sources.list
$ apt-get update
$ sudo apt-get install virtualbox virtualbox-ext-pack

Install Kubectl

We will install kubectl from official repositories. Recommened so you will get updates via apt.

$ sudo apt-get update && sudo apt-get install -y apt-transport-https
$ curl -s | sudo apt-key add -
$ sudo touch /etc/apt/sources.list.d/kubernetes.list 
$ echo "deb kubernetes-xenial main" | sudo tee -a /etc/apt/sources.list.d/kubernetes.list
$ sudo apt-get update && sudo apt-get install -y kubectl
$ kubectl version

Install Minikube

Download minukube binary directly from Google repositories.

$ curl -Lo minikube && chmod +x minikube
$ sudo mv -v minikube /usr/local/bin
$ minikube version
$ exit

Start Kubernetes Cluster loccally with Minikube

Create and run Kubernetes cluster. This will take some few minutes depending on your Internet connection.

$ minikube start

Test Kubernetes service

We test our cluster running a demo service

$ kubectl cluster-info
$ kubectl run hello-minikube --port=8080
$ kubectl expose deployment hello-minikube --type=NodePort
$ kubectl get services
$ minikube service hello-minikube --url
$ minikube dashboard
$ kubectl delete service hello-minikube
$ kubectl delete deployment hello-minikube
$ minikube stop

Adds Kubectl command 'k' alias to bash (optional)

Using command aliases for minikube and kubectl, example: "mk start", "k get po". Note: You need to restart your bash terminal to see aliases working.

$ echo "alias k='kubectl'" >> ~/.bash_aliases
$ echo "alias mk='minikube'" >> ~/.bash_aliases

Documentation Reference

Some documentation and tutorials

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.