New: K8sGPT works with Claude Desktop!

Back to Documentation

Installation

Installation Methods

Learn how to install K8sGPT using various methods including CLI, operator, and package managers.

CLI Installation

The simplest way to get started with K8sGPT is using the CLI installation method.

# Using curl
curl -LO https://github.com/k8sgpt-ai/k8sgpt/releases/latest/download/k8sgpt_Linux_x86_64.tar.gz
tar -xzf k8sgpt_Linux_x86_64.tar.gz
sudo mv k8sgpt /usr/local/bin/

# Using wget
wget https://github.com/k8sgpt-ai/k8sgpt/releases/latest/download/k8sgpt_Linux_x86_64.tar.gz
tar -xzf k8sgpt_Linux_x86_64.tar.gz
sudo mv k8sgpt /usr/local/bin/

Operator Installation

For Kubernetes-native installation, use the K8sGPT operator.

# Install the operator
kubectl apply -f https://raw.githubusercontent.com/k8sgpt-ai/k8sgpt-operator/main/deploy/crds/k8sgpt.ai_v1alpha1_k8sgpt_cr.yaml
kubectl apply -f https://raw.githubusercontent.com/k8sgpt-ai/k8sgpt-operator/main/deploy/operator.yaml

# Create a K8sGPT instance
kubectl apply -f https://raw.githubusercontent.com/k8sgpt-ai/k8sgpt-operator/main/deploy/crds/k8sgpt.ai_v1alpha1_k8sgpt_cr.yaml

Package Manager Installation

Homebrew (macOS)

brew tap k8sgpt-ai/tap
brew install k8sgpt

APT (Debian/Ubuntu)

# Add the repository
curl -fsSL https://download.opensuse.org/repositories/home:/k8sgpt-ai:/stable/xUbuntu_22.04/Release.key | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/k8sgpt.gpg
echo "deb https://download.opensuse.org/repositories/home:/k8sgpt-ai:/stable/xUbuntu_22.04/ /" | sudo tee /etc/apt/sources.list.d/k8sgpt.list

# Install K8sGPT
sudo apt update
sudo apt install k8sgpt

YUM/DNF (RHEL/CentOS)

# Add the repository
curl -fsSL https://download.opensuse.org/repositories/home:/k8sgpt-ai:/stable/RHEL_8/Release.key | sudo gpg --dearmor -o /etc/pki/rpm-gpg/RPM-GPG-KEY-k8sgpt
echo "[k8sgpt]
name=K8sGPT Repository
baseurl=https://download.opensuse.org/repositories/home:/k8sgpt-ai:/stable/RHEL_8/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-k8sgpt" | sudo tee /etc/yum.repos.d/k8sgpt.repo

# Install K8sGPT
sudo dnf install k8sgpt

Docker Installation

You can also run K8sGPT using Docker.

docker run -it --rm -v ~/.kube:/root/.kube k8sgpt/k8sgpt:latest

Verifying Installation

After installation, verify that K8sGPT is working correctly:

k8sgpt version

Next Steps

Now that you have K8sGPT installed, you can:

  1. Configure your AI backend
  2. Run your first analysis
  3. Set up auto-remediation
  4. Explore advanced features

Check out our configuration guide to get started.