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
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
| Requirement | Description |
|---|---|
| Operating system | macOS, Linux or Windows |
| Kubernetes cluster | EKS, AKS, GKE, Minikube, Rancher Desktop, etc. |
| kubectl | Recommended for configuration and verification |
| kubeconfig | Valid Kubernetes connection configuration |
| Network connectivity | Access to the Kubernetes API server |
| Kubernetes RBAC | Appropriate resource permissions |
| Terminal | Terminal, iTerm2, PowerShell or Windows Terminal |
| Metrics API | Optional, for CPU and memory metrics |
Part 1: Install K9s on macOS
Step 1: Check macOS version and architecture
sw_vers
uname -m
| Architecture | Processor |
|---|---|
arm64 | Apple Silicon – M1, M2, M3, M4 and later |
x86_64 | Intel 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
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:
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 distribution | Installation command |
|---|---|
| Fedora 42+ | sudo dnf install k9s |
| Arch Linux | sudo pacman -S k9s |
| openSUSE | sudo zypper install k9s |
| Linux Homebrew | brew install derailed/k9s/k9s |
| RHEL / Rocky Linux / AlmaLinux | Official 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 system | Default 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 system | Typical 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 directory | Purpose |
|---|---|
config.yaml | Main K9s configuration |
aliases.yaml | Custom resource commands |
hotkeys.yaml | Custom keyboard shortcuts |
plugins.yaml | Custom external commands and integrations |
views.yaml | Customized resource columns |
skins/ | Themes and color customization |
clusters/ | Cluster-specific configuration |
k9s.log | Application 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
| Parameter | Purpose |
|---|---|
refreshRate | UI refresh interval in seconds |
liveViewAutoRefresh | Enables periodic resource-browser refresh |
maxConnRetry | API reconnection attempts |
apiServerTimeout | Kubernetes API request timeout |
readOnly | Disables modification actions in K9s |
defaultView | Initial resource view |
enableMouse | Enables mouse interaction |
headless | Hides the K9s header |
logoless | Hides the K9s logo |
skin | Selects the UI theme |
tail | Initial log lines to retrieve |
buffer | Maximum log lines retained in the view |
sinceSeconds | Historical log retrieval window |
textWrap | Wraps long log lines |
showTime | Displays log timestamps |
thresholds | Visual 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:
| Alias | Resource |
|---|---|
:pp | Pods |
:dd | Deployments |
:ss | Services |
:nn | Nodes |
:cc | ConfigMaps |
:sc | Secrets |
:ing | Ingresses |
:crb | ClusterRoleBindings |
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
| Shortcut | Operation |
|---|---|
| Shift + 0 | Pods |
| Shift + 1 | Deployments |
| Shift + 2 | Services |
| Shift + 3 | Nodes |
| Shift + 4 | Events |
| Shift + 5 | Namespaces |
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.
Dracula theme
Nord theme
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:
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
| Environment | Suggested color theme |
|---|---|
| Development | Green |
| Staging | Blue |
| UAT | Yellow |
| Production | Red |
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.
| Command | Purpose |
|---|---|
k9s | Launch K9s |
k9s version | Display version |
k9s info | Display configuration locations |
k9s help | Display help |
k9s -A | Start with all namespaces |
k9s -n default | Open a namespace |
k9s -n kube-system | Open system namespace |
k9s --context dev | Connect to development cluster |
k9s --context production | Connect to production cluster |
k9s --readonly | Enable read-only mode |
k9s -c pods | Start in Pod view |
k9s -c deployments | Start in Deployment view |
k9s -c nodes | Start in Node view |
k9s -l debug | Enable debug logging |
k9s --kubeconfig ./config | Use custom kubeconfig |
Kubernetes resource commands inside K9s
Press : followed by the resource name and Enter.
| K9s command | Equivalent kubectl command |
|---|---|
:pods | kubectl get pods |
:deploy | kubectl get deployments |
:svc | kubectl get services |
:ns | kubectl get namespaces |
:nodes | kubectl get nodes |
:cm | kubectl get configmaps |
:secrets | kubectl get secrets |
:ing | kubectl get ingress |
:rs | kubectl get replicasets |
:sts | kubectl get statefulsets |
:ds | kubectl get daemonsets |
:jobs | kubectl get jobs |
:cj | kubectl get cronjobs |
:pv | kubectl get pv |
:pvc | kubectl get pvc |
:sc | kubectl get storageclass |
:hpa | kubectl get hpa |
:events | kubectl get events |
:sa | kubectl get serviceaccounts |
:roles | kubectl get roles |
:rolebindings | kubectl get rolebindings |
:clusterroles | kubectl get clusterroles |
:crd | kubectl get crd |
:networkpolicies | kubectl get networkpolicies |
:helm | helm list |
:ctx | kubectl config get-contexts |
:q | Exit K9s |
Resource aliases can differ between versions or be overridden by custom configuration.
K9s keyboard shortcuts
| Shortcut | Operation |
|---|---|
↑ / ↓ | Navigate resources |
Enter | Open selected resource |
Esc | Go back |
? | Display available keyboard shortcuts |
/ | Search and filter |
d | Describe resource |
e | Edit resource |
y | View YAML |
l | View container logs |
s | Open container shell |
Shift + F | Port forwarding in supported views |
Ctrl + D | Delete selected resource |
Ctrl + K | Immediately delete supported resource |
Ctrl + A | Display available resource aliases |
Ctrl + R | Refresh view |
Ctrl + C | Exit 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
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 column | Description |
|---|---|
| CPU | Current CPU usage |
| MEM | Current memory usage |
| %CPU/R | CPU utilization relative to requested CPU |
| %CPU/L | CPU utilization relative to CPU limit |
| %MEM/R | Memory utilization relative to requested memory |
| %MEM/L | Memory 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:
Exploring Microsoft Radius Application Platform – The New Stack
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
| Problem | Diagnostic command |
|---|---|
| K9s not installed | k9s version |
| Unknown configuration path | k9s info |
| Kubernetes connection failure | kubectl cluster-info |
| Incorrect Kubernetes context | kubectl config current-context |
| Missing kubeconfig context | kubectl config get-contexts |
| Permission denied | kubectl auth can-i list pods |
| Missing resource metrics | kubectl top nodes |
| Namespace access issues | kubectl get pods -n default |
| K9s application errors | k9s -l debug |
| Unsupported command | k9s 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 practice | Recommendation |
|---|---|
| Production access | Use read-only mode and restricted RBAC |
| Cluster authentication | Prefer individual, short-lived credentials |
| Context naming | Use descriptive environment names |
| Visual differentiation | Configure environment-specific themes |
| Private clusters | Use approved VPN, SSM or private connectivity |
| Configuration management | Version-control non-sensitive K9s configuration |
| Kubernetes Secrets | Restrict access to authorized users |
| Resource modification | Follow change management procedures |
| GitOps workloads | Manage persistent changes through Git |
| Log analysis | Integrate centralized logging platforms |
| Monitoring | Use dedicated monitoring and alerting systems |
| Plugins | Review external commands before enabling |
| Updates | Maintain 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:
| Tool | Responsibility |
|---|---|
| kubectl | Administration and automation |
| K9s | Interactive operations and troubleshooting |
| Headlamp | Graphical Kubernetes management |
| Helm | Application packaging |
| Argo CD | GitOps application delivery |
| Terraform | Infrastructure provisioning |
| Prometheus | Metrics and alerting |
| Grafana | Observability dashboards |
Master Kubernetes fundamentals first, learn kubectl thoroughly, and use K9s to accelerate your everyday Kubernetes operations.
Official references
| Resource | URL |
|---|---|
| K9s official website | https://k9scli.io/ |
| K9s GitHub repository | https://github.com/derailed/k9s |
| K9s latest release | https://github.com/derailed/k9s/releases/latest |
| Installation documentation | https://k9scli.io/topics/install/ |
| Configuration documentation | https://k9scli.io/topics/config/ |
| Command documentation | https://k9scli.io/topics/commands/ |
| Skins documentation | https://k9scli.io/topics/skins/ |
| Kubernetes documentation | https://kubernetes.io/ |
| Kubernetes Metrics Server | https://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 parameter | Recommended value |
|---|---|
| SEO Title | How to Install and Configure K9s on macOS, Linux and Windows |
| Focus Keyword | K9s installation and configuration |
| URL Slug | k9s-installation-configuration-macos-linux-windows |
| Meta Description | Learn how to install, configure and use K9s on macOS, Linux and Windows with step-by-step commands, configuration files, shortcuts and hands-on exercises. |
| Category | Kubernetes |
| Tags | Kubernetes, K9s, DevOps, SRE, EKS, AKS, GKE, kubectl, Kubernetes Management |
| Featured Image | 1200 × 630 px |
| Content Type | Hands-on technical tutorial |
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.
Find Trusted Cardiac Hospitals
Compare heart hospitals by city and services — all in one place.
Explore Hospitals