# How can you set up Kubernetes? Beginner-friendly Kubernetes tutorial

Kubernetes (also known as K8s) enables efficient management of large numbers of containers and automates many processes in software development. With just a few steps, you can install a powerful Kubernetes cluster and start using it productively right away.

## Step 1: Prepare the system

In this tutorial, we’ll demonstrate installing Kubernetes on [Ubuntu](https://www.ionos.com/digitalguide/server/know-how/ubuntu-the-linux-system-for-everyone/).

First, prepare the system by updating it to the latest version and installing all necessary dependencies. Open the terminal and run a system update to ensure all packages are current:

```bash
sudo apt update && sudo apt upgrade -y
```

Next, install the key utilities required for installing Kubernetes and Minikube. You can use the following command:

```bash
sudo apt install -y curl wget apt-transport-https ca-certificates gnupg lsb-release
```

These tools ensure you can securely use external sources and easily download and install additional software packages.

## Step 2: Install kubectl

[Kubernetes](https://www.ionos.com/digitalguide/server/know-how/what-is-kubernetes/) works with different servers: the master and various nodes. These do not necessarily have to be on different physical servers. [Virtual machines](https://www.ionos.com/digitalguide/server/know-how/virtual-machines/) make it possible to run multiple Kubernetes nodes on a single computer. For testing purposes, the free program [Minikube](https://www.ionos.com/digitalguide/server/tools/kubernetes-minikube/) has proven especially useful. It lets you work with Kubernetes locally. Since Minikube requires either a virtual machine or [Docker](https://www.ionos.com/digitalguide/server/know-how/what-is-docker/), it depends on a [hypervisor](https://www.ionos.com/digitalguide/server/know-how/what-is-a-hypervisor/) or container software. You’ll also need the tool kubectl.

Note In this Kubernetes tutorial, we’ll use Docker. You can, however, use virtualization software such as VirtualBox instead.

First, install kubectl (Kube Control) on your system. This program is required **to manage clusters**.

```bash
curl -LO "https://dl.k8s.io/release/$(curl -Ls https://dl.k8s.io/release/stable.txt)/bin/linux/arm64/kubectl"
chmod +x kubectl
sudo mv kubectl /usr/local/bin/
```

Note Installation commands depend on your system architecture.

## Step 3: Install Docker

Before using Minikube, make sure Docker is installed on your system. Docker acts as the container runtime and allows Minikube to run [Kubernetes clusters](https://www.ionos.com/digitalguide/server/know-how/kubernetes-cluster/) without virtualization software. Install Docker with the following command:

```bash
sudo apt install -y docker.io
```

To use Docker without root privileges, add your user account to the Docker group:

```bash
sudo usermod -aG docker $USER
newgrp docker
```

You may need to log out and back in for the group change to take effect. Test the installation with:

```bash
docker run hello-world
```

If you see a short success message, Docker is installed and ready for Minikube.

## Step 4: Install and start Minikube

Next, install Minikube in a compatible version and use Docker as the driver. First, download the appropriate version of Minikube, make the file executable, and move it to a system directory so the command is globally available:

```bash
curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-arm64
chmod +x minikube-linux-arm64
sudo mv minikube-linux-arm64 /usr/local/bin/minikube
```

After installation, check if Minikube is set up correctly:

```bash
minikube version
```

Then, start Minikube with:

```bash
minikube start --driver=docker
```

Minikube uses Docker as the container runtime in this scenario and creates the Kubernetes cluster directly within the Docker environment. When Minikube starts, kubectl should be automatically configured. To switch from the command line to a [GUI](https://www.ionos.com/digitalguide/websites/web-development/what-is-a-gui/), enter another command. This will open the **dashboard** in your default browser.

```bash
minikube dashboard
```

[![Image: Kubernetes dashboard](https://www.ionos.com/digitalguide/fileadmin/_processed_/6/7/csm_kubernetes-dashboard_549c1e7bb8.webp "Kubernetes dashboard")](https://www.ionos.com/digitalguide/fileadmin/DigitalGuide/Screenshots_2025/kubernetes-dashboard.jpg) Empty Kubernetes dashboard ## Step 5: Try Kubernetes out

When you start Minikube, it automatically creates a **cluster** with a single node. You can check this with kubectl:

```bash
kubectl get nodes
```

Through the dashboard, you can now **create deployments**. Click the Create button (the plus sign in the upper right) to open a web-based editor. In [JSON](https://www.ionos.com/digitalguide/server/know-how/what-is-json/) or [YAML](https://www.ionos.com/digitalguide/websites/web-development/yaml-the-lean-css-framework-for-experts/) format, you can create a deployment there. Once you’ve done this, Kubernetes automatically generates multiple pods. You can adjust the desired number by **scaling the deployment**. You’ll find this function by clicking the three-dot button next to the deployment.

[![Image: Kubernetes dashboard with a deployment and three pods](https://www.ionos.com/digitalguide/fileadmin/_processed_/f/9/csm_kubernetes-overview-deployment-pods_70f88067c3.webp "Kubernetes dashboard with a deployment and three pods")](https://www.ionos.com/digitalguide/fileadmin/DigitalGuide/Screenshots_2025/kubernetes-overview-deployment-pods.jpg) Kubernetes: Deployment and pods in the dashboard [![Image: Scaling a Deployment in Kubernetes](https://www.ionos.com/digitalguide/fileadmin/_processed_/3/b/csm_kubernetes-scale-resources_a09c6390b2.webp "Scaling a Deployment in Kubernetes")](https://www.ionos.com/digitalguide/fileadmin/DigitalGuide/Screenshots_2025/kubernetes-scale-resources.jpg) Kubernetes: Scaling your deployment Alternatively, you can create deployments via the terminal, as long as the content is already packaged in a [Docker image](https://www.ionos.com/digitalguide/server/know-how/docker-images/) stored in a repository:

```bash
kubectl create deployment --image=[path to the image]
```

You can retrieve a variety of information using command-line commands.

**Which deployments are available?**

```bash
kubectl get deployments
```

**How many pods are there?**

```bash
kubectl get pods
```

**Which services are available?**

```bash
kubectl get services
```

**Which nodes are active?**

```bash
kubectl get nodes
```

[![Image: Terminal with various Kubernetes commands and outputs](https://www.ionos.com/digitalguide/fileadmin/_processed_/f/5/csm_screenshot-kubernetes-ubuntu-terminal_4c2f4d2127.webp "Terminal with various Kubernetes commands and outputs")](https://www.ionos.com/digitalguide/fileadmin/DigitalGuide/Screenshots_2025/screenshot-kubernetes-ubuntu-terminal.jpg) Kubernetes commands in the terminal ## Step 6: Publish a deployment

So far, you have started your deployment but have not yet published it. To publish it, create a **service**:

```bash
kubectl expose deploy test-deployment
```

This way, the service is published only within the cluster. To access the deployment from **outside the cluster**, add additional flags:

```bash
kubectl expose deploy test-deployment --type=LoadBalancer --port=8080
```

With Minikube, you can then **start the service**:

```bash
minikube service test-deployment
```

If you want to **delete** the service, there’s also a command for that:

```bash
kubectl delete service test-deployment
```

The deployment can also be deleted:

```bash
kubectl delete deployment test-deployment
```

To finally shut down Minikube, stop the process:

```bash
minikube stop
```

If you no longer want to work with the VM or the container runtime, you can delete it as well.

```bash
minikube delete
```

Afterward, all configurations, created deployments, and pods are removed. When you start Minikube again, you will be working with an empty cluster.


This is a markdown version of: [https://www.ionos.com/digitalguide/server/configuration/kubernetes-tutorial/](https://www.ionos.com/digitalguide/server/configuration/kubernetes-tutorial/) for AI/LLM consumption.