> ## Documentation Index
> Fetch the complete documentation index at: https://docs.apinizer.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Installation on Ubuntu

> This document describes the installation of Kubernetes 1.31.7 version (for Ubuntu 24.0x operating system) and Apinizer on a server with Ubuntu operating system.

This document describes the installation of Kubernetes 1.31.7 version (for Ubuntu 24.0x operating system) and Apinizer on a server with Ubuntu operating system.

## File to Download

```bash theme={null}
Please contact us at support@apinizer.com email address for the download link of Apinizer's latest version.

Kubernetes, Mongodb and Elasticsearch installation files for Ubuntu 24.x operating system:
https://fss.apinizer.com/index.php/s/8HbiSgKZsDO0akg

Kubernetes, Mongodb and Elasticsearch installation files for Ubuntu 22.x operating system:
https://fss.apinizer.com/index.php/s/C75rOwbN2bTOqgs
```

<Info>
  Packages created as .tar on online machine are moved to offline machine.
</Info>

```bash theme={null}
tar -xzf offlineApinizerInstallation-Ubuntu24.x.tar
```

```bash theme={null}
sudo systemctl stop ufw
sudo systemctl disable ufw
sudo swapoff -a
sudo vi /etc/fstab
```

## 1) Installing Containerd Packages

```bash theme={null}
sudo dpkg -i containerd_deb/*.deb
```

```bash theme={null}
#containerd module settings
sudo mkdir -p /etc/containerd
sudo containerd config default | sudo tee /etc/containerd/config.toml
sudo sed -i 's/SystemdCgroup = false/SystemdCgroup = true/g' /etc/containerd/config.toml

#starting containerd module
sudo systemctl restart containerd
sudo systemctl enable containerd
sudo systemctl status containerd
```

## 2) Installing Kubernetes Packages

```bash theme={null}
sudo tee /etc/modules-load.d/k8s.conf <<EOF
overlay
br_netfilter
EOF
#To load modules in the running system
sudo modprobe overlay
sudo modprobe br_netfilter
```

```bash theme={null}
sudo vi /etc/sysctl.d/k8s.conf
```

Add the following content:

```
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1
net.ipv4.ip_forward=1
net.ipv4.tcp_max_syn_backlog=40000
net.core.somaxconn=40000
net.core.wmem_default=8388608
net.core.rmem_default=8388608
net.ipv4.tcp_sack=1
net.ipv4.tcp_window_scaling=1
net.ipv4.tcp_fin_timeout=15
net.ipv4.tcp_keepalive_intvl=30
net.ipv4.tcp_tw_reuse=1
net.ipv4.tcp_moderate_rcvbuf=1
net.core.rmem_max=134217728
net.core.wmem_max=134217728
net.ipv4.tcp_mem=134217728 134217728 134217728
net.ipv4.tcp_rmem=4096 277750 134217728
net.ipv4.tcp_wmem=4096 277750 134217728
net.core.netdev_max_backlog=300000
```

```bash theme={null}
sudo sysctl --system
```

```bash theme={null}
sudo dpkg -i kube_deb/*.deb
```

```bash theme={null}
systemctl enable --now kubelet.service
#Kubernetes installation check and startup
kubectl version --client && kubeadm version
```

## 3) Loading Kubernetes Images

```bash theme={null}
sudo ctr --namespace k8s.io images import kube_images/kube-apiserver:v1.31.7.tar
sudo ctr --namespace k8s.io images import kube_images/kube-controller-manager:v1.31.7.tar
sudo ctr --namespace k8s.io images import kube_images/kube-scheduler:v1.31.7.tar
sudo ctr --namespace k8s.io images import kube_images/kube-proxy:v1.31.7.tar
sudo ctr --namespace k8s.io images import kube_images/pause:3.10.tar
sudo ctr --namespace k8s.io images import kube_images/etcd:3.5.15-0.tar
sudo ctr --namespace k8s.io images import kube_images/coredns:v1.8.6.tar
sudo ctr --namespace k8s.io images import kube_images/flannel-cni-plugin-v1.6.2.tar
sudo ctr --namespace k8s.io images import kube_images/flannel-v0.26.4.tar
```

## 4) Kubeadm Init

```bash theme={null}
sudo kubeadm init --pod-network-cidr="10.244.0.0/16" --control-plane-endpoint="<MASTER_SERVER_IP_ADDRESS>" --upload-certs --kubernetes-version=v1.31.7
```

```bash theme={null}
mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config
```

**To include worker node in cluster:**

You can run the following command on **master node** to get the command to include in cluster as output and run it on nodes you will add as worker.

```bash theme={null}
kubeadm token create --print-join-command
```

## 5) Creating Flannel

```bash theme={null}
kubectl apply -f flannel_yaml/kube-flannel.yml
```

## 6) Loading Apinizer Images

```bash theme={null}
sudo tar xvf apinizerImages.tar
cd apinizerImages
```

```bash theme={null}
sudo ctr --namespace k8s.io images import manager_<APINIZER_VERSION>.tar apinizercloud/manager:<APINIZER_VERSION>
sudo ctr --namespace k8s.io images import worker_<APINIZER_VERSION>.tar apinizercloud/worker:<APINIZER_VERSION>
sudo ctr --namespace k8s.io images import cache_<APINIZER_VERSION>.tar apinizercloud/cache:<APINIZER_VERSION>
sudo ctr --namespace k8s.io images import integration_<APINIZER_VERSION>.tar apinizercloud/integration:<APINIZER_VERSION>
sudo ctr --namespace k8s.io images import portal_<APINIZER_VERSION>.tar apinizercloud/portal:<APINIZER_VERSION>
```

## 7) Installing MongoDB

```bash theme={null}
sudo dpkg -i mongo_deb/*.deb
```

MongoDB configurations after installation are the same as the sections in [MongoDB Installation on Ubuntu Operating System](/en/setup/mongodb/ubuntu-mongodb) document.

## 8) Elasticsearch Installation

```bash theme={null}
sudo mkdir /opt/elasticsearch
# Move the file inside the offline installation folders.
sudo mv elasticsearch/elasticsearch-7.9.2-linux-x86_64.tar.gz /opt/elasticsearch/
cd /opt/elasticsearch
sudo tar -xzf elasticsearch-7.9.2-linux-x86_64.tar.gz
```

After moving the installation file from its directory to /opt/elasticsearch/ folder, apply the steps on [Elasticsearch Installation on Ubuntu Operating System](/en/setup/elasticsearch/ubuntu-elasticsearch) page.

## 9) Apinizer Installation

You can perform Apinizer installation from [Apinizer Installation and Configuration](/en/setup/apinizer/apinizer) page.
