Here I m going to show how to install kubernetes on Ubuntu operating system.


According to the Kubernetes website: “Kubernetes is an open-source system for automating deployment, scaling, and management of containerized applications”.

Kubernetes comes from the Greek word called κυβερνήτης, it means helmsman or ship pilot, so that we can imagine that kubernetes acts as a manager for shipping containers.

Kubernetes is also referred to as k8s as there are 8 characters between k and s, similar to i18n referred to as Internationalization.

Install Kubernetes on Ubuntu:

We can install kubernetes in different modes based on our requirement. Following are the typical installation modes:

  • All-in-One Single-Node Installation
  • Single-Node etcd, Single-Master, and Multi-Worker Installation
  • Single-Node etcd, Multi-Master, and Multi-Worker Installation
  • Multi-Node etcd, Multi-Master, and Multi-Worker Installation

You can refer the kubernetes documentation to choose the right solution for your need.

All-in-One Single-Node Installation:

With All-in-One Single-Node installation, all the master and worker components are installed in a single node. It is much helpful for initial learning and testing the applications.

Note: This installation is not recommended or production environment.

As part of this tutorial, I am going to choose All-in-One Single-Node Installation with Minikube as it is the preferred and recommended way.

1. Installing Minikube:

Minikube is the easiest and the most recommended way to run all-in-one kubernetes cluster locally.

Prior to the minikube installation, we should have to install the virtual box if you haven’t done already.

1.1 Installing Virtual Box:

[email protected]:~$sudo apt-get install virtualbox
Install Kubernetes on Ubuntu

1.2 Installing Minikube:

Installing minikube in 3 steps:

  • Download the latest minikube from minikube releases
  • Make the minikube as executable
  • move the minikube to /usr/local/bin/ directory

to do the above 3 steps trigger the below command on your terminal.

[email protected]:~$curl -Lo minikube && chmod +x minikube && sudo mv minikube /usr/local/bin/
Install Kubernetes on Ubuntu

1.3 Start the minikube:

[email protected]:~$minikube start
Install Kubernetes on Ubuntu

1.4 Check minikube status:

[email protected]:~$minikube status
Install Kubernetes on Ubuntu

Everything looking good, we are able to install the all-in-one kubernetes cluster in the local environment. Let’s start accessing it.

2. Accessing Minikube:

We can access the kubernetes in two different modes:

  • The command line interface (kubectl) and
  • from the kubernetes dashboard (GUI).

kubectl is used to manage the kubernetes cluster resources and applications via the CLI. Let’s install kubectl and access minikube from cli.

2.1 installing kubectl:

Like minikube installation kubectl also have 3 different steps to install.

  • Download the kubectl from official releases
  • make kubectl as executable and
  • move kubectl to /usr/local/bin/kubectl
[email protected]:~$curl -LO$(curl -s

Make the kubectl as executable:

[email protected]:~$chmod +x ./kubectl

Move kubectl to /usr/local/bin/kubectl directory

[email protected]:~$sudo mv ./kubectl /usr/local/bin/kubectl
Install Kubernetes on Ubuntu

2.2 Access kubernetes using minikube dashboard:

To access the Minikube dashboard, we can use minikube dashboard command, which would open a new tab on our web browser, displaying the Kubernetes dashboard like below.

[email protected]:~$ minikube dashboard
Install Kubernetes On Ubuntu

3. Connecting Kubernets cluster:

To connect with kubernetes cluster kubectl needs a master node endpoint and credentials. While starting minikube, the startup process creates a default configuration file (inside .kube directory) which consists of all default required configurations.

Once the kubectl installed successfully, we can view the config file by running the below command.

[email protected]:~$kubectl config view
apiVersion: v1
- cluster:
    certificate-authority: /home/cgoka/.minikube/ca.crt
  name: minikube
- context:
    cluster: minikube
    user: minikube
  name: minikube
current-context: minikube
kind: Config
preferences: {}
- name: minikube
    client-certificate: /home/cgoka/.minikube/client.crt
    client-key: /home/cgoka/.minikube/client.key

3.1 Start the minikube:

[email protected]:~$ minikube start
Starting local Kubernetes v1.9.0 cluster...
Starting VM...
Getting VM IP address...
Moving files into cluster...
Setting up certs...
Connecting to cluster...
Setting up kubeconfig...
Starting cluster components...
Kubectl is now configured to use the cluster.
Loading cached images from config file.

3.2 kubernetes cluster info using kubectl:

Install Kubernetes on Ubuntu
[email protected]:~$ kubectl cluster-info
Kubernetes master is running at

To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.

We can see that the kubernetes master is running at

Now you are ready to deploy your containerized applications into kubernetes.

Happy Learning 🙂

About the Author:

Founder of Love Java, Python, Shell and opensource frameworks. Follow him on twitter and facebook for latest updates.

Leave A Comment