Install Kubernetes on Ubuntu

Kubernetes on Ubuntu is free to use and always current - you get the latest innovations from the Kubernetes community within a week of upstream release. It works on any cloud (public, private, and bare-metal). Kubernetes on Ubuntu is the productive, open source way to manage containers and microservices, automating the time-consuming tasks of installing, patching, upgrading, and carrying out cluster health checks.

Install Kubernetes

Deploy Kubernetes cluster

Where do you want to deploy Kubernetes?

Single node with MicroK8s


Install MicroK8s, the Linux snap that downloads in seconds. Microk8s is lightweight and deploys all Kubernetes services natively on Ubuntu. Ideal for:

  • Laptops: develop microservices locally
  • Workstations: develop and train machine learning models locally
  • CI pipelines: create ephemeral Kubernetes quickly for testing microservices
  • IoT devices: embed upgradeable Kubernetes in your Iot devices for easy evolution
  • Small edge clouds: create simple Kubernetes clusters for your edge clouds

Multi node with Charmed Kubernetes


Install Charmed Kubernetes, Ubuntu’s highly available, multi node Kubernetes cluster on your infrastructure of choice:

  • Bare metal: deploying Kubernetes on bare metal is easy using Charmed Kubernetes and MAAS (Metal-as-a-Service).
  • Private clouds: take advantage of your on-premises clouds to deploy one or more Kubernetes clusters (VMware vSphere, OpenStack, LXD)
  • Public clouds: deploy Charmed Kubernetes to AWS, GCP, Azure, IBM, and Oracle

Other deployment options:

  • Hosted Kubernetes: Use Ubuntu’s platform to run worker nodes on all public clouds ( AKS, EKS, and GKE)
  • Kubeadm install support: let our experts set up your cluster using kubeadm, the install tool available with Kubernetes 1.4.0
  • Managed Kubernetes: take advantage of our cost effective, fully supported kubernetes clusters

Looking for help running Kubernetes?

Get in touch with Canonical to talk about hosting ›

How to install Kubernetes on Ubuntu

Single node cluster

MicroK8s installs a single node, CNCF-certified Kubernetes cluster in seconds

MicroK8s is built to run on any Linux. It’s lightweight and deploys all Kubernetes services natively on Ubuntu (i.e. no virtual machines required) while packing the entire set of libraries and binaries needed. It’s suited for laptops, workstations, CI pipelines, IoT devices, and small edge clouds because of its small footprint.

  1. Install latest MicroK8s

    MicroK8s is packaged as a snap which requires snapd to be installed. The latest Ubuntu release comes with this already built in. For other Linux systems install snapd first. Use this command to get the latest version of MicroK8s:

  2. Install specific versions of MicroK8s

    List specific Kubernetes versions

    The following command will list all versions of MicroK8s that can be installed:

    Install specific Kubernetes version

    This command will install the stable 1.14 version of MicroK8s:

  3. Useful tips

    This command will install the stable 1.14 version of MicroK8s:

    After installing MicroK8s, you should verify it is ready. Use this command:

    To block until MicroK8s is ready, use the following command:

    Accessing Kubernetes: MicroK8s embeds a kubectl and a .kubeconfig file required for accessing the installed MicroK8s. This avoids colliding with any local versions that might be already installed. Here is an example of how to use this:

    If you would like to use the MicroK8s kubectl and .kubeconfig file locally, you can do the following:

The MicroK8s install instructions above are a summary of those found at microk8s.io.

Full MicroK8s documentation

Multi node cluster

A highly available, multi node Kubernetes cluster that runs wherever, whenever

Charmed Kubernetes is Ubuntu’s fully automated, model-driven approach to installing and managing Kubernetes that coordinates logging, monitoring and alerting. Charmed Kubernetes runs on any infrastructure - deploy it on bare-metal, VMware, OpenStack and public clouds like AWS, GCP, Azure and IBM.

You can use a CLI tool or a GUI tool:

  • CLI Based Installer: ideal for scripting or manually interacting with your cluster from a shell prompt, or as part of your automation toolkit.
  • GUI Based Installer: a complete graphical and interactive Kubernetes deployment and management tool.

How to install Kubernetes on AWS

These instructions represent the complete set of commands you need to enter into your terminal to install Charmed Kubernetes on AWS.

Not using AWS, see our other guides ›

Now find out what you can do with Charmed Kubernetes ›

  1. Install Juju

    Juju simplifies how you configure, scale and operate today’s complex software. Juju deploys everywhere: to public or private clouds. It is packaged as a snap which requires snapd to be installed. The latest Ubuntu release comes with this already built in. For other Linux systems install snapd first:

  2. Add your cloud - optional

    This interactive step allows you to register a cloud that isn’t known to Juju by default. In the summary instructions above, since AWS is used, this step isn’t necessary - AWS and other public clouds have well-known IP addresses. For private clouds you need to give some details to juju. An example is a MAAS cloud, which operates your bare metal infrastructure.

    What clouds can you deploy to?

    • Amazon AWS *
    • Microsoft Azure *
    • Google GCE *
    • Oracle *
    • Rackspace *
    • LXD (local) *
    • LXD (remote)
    • VMware vSphere
    • OpenStack
    • MAAS
    • Manual

    * Denotes clouds that are known to Juju by default. For example, Juju knows how to reach AWS, but not an OpenStack cluster that has been created.

    Find out more about Clouds in Juju

  3. Add Credentials

    Most clouds require credentials so that the cloud knows which operations are authorised and on which account. If you choose to use AWS, for example, you would run juju add-credential aws

  4. Add Controller

    The Juju controller is used to manage the software deployed through Juju, from deployment to upgrades to day-two operations.

  5. Add Model

    The model holds a specific deployment, like Kubernetes, which includes all necessary applications and the number of instances of each one. This is where the number of Kubernetes worker nodes are scaled up or down.

  6. Deploy Kubernetes

    Add the Kubernetes bundle to the model and deploy the components, including the default number of components, like worker nodes.

  7. Useful tips

    Observe installation progress: Watch the deployment process in real-time:

    Observe log messages: To view the last twenty log messages for the “k8s-test” model:

    Accessing Kubernetes: Juju creates a .kubeconfig file that is required for accessing the Kubernetes cluster it created. Follow these instructions to install kubectl (if needed) and export the configuration file: (use kubectl to run commands against Kubernetes clusters)

    $ mkdir -p ~/.kube
    $ juju scp kubernetes-master/0:config ~/.kube/config
    $ snap install kubectl --classic
    $ kubectl cluster-info

    Useful Links: Find out more about Charmed Kubernetes.

Easy Kubernetes deployment with Juju As A Service by Canonical

This video explains how to easily deploy a production environment of Kubernetes with JAAS.

A CTO’s guide to Kubernetes

Cover of whitepaper

The no-nonsense way to accelerate your business with containers

Download this whitepaper to learn:

  • The background and timeline to the development of containers and the most recent technology that has led to the proliferation of containers on the Linux platform
  • The differences between and advantages and disadvantages of process containers and machine containers
  • Why containers present a new opportunity for the CTO to reduce cost, to increase agility, and to move to a more scalable and resilient architecture
  • How to recognise that some use cases are better suited to containers than others
  • All information provided will be handled in accordance with the Canonical privacy policy.

Need more help?

Let our cloud experts help you take the next step.

Contact us