# Minikube Cluster Setup

> The following guide specifically focusses on the setup of Linux (Ubuntu Server) guest in Windows 11 host.

1. Install and configure [Oracle VirtualBox](https://www.virtualbox.org/wiki/Downloads).
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1753639165620/6df1ff4c-7166-4e02-b3ce-61ccc2725f6c.png align="center")
    
2. Donload [Ubuntu Server ISO](https://ubuntu.com/download/server).
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1753639222443/f0e16f7b-b57d-40b8-bb8a-2e2a5c64be53.png align="center")
    
3. Install the Ubuntu Server ISO in VirtualBox with the following system requirements of the VDI created:
    
    * Minimum Disk space: Minimum 25 GB
        
    * Minimum Memory: 4 GB
        
    * Minimum number of CPU cores: 2
        
    * Network: ***NAT*** / ***Bridged Adapter*** (Recommended)
        
4. For ***NAT*** netwrok:
    
    Click on ‘***Port Forwarding***’ button and configure with the following details. This is required to perform `ssh` from Windows terminal.
    

| Name | Protocol | Host IP | Host Port | Guest IP | Guest Port |
| --- | --- | --- | --- | --- | --- |
| ssh | TCP |  | 3022 |  | 22 |

For ***Bridged Adapter*** network, find the IP using the following command in the guest machine.

```bash
ip a
```

5. Open and log into the VDI and run the following commands:
    
    ```bash
    # Update the OS
    sudo apt update && sudo apt upgrade
    
    # Install openssh-server
    sudo apt install openssh-server
    
    # Enable the ssh service using systemctl
    sudo systemctl enable ssh --now
    
    # Check if the service is enabled
    sudo systemctl status ssh
    ```
    
    If the ssh service is enabled, following message is displayed:
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1753640726189/e56411b8-35c2-45fd-9d3d-dfb34b983e6f.png align="center")
    
6. Now we can perform `ssh` from the host terminal using the following command and use the VDI with a somewhat an experience mimicking the cloud:
    
    ```bash
    # NAT network
    ssh -p 3022 vboxuser@127.0.0.1
    
    # Bridged Adapter network
    ssh vboxuser@192.xxx.x.x
    ```
    
7. Now, perform the following steps / execute commands to install `docker` and `minikube`. All the steps are mentioned in this [documentation of minikube](https://minikube.sigs.k8s.io/docs/start/?arch=%2Fwindows%2Fx86-64%2Fstable%2F.exe+download). Following is the simpler explanation of the mentioned steps.
    

### Docker Installation

A container or virtual machine manager is required. In this, we will be using **docker**. We will refer to the [docker documentation](https://docs.docker.com/engine/install/ubuntu/) for the docker installation. Following are the steps:

1. Uninstall the unofficial packages:
    
    ```bash
    for pkg in docker.io docker-doc docker-compose docker-compose-v2 podman-docker containerd runc; do sudo apt-get remove $pkg; done
    ```
    
2. Install using `apt-repository`:
    
    ```bash
    # Add Docker's official GPG key:
    sudo apt-get update
    sudo apt-get install ca-certificates curl
    sudo install -m 0755 -d /etc/apt/keyrings
    sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
    sudo chmod a+r /etc/apt/keyrings/docker.asc
    
    # Add the repository to Apt sources:
    echo \
      "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
      $(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}") stable" | \
      sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
    sudo apt-get update
    ```
    
3. Install the docker dependencies:
    
    ```bash
    sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
    ```
    
4. Verify the installation:
    
    ```bash
    sudo docker run hello-world
    ```
    
5. Use the following command to add the user to docker group. This step is a prerequisite to start `minikube`:
    
    ```bash
    sudo usermod -aG docker $USER && newgrp docker
    ```
    

### Minikube Installation

In the previously mentioned [minikube documentation](https://minikube.sigs.k8s.io/docs/start/?arch=%2Flinux%2Fx86-64%2Fstable%2Fbinary+download), in the ‘Installation’ section, select the buttons to describe the target platform. For our case, it is:

* Operating System: Linux
    
* Architecture: x86-64
    
* Release type: Stable
    
* Installer type: Debian package
    

Perform the following steps to install `minikube` server.

1. The reuqired command to install the `minikube` package will appear below the ‘Installation’ section after selecting the relevant buttons in the sectioned mentioned above which is to be run in the terminal:
    
    ```bash
    curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube_latest_amd64.deb
    sudo dpkg -i minikube_latest_amd64.deb
    ```
    
2. Start the cluster
    
    ```bash
    minikube start
    ```
    
3. Install `kubectl`:
    
    ```bash
    sudo snap install kubectl --classic
    ```
    

Now we are ready with development ready server of Kubernetes which can be used for hosting, serving and testing small projects.
