MYHOSPITALNOW.COM

Find Trusted Doctors & Hospitals

Discover healthcare providers, compare hospitals, and explore treatment options worldwide.

Free Treatment Quotes • Doctor Search • Hospital Comparison

Find Healthcare Options

www.myhospitalnow.com

How to Install and Configure K9s on macOS, Linux and Windows: Step-by-Step Guide

A complete hands-on Kubernetes management tutorial for DevOps Engineers, SREs, Platform Engineers and Kubernetes Administrators.

K9s is a free, open-source, terminal-based Kubernetes management tool that simplifies the way engineers monitor, manage and troubleshoot Kubernetes clusters.

Instead of repeatedly executing kubectl commands, K9s provides an interactive, continuously updated terminal dashboard from which you can manage Pods, Deployments, Services, Namespaces, Nodes, ConfigMaps, Secrets and other Kubernetes resources.

Introducing K9s: Terminal-based Kubernetes Dashboard

harish2k01.in

In this tutorial, we will learn how to install, configure, customize and use K9s on macOS, Linux and Windows, including a hands-on Kubernetes verification exercise.

Documentation reviewed: November 2026.

1. K9s architecture

K9s is a standalone client application that communicates directly with the Kubernetes API server.

K9s does not require any additional server, agent, operator, Helm chart, database or application installation inside Kubernetes.

It requires authorized access to the Kubernetes API.

2. Prerequisites

RequirementDescription
Operating systemmacOS, Linux or Windows
Kubernetes clusterEKS, AKS, GKE, Minikube, Rancher Desktop, etc.
kubectlRecommended for configuration and verification
kubeconfigValid Kubernetes connection configuration
Network connectivityAccess to the Kubernetes API server
Kubernetes RBACAppropriate resource permissions
TerminalTerminal, iTerm2, PowerShell or Windows Terminal
Metrics APIOptional, for CPU and memory metrics

Part 1: Install K9s on macOS

Step 1: Check macOS version and architecture

sw_vers
uname -m
ArchitectureProcessor
arm64Apple Silicon – M1, M2, M3, M4 and later
x86_64Intel Mac

Homebrew automatically selects the appropriate package architecture.

Step 2: Install Homebrew

Check whether Homebrew is already installed:

brew --version

If not installed, use:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"Code language: JavaScript (javascript)

For Apple Silicon MacBooks, configure Homebrew in the default Zsh environment if instructed by the installer:

echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile

eval "$(/opt/homebrew/bin/brew shellenv)"Code language: PHP (php)

Step 3: Install kubectl

Skip this step if kubectl is already installed.

brew install kubernetes-cli

Verify:

kubectl version --client

Step 4: Install K9s

brew install derailed/k9s/k9s

Step 5: Verify K9s installation

which k9s

k9s version

k9s info

k9s help

Step 6: Verify Kubernetes connectivity

kubectl config get-contexts

kubectl config current-context

kubectl cluster-info

kubectl get nodes

kubectl get pods -ACode language: JavaScript (javascript)

Step 7: Launch K9s

k9s

K9s – UI tool to Manage Kubernetes Clusters In Style! – $ bash-prompt

marcinkujawski.pl

Step 8: Upgrade or uninstall K9s

# Upgrade
brew update
brew upgrade k9s

# Uninstall
brew uninstall k9sCode language: PHP (php)

Complete macOS installation commands

For a MacBook with Homebrew and an existing Kubernetes cluster:

brew install kubernetes-cli
brew install derailed/k9s/k9s

kubectl version --client
k9s version

kubectl config get-contexts
kubectl get nodes

k9sCode language: JavaScript (javascript)

Part 2: Install K9s on Linux

K9s supports Ubuntu, Debian, Fedora, Arch Linux, openSUSE and other Linux distributions.

Step 1: Check Linux operating system

cat /etc/os-release

uname -m

Step 2: Install dependencies

For Ubuntu and Debian:

sudo apt update

sudo apt install -y curl wget tar ca-certificates

Step 3: Install kubectl

Skip this step if kubectl is already installed.

The following example detects AMD64 or ARM64 automatically.

ARCH=$(uname -m)

case "$ARCH" in
  x86_64) ARCH=amd64 ;;
  aarch64|arm64) ARCH=arm64 ;;
  *) echo "Unsupported architecture"; exit 1 ;;
esac

VERSION=$(curl -fsSL https://dl.k8s.io/release/stable.txt)

curl -fLO "https://dl.k8s.io/release/${VERSION}/bin/linux/${ARCH}/kubectl"

curl -fLO "https://dl.k8s.io/release/${VERSION}/bin/linux/${ARCH}/kubectl.sha256"

echo "$(cat kubectl.sha256)  kubectl" | sha256sum --check

sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl

rm kubectl kubectl.sha256Code language: PHP (php)

Verify:

kubectl version --client

For production environments, select a kubectl version compatible with your Kubernetes API server. Kubernetes officially supports kubectl within one minor version of the API server.

Step 4: Install K9s on Ubuntu or Debian

Method 1: Using the official Debian package (AMD64)

wget https://github.com/derailed/k9s/releases/latest/download/k9s_linux_amd64.deb

sudo apt install -y ./k9s_linux_amd64.deb

rm k9s_linux_amd64.debCode language: JavaScript (javascript)

Method 2: Using Homebrew on Linux

If Linux Homebrew is already installed:

brew install derailed/k9s/k9s

This is also an option for supported ARM64 Linux systems.

Method 3: Install using the official release binary

Visit the official release page:

https://github.com/derailed/k9s/releases/latest

Download the Linux archive matching your CPU architecture, verify it against the published checksum and extract it.

For example, after downloading the appropriate archive:

tar -xzf k9s_Linux_amd64.tar.gz

sudo install -m 0755 k9s /usr/local/bin/k9s

For ARM64, select the corresponding ARM64 release archive instead. Use the exact filename listed on the release page.

Step 5: Install K9s on other Linux distributions

Linux distributionInstallation command
Fedora 42+sudo dnf install k9s
Arch Linuxsudo pacman -S k9s
openSUSEsudo zypper install k9s
Linux Homebrewbrew install derailed/k9s/k9s
RHEL / Rocky Linux / AlmaLinuxOfficial release binary

Package availability may depend on the distribution version and enabled repositories. k9scli.io+1

Step 6: Verify installation

which k9s

k9s version

k9s info

Step 7: Configure terminal environment

For terminals supporting 256 colors:

export TERM=xterm-256colorCode language: JavaScript (javascript)

Configure your preferred text editor:

export EDITOR=vim

export KUBE_EDITOR=vimCode language: JavaScript (javascript)

Alternatively, use Nano:

export EDITOR=nano

export KUBE_EDITOR=nanoCode language: JavaScript (javascript)

Make the editor configuration permanent for Bash:

echo 'export EDITOR=vim' >> ~/.bashrc

echo 'export KUBE_EDITOR=vim' >> ~/.bashrc

source ~/.bashrcCode language: PHP (php)

Step 8: Verify Kubernetes connectivity

kubectl config get-contexts

kubectl cluster-info

kubectl get nodes

kubectl get pods -ACode language: JavaScript (javascript)

Step 9: Start K9s

k9s

Step 10: Upgrade or uninstall K9s

For Debian package installation, upgrade by downloading and installing the newer .deb package.

To uninstall:

sudo apt remove k9s

For manually installed binaries:

sudo rm /usr/local/bin/k9s

Complete Ubuntu AMD64 installation commands

sudo apt update
sudo apt install -y wget curl tar

wget https://github.com/derailed/k9s/releases/latest/download/k9s_linux_amd64.deb

sudo apt install -y ./k9s_linux_amd64.deb

rm k9s_linux_amd64.deb

k9s version
k9s info

kubectl get nodes

k9sCode language: JavaScript (javascript)

This consolidated example assumes kubectl and kubeconfig are already configured.

Part 3: Install K9s on Windows 10 and Windows 11

K9s can be installed on Windows using Winget, Chocolatey, Scoop or the official release binary.

Step 1: Open PowerShell or Windows Terminal

Open PowerShell and check your system architecture:

[System.Runtime.InteropServices.RuntimeInformation]::OSArchitectureCode language: CSS (css)

Step 2: Verify Winget

winget --version

If Winget is unavailable, install or update Microsoft’s App Installer through the Microsoft Store.

Step 3: Install kubectl

winget install --id Kubernetes.kubectl --exactCode language: CSS (css)

Verify:

kubectl version --client

Step 4: Install K9s using Winget

winget install --id Derailed.k9s --exactCode language: CSS (css)

Alternatively, use one of the following methods.

Using Chocolatey

choco install k9s -y

Using Scoop

scoop install k9s

Chocolatey or Scoop must already be installed before using their respective commands.

Step 5: Verify K9s installation

Restart PowerShell if required to refresh the PATH environment variable.

Get-Command k9s

k9s version

k9s info

k9s help

Step 6: Verify Kubernetes connectivity

kubectl config get-contexts

kubectl config current-context

kubectl cluster-info

kubectl get nodes

kubectl get pods -ACode language: JavaScript (javascript)

Step 7: Start K9s

k9s

Step 8: Configure the default text editor

For the current PowerShell session:

$env:EDITOR = "notepad"
$env:KUBE_EDITOR = "notepad"Code language: PHP (php)

For permanent user-level configuration:

[Environment]::SetEnvironmentVariable("EDITOR", "notepad", "User")

[Environment]::SetEnvironmentVariable("KUBE_EDITOR", "notepad", "User")Code language: PHP (php)

Step 9: Upgrade K9s

winget upgrade --id Derailed.k9s --exactCode language: CSS (css)

For Chocolatey:

choco upgrade k9s -y

For Scoop:

scoop update k9s

Step 10: Uninstall K9s

winget uninstall --id Derailed.k9s --exactCode language: CSS (css)

Complete Windows installation commands

winget install --id Kubernetes.kubectl --exact

winget install --id Derailed.k9s --exact

kubectl version --client

k9s version

kubectl config get-contexts

kubectl get nodes

k9sCode language: JavaScript (javascript)

The installation methods above follow the official K9s repository and Kubernetes client installation documentation. GitHub+3

Part 4: Configure Kubernetes Cluster Access for K9s

K9s uses the Kubernetes kubeconfig file to identify clusters, authentication credentials and contexts.

Step 1: Understand the default kubeconfig location

Operating systemDefault kubeconfig location
macOS~/.kube/config
Linux~/.kube/config
Windows%USERPROFILE%\.kube\config

Step 2: Check the kubeconfig file

macOS and Linux:

ls -l ~/.kube/configCode language: JavaScript (javascript)

Windows:

Get-Item "$HOME\.kube\config"Code language: JavaScript (javascript)

Step 3: Configure a custom kubeconfig file

macOS and Linux

export KUBECONFIG=$HOME/.kube/dev-config.yaml

kubectl get nodes

k9sCode language: JavaScript (javascript)

Windows

$env:KUBECONFIG = "$HOME\.kube\dev-config.yaml"

kubectl get nodes

k9sCode language: JavaScript (javascript)

You can also pass a kubeconfig file directly to K9s:

k9s --kubeconfig ./dev-config.yaml

Only use kubeconfig files from trusted sources.

Step 4: List Kubernetes contexts

kubectl config get-contextsCode language: JavaScript (javascript)

Example:

CURRENT   NAME          CLUSTER
*         dev           eks-dev
          staging       eks-staging
          uat           eks-uat
          production    eks-production

Step 5: Switch Kubernetes contexts

Using kubectl:

kubectl config use-context stagingCode language: PHP (php)

Using K9s:

k9s --context staging

Alternatively, switch contexts directly inside K9s by typing:

:ctxCode language: CSS (css)

Select the required context and press Enter.

Part 5: Connect K9s to EKS, AKS, GKE and Local Kubernetes

Amazon EKS

Prerequisites: AWS CLI, valid AWS credentials, IAM access and EKS network connectivity.

aws sts get-caller-identity

aws eks update-kubeconfig \
  --region ap-northeast-1 \
  --name my-eks-cluster \
  --alias eks-dev

kubectl get nodes

k9s --context eks-devCode language: JavaScript (javascript)

For a private EKS API endpoint, run K9s from an authorized administration host or connect through an approved private network path.

Microsoft Azure AKS

Prerequisites: Azure CLI and appropriate Azure permissions.

az login

az aks get-credentials \
  --resource-group my-resource-group \
  --name my-aks-cluster

kubectl get nodes

k9sCode language: JavaScript (javascript)

Some Microsoft Entra-enabled clusters additionally require kubelogin.

Google Kubernetes Engine (GKE)

Prerequisites: Google Cloud CLI, GKE authentication plugin and appropriate IAM access.

gcloud auth login

gcloud container clusters get-credentials my-gke-cluster \
  --region asia-northeast1 \
  --project my-project-id

kubectl get nodes

k9sCode language: JavaScript (javascript)

Minikube

If Minikube is installed:

minikube start

kubectl get nodes

k9s --context minikubeCode language: JavaScript (javascript)

Rancher Desktop

Enable Kubernetes in Rancher Desktop settings, then execute:

kubectl config get-contexts

kubectl config use-context rancher-desktop

kubectl get nodes

k9s --context rancher-desktopCode language: JavaScript (javascript)

Docker Desktop Kubernetes

Enable Kubernetes in Docker Desktop settings, then execute:

kubectl config use-context docker-desktop

kubectl get nodes

k9s --context docker-desktopCode language: JavaScript (javascript)

Part 6: K9s Configuration Files and Customization

Step 1: Identify the K9s configuration directory

k9s info

This command displays configuration files, log files, skins, plugins, aliases, hotkeys and cluster-specific configuration locations.

Default K9s configuration directories

Operating systemTypical configuration directory
macOS~/Library/Application Support/k9s/
Linux~/.config/k9s/
Windows%LOCALAPPDATA%\k9s\

These paths can vary depending on XDG environment variables and K9s versions. Always use k9s info to identify the actual paths. k9scli.io+1

Important K9s configuration files

File or directoryPurpose
config.yamlMain K9s configuration
aliases.yamlCustom resource commands
hotkeys.yamlCustom keyboard shortcuts
plugins.yamlCustom external commands and integrations
views.yamlCustomized resource columns
skins/Themes and color customization
clusters/Cluster-specific configuration
k9s.logApplication logs

Configuration, data and log files may be stored in different directories.

Step 2: Open the configuration file

Launch and exit K9s once to initialize its configuration.

macOS

nano "$HOME/Library/Application Support/k9s/config.yaml"Code language: JavaScript (javascript)

Linux

nano ~/.config/k9s/config.yamlCode language: JavaScript (javascript)

Windows

notepad "$env:LOCALAPPDATA\k9s\config.yaml"Code language: JavaScript (javascript)

If your paths differ, use the location reported by k9s info.

Step 3: Configure K9s

Merge the following settings into the existing config.yaml file.

k9s:
  liveViewAutoRefresh: true
  refreshRate: 3
  maxConnRetry: 5
  apiServerTimeout: 30s

  readOnly: false
  defaultView: pods

  noExitOnCtrlC: false
  portForwardAddress: localhost
  skipLatestRevCheck: false

  ui:
    enableMouse: true
    headless: false
    logoless: false
    crumbsless: false
    reactive: true
    noIcons: false
    skin: default

  logger:
    tail: 200
    buffer: 5000
    sinceSeconds: 600
    fullScreen: false
    textWrap: true
    showTime: true

  thresholds:
    cpu:
      critical: 90
      warn: 70
    memory:
      critical: 90
      warn: 70Code language: JavaScript (javascript)

This is an example configuration for general development and operational usage, not the factory-default configuration.

Step 4: Understand the configuration parameters

ParameterPurpose
refreshRateUI refresh interval in seconds
liveViewAutoRefreshEnables periodic resource-browser refresh
maxConnRetryAPI reconnection attempts
apiServerTimeoutKubernetes API request timeout
readOnlyDisables modification actions in K9s
defaultViewInitial resource view
enableMouseEnables mouse interaction
headlessHides the K9s header
logolessHides the K9s logo
skinSelects the UI theme
tailInitial log lines to retrieve
bufferMaximum log lines retained in the view
sinceSecondsHistorical log retrieval window
textWrapWraps long log lines
showTimeDisplays log timestamps
thresholdsVisual CPU and memory warning thresholds

The thresholds are visual indicators, not a replacement for a production alerting system.

Step 5: Configure a custom K9s configuration directory

macOS and Linux

mkdir -p "$HOME/k9s-config"

export K9S_CONFIG_DIR="$HOME/k9s-config"

k9s info

k9sCode language: JavaScript (javascript)

Windows

New-Item -ItemType Directory -Force "$HOME\k9s-config"

$env:K9S_CONFIG_DIR = "$HOME\k9s-config"

k9s info

k9sCode language: PHP (php)

Part 7: Configure Custom K9s Aliases

Custom aliases allow engineers to navigate Kubernetes resources more quickly.

Step 1: Locate the aliases file

k9s info

Open the path reported as the alias file. Create it if it does not exist.

Step 2: Configure aliases.yaml

aliases:
  pp: v1/pods
  dd: apps/v1/deployments
  ss: v1/services
  nn: v1/nodes
  cc: v1/configmaps
  sc: v1/secrets
  ns: v1/namespaces
  ing: networking.k8s.io/v1/ingresses
  crb: rbac.authorization.k8s.io/v1/clusterrolebindings

Step 3: Verify aliases

Start K9s:

k9s

Execute the following commands inside the K9s interface:

AliasResource
:ppPods
:ddDeployments
:ssServices
:nnNodes
:ccConfigMaps
:scSecrets
:ingIngresses
:crbClusterRoleBindings

Part 8: Configure Custom K9s Hotkeys

Step 1: Locate the hotkeys file

k9s info

Open or create the hotkeys.yaml file at the reported location.

Step 2: Add custom keyboard shortcuts

hotKeys:
  shift-0:
    shortCut: Shift-0
    description: View Pods
    command: pods

  shift-1:
    shortCut: Shift-1
    description: View Deployments
    command: deployments

  shift-2:
    shortCut: Shift-2
    description: View Services
    command: services

  shift-3:
    shortCut: Shift-3
    description: View Nodes
    command: nodes

  shift-4:
    shortCut: Shift-4
    description: View Events
    command: events

  shift-5:
    shortCut: Shift-5
    description: View Namespaces
    command: namespaces

Step 3: Verify shortcuts

ShortcutOperation
Shift + 0Pods
Shift + 1Deployments
Shift + 2Services
Shift + 3Nodes
Shift + 4Events
Shift + 5Namespaces

Restart K9s and press ? to inspect the active shortcuts.

Avoid conflicts with existing key bindings. Custom aliases and hotkeys are supported through K9s YAML configuration. GitHub+1

Part 9: Configure K9s Themes and Skins

K9s supports custom themes to improve readability and distinguish production and non-production environments.

Skins

Dracula theme

K9s Terminal UI – AXGK Blog

Nord theme

k9s Walkthrough – KodeKloud

Gruvbox theme

GitHub – IvanGDR/Installing-K9S-in-macOS-and-connecting-to-Remote-K8S-cluster · GitHub

Catppuccin theme

Step 1: Locate the skins directory

k9s info

Step 2: Download the required theme

Official skin repository:

https://github.com/derailed/k9s/tree/master/skins

For example, download dracula.yaml on macOS or Linux:

curl -fLO https://raw.githubusercontent.com/derailed/k9s/master/skins/dracula.yamlCode language: JavaScript (javascript)

Move the file into the skins directory identified by k9s info.

Step 3: Enable the theme

Update the existing config.yaml:

k9s:
  ui:
    skin: dracula

Step 4: Restart K9s

k9s

Recommended environment-specific themes

EnvironmentSuggested color theme
DevelopmentGreen
StagingBlue
UATYellow
ProductionRed

Cluster-specific skins can be configured within the context configuration directory. Visual differentiation can help reduce accidental operations against the wrong cluster.

Part 10: Most Important K9s Commands

K9s CLI commands

These commands are executed from your operating system terminal.

CommandPurpose
k9sLaunch K9s
k9s versionDisplay version
k9s infoDisplay configuration locations
k9s helpDisplay help
k9s -AStart with all namespaces
k9s -n defaultOpen a namespace
k9s -n kube-systemOpen system namespace
k9s --context devConnect to development cluster
k9s --context productionConnect to production cluster
k9s --readonlyEnable read-only mode
k9s -c podsStart in Pod view
k9s -c deploymentsStart in Deployment view
k9s -c nodesStart in Node view
k9s -l debugEnable debug logging
k9s --kubeconfig ./configUse custom kubeconfig

Kubernetes resource commands inside K9s

Press : followed by the resource name and Enter.

K9s commandEquivalent kubectl command
:podskubectl get pods
:deploykubectl get deployments
:svckubectl get services
:nskubectl get namespaces
:nodeskubectl get nodes
:cmkubectl get configmaps
:secretskubectl get secrets
:ingkubectl get ingress
:rskubectl get replicasets
:stskubectl get statefulsets
:dskubectl get daemonsets
:jobskubectl get jobs
:cjkubectl get cronjobs
:pvkubectl get pv
:pvckubectl get pvc
:sckubectl get storageclass
:hpakubectl get hpa
:eventskubectl get events
:sakubectl get serviceaccounts
:roleskubectl get roles
:rolebindingskubectl get rolebindings
:clusterroleskubectl get clusterroles
:crdkubectl get crd
:networkpolicieskubectl get networkpolicies
:helmhelm list
:ctxkubectl config get-contexts
:qExit K9s

Resource aliases can differ between versions or be overridden by custom configuration.

K9s keyboard shortcuts

ShortcutOperation
↑ / ↓Navigate resources
EnterOpen selected resource
EscGo back
?Display available keyboard shortcuts
/Search and filter
dDescribe resource
eEdit resource
yView YAML
lView container logs
sOpen container shell
Shift + FPort forwarding in supported views
Ctrl + DDelete selected resource
Ctrl + KImmediately delete supported resource
Ctrl + ADisplay available resource aliases
Ctrl + RRefresh view
Ctrl + CExit K9s

Keyboard actions depend on the current resource view and RBAC permissions. Use ? to verify the available actions before executing them. k9scli.io+1

Part 11: Enable CPU and Memory Metrics in K9s

Embedded Tools | Zarf

docs.zarf.dev

K9s can display Kubernetes CPU and memory utilization when a compatible Kubernetes Metrics API is available.

Step 1: Verify Metrics API availability

kubectl top nodes

kubectl top pods -A

If these commands return resource utilization, proceed directly to K9s.

Step 2: Install Kubernetes Metrics Server if required

For a compatible development cluster without Metrics Server:

kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yamlCode language: JavaScript (javascript)

For production clusters, review and pin an approved Metrics Server version compatible with your Kubernetes release. Check whether your managed Kubernetes provider already supplies a metrics service.

Step 3: Verify Metrics Server

kubectl get pods -n kube-system

kubectl rollout status deployment/metrics-server -n kube-systemCode language: JavaScript (javascript)

Step 4: Verify metrics

kubectl top nodes

kubectl top pods -A

Step 5: Start K9s

k9s -A

Navigate to:

:podsCode language: CSS (css)

Or:

:nodesCode language: CSS (css)

You should see CPU and memory utilization when supported and authorized.

Metric columnDescription
CPUCurrent CPU usage
MEMCurrent memory usage
%CPU/RCPU utilization relative to requested CPU
%CPU/LCPU utilization relative to CPU limit
%MEM/RMemory utilization relative to requested memory
%MEM/LMemory utilization relative to memory limit

Column availability depends on the resource view, requests, limits and K9s version.

Part 12: Configure K9s for Production Read-Only Access

For production environments, engineers should use read-only access by default where appropriate.

Method 1: Read-only mode from CLI

k9s --readonly

For a specific production context:

k9s --context production --readonly

For a particular namespace:

k9s --context production -n application --readonly

Method 2: Global configuration

Update config.yaml:

k9s:
  readOnly: trueCode language: JavaScript (javascript)

Method 3: Context-specific configuration

Identify the context configuration directory:

k9s info

Locate the production context configuration file and update the existing configuration:

k9s:
  readOnly: trueCode language: JavaScript (javascript)

Preserve other existing context settings.

Method 4: Verify Kubernetes RBAC permissions

kubectl auth can-i get pods -n production

kubectl auth can-i list pods -n production

kubectl auth can-i get pods/log -n production

kubectl auth can-i delete pods -n production

kubectl auth can-i update deployments -n production

kubectl auth can-i create pods/exec -n productionCode language: JavaScript (javascript)

For a read-only production user, the expected results would generally be:

yes
yes
yes
no
no
no

Important: K9s read-only mode is a client-side operational safeguard. Kubernetes RBAC is the actual security enforcement mechanism.

Part 13: K9s Hands-On Hello World Exercise

This exercise verifies that K9s can connect to Kubernetes, discover workloads, access logs and manage resources.

Use a development or local Kubernetes cluster, not production.

Step 1: Verify the current Kubernetes cluster

kubectl config current-context

kubectl get nodesCode language: JavaScript (javascript)

Step 2: Create a demo namespace

kubectl create namespace k9s-demoCode language: PHP (php)

Step 3: Deploy an NGINX application

kubectl create deployment hello-k9s \
  --image=nginx:alpine \
  --namespace=k9s-demoCode language: PHP (php)

On Windows PowerShell, use a single-line command:

kubectl create deployment hello-k9s --image=nginx:alpine --namespace=k9s-demoCode language: PHP (php)

Step 4: Create a Kubernetes Service

kubectl expose deployment hello-k9s \
  --port=80 \
  --target-port=80 \
  --type=ClusterIP \
  --namespace=k9s-demoCode language: PHP (php)

Windows PowerShell:

kubectl expose deployment hello-k9s --port=80 --target-port=80 --type=ClusterIP --namespace=k9s-demoCode language: PHP (php)

Step 5: Verify the application

kubectl rollout status deployment/hello-k9s -n k9s-demo

kubectl get all -n k9s-demoCode language: JavaScript (javascript)

Expected output will resemble:

NAME                            READY   STATUS    RESTARTS
pod/hello-k9s-xxxxxxxxx-xxxxx    1/1     Running   0

NAME                TYPE        PORT(S)
service/hello-k9s   ClusterIP   80/TCP

NAME                        READY   AVAILABLE
deployment.apps/hello-k9s   1/1     1

Step 6: Launch K9s

k9s -n k9s-demo

Step 7: Perform hands-on operations inside K9s

K9s practical verification checklist

0 of 8 completedEnter :pods and verify the NGINX Pod is Running.Select the Pod and press d to inspect its details.Press Esc, select the Pod and press l to view logs.Press Esc, select the Pod and press y to inspect YAML.Enter :deploy and verify the Deployment is ready.Enter :svc and verify the ClusterIP Service.Enter :events and inspect namespace events.Enter :q to exit K9s.

Reset checklist

Step 8: Access the NGINX application

kubectl port-forward svc/hello-k9s 8080:80 -n k9s-demo

Open the following URL in your browser:

http://localhost:8080

Exploring Microsoft Radius Application Platform – The New Stack

thenewstack.io

Alternatively, from another terminal:

curl http://localhost:8080Code language: JavaScript (javascript)

On Windows PowerShell:

curl.exe http://localhost:8080Code language: JavaScript (javascript)

You should receive the default NGINX welcome page.

Step 9: Scale the Deployment

Stop port forwarding with Ctrl + C.

kubectl scale deployment hello-k9s --replicas=3 -n k9s-demo

Launch K9s again:

k9s -n k9s-demo

Navigate to :pods and verify that three Pods are running.

Step 10: Clean up the demo environment

Exit K9s and delete the dedicated demo namespace:

kubectl delete namespace k9s-demoCode language: JavaScript (javascript)

Congratulations! You have successfully completed a K9s installation and Kubernetes management exercise.

Part 14: K9s Troubleshooting Commands

ProblemDiagnostic command
K9s not installedk9s version
Unknown configuration pathk9s info
Kubernetes connection failurekubectl cluster-info
Incorrect Kubernetes contextkubectl config current-context
Missing kubeconfig contextkubectl config get-contexts
Permission deniedkubectl auth can-i list pods
Missing resource metricskubectl top nodes
Namespace access issueskubectl get pods -n default
K9s application errorsk9s -l debug
Unsupported commandk9s help

Enable debug logs

k9s -l debug

Find K9s log location

k9s info

Configure a custom debug log file

macOS and Linux:

k9s -l debug --logFile /tmp/k9s-debug.log

Monitor the logs from another terminal:

tail -f /tmp/k9s-debug.log

Windows PowerShell:

k9s -l debug --logFile "$env:TEMP\k9s-debug.log"Code language: JavaScript (javascript)

Monitor the logs:

Get-Content "$env:TEMP\k9s-debug.log" -WaitCode language: JavaScript (javascript)

Part 15: K9s Best Practices for DevOps and SRE Teams

Best practiceRecommendation
Production accessUse read-only mode and restricted RBAC
Cluster authenticationPrefer individual, short-lived credentials
Context namingUse descriptive environment names
Visual differentiationConfigure environment-specific themes
Private clustersUse approved VPN, SSM or private connectivity
Configuration managementVersion-control non-sensitive K9s configuration
Kubernetes SecretsRestrict access to authorized users
Resource modificationFollow change management procedures
GitOps workloadsManage persistent changes through Git
Log analysisIntegrate centralized logging platforms
MonitoringUse dedicated monitoring and alerting systems
PluginsReview external commands before enabling
UpdatesMaintain approved K9s and kubectl versions

Part 16: Frequently Asked Questions

Is K9s completely free?

Yes. K9s is free and open-source software licensed under Apache 2.0.

Does K9s require Docker?

No. K9s is a standalone Kubernetes client.

Does K9s require installation inside Kubernetes?

No. It communicates directly with the Kubernetes API server.

Can K9s manage multiple Kubernetes clusters?

Yes. K9s supports switching between configured Kubernetes contexts.

Can K9s replace kubectl?

No. K9s improves interactive operations, while kubectl remains essential for automation, scripting and advanced administration.

Can K9s run on an AWS EC2 instance?

Yes. K9s can run on an EC2 Linux instance with appropriate Kubernetes API connectivity and authentication.

Can K9s manage private EKS clusters?

Yes, provided K9s runs in an environment with authorized access to the private Kubernetes API endpoint.

Can K9s manage Helm releases?

Yes. K9s provides Helm release views and supported management actions.

Can K9s monitor CPU and memory?

Yes, when a compatible Kubernetes Metrics API is available.

Can K9s replace Grafana, Prometheus, Datadog or Dynatrace?

No. K9s is primarily an interactive operational tool, not a comprehensive historical observability and alerting platform.

Conclusion

K9s is one of the most useful tools that every DevOps Engineer, SRE, Kubernetes Administrator and Platform Engineer should consider learning.

It significantly simplifies everyday Kubernetes operations, reduces repetitive command execution and improves troubleshooting productivity.

Whether you are managing local Kubernetes environments or enterprise-scale EKS, AKS and GKE clusters, K9s provides a lightweight, powerful and flexible operational interface.

A strong Kubernetes operational toolkit combines:

ToolResponsibility
kubectlAdministration and automation
K9sInteractive operations and troubleshooting
HeadlampGraphical Kubernetes management
HelmApplication packaging
Argo CDGitOps application delivery
TerraformInfrastructure provisioning
PrometheusMetrics and alerting
GrafanaObservability dashboards

Master Kubernetes fundamentals first, learn kubectl thoroughly, and use K9s to accelerate your everyday Kubernetes operations.

Official references

ResourceURL
K9s official websitehttps://k9scli.io/
K9s GitHub repositoryhttps://github.com/derailed/k9s
K9s latest releasehttps://github.com/derailed/k9s/releases/latest
Installation documentationhttps://k9scli.io/topics/install/
Configuration documentationhttps://k9scli.io/topics/config/
Command documentationhttps://k9scli.io/topics/commands/
Skins documentationhttps://k9scli.io/topics/skins/
Kubernetes documentationhttps://kubernetes.io/
Kubernetes Metrics Serverhttps://github.com/kubernetes-sigs/metrics-server

Verification note: Installation methods, configuration parameters and CLI commands were reviewed against official documentation. The commands have not been independently executed on all three operating systems. Release-dependent paths and package availability should be confirmed using k9s info, k9s help and the official release page.

WordPress SEO configuration

SEO parameterRecommended value
SEO TitleHow to Install and Configure K9s on macOS, Linux and Windows
Focus KeywordK9s installation and configuration
URL Slugk9s-installation-configuration-macos-linux-windows
Meta DescriptionLearn how to install, configure and use K9s on macOS, Linux and Windows with step-by-step commands, configuration files, shortcuts and hands-on exercises.
CategoryKubernetes
TagsKubernetes, K9s, DevOps, SRE, EKS, AKS, GKE, kubectl, Kubernetes Management
Featured Image1200 × 630 px
Content TypeHands-on technical tutorial

Find Trusted Cardiac Hospitals

Compare heart hospitals by city and services — all in one place.

Explore Hospitals
I'm Rajesh Kumar, a DevOps, SRE, DevSecOps, Cloud, and Platform Engineering expert passionate about sharing practical knowledge, real-world experiences, and industry best practices. I have worked at Cotocus and regularly write about technology, travel, investing, health, product reviews, and digital marketing through my various platforms. I publish technical articles at DevOps School, travel stories at Holiday Landmark, stock market insights at Stocks Mantra, health and fitness guidance at My Medic Plus, product reviews at TrueReviewNow, and SEO and digital marketing strategies at Wizbrand.

Related Posts

Top 10 Kubernetes Management Tools in 2026: K9s vs Headlamp vs Lens vs Rancher

A Complete Guide for DevOps Engineers, SREs, Platform Engineers and Kubernetes Administrators Kubernetes has become the foundation of modern cloud-native infrastructure. From startups running a handful of…

Read More

Writing Smarter, Not Longer: How AI Presentation Makers Cut Slide Bloat

Most decks are too long. Not slightly too long: they carry twice the slides the content needs, and each slide carries twice the words. The bloat arrives…

Read More

Best Grammar Checkers for Technical Documentation Teams

Technical documentation has particular grammar requirements. It must be precise, consistent across hundreds of pages written by different people, readable by non-native English speakers, and free of…

Read More

12 Real Ways Creators Make Money on Instagram in 2026

You don’t need a social media following in the hundreds of thousands to turn your Instagram activity into real cash in 2026. Creators are earning money through…

Read More

How to Build a Reliable CI Pipeline for 3D Assets

A repository that performs well with source code can become slow and difficult to maintain once a team begins adding 3D models, textures, animations, and generated previews….

Read More

Microsoft Sentinel and Microsoft Defender Portal

Microsoft Sentinel and Microsoft Defender Portal: The Complete Hands-On Tutorial for SIEM, SOAR, Threat Detection, and Security Operations Beginner to Advanced | Azure Security | SOC |…

Read More
Subscribe
Notify of
guest
0 Comments
Newest
Oldest Most Voted
0
Would love your thoughts, please comment.x
()
x