# Install k9s on Linux

**k9s is a command-line interface (CLI) that helps you manage your Kubernetes clusters quickly and easily.** It provides a visual and interactive way to browse, navigate, and manipulate your cluster resources, saving you time and effort compared to using kubectl commands.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1707035317780/1ed1349f-da77-4585-b799-be8276a1e558.png align="center")

**Prerequisites:**

* **Kubernetes cluster:** You'll need an existing Kubernetes cluster to manage with k9s. If you don't have one, consider using tools like `minikube` (for local development) or a cloud-hosted service like EKS, GKE or AKS to set one up.
    
* **256-color terminal:** k9s utilizes a rich interface, so make sure your terminal supports 256 colors. Check your terminal settings, and if needed, export the `TERM` environment variable: `export TERM=xterm-256color`.
    
* **Text editor:** Choose your preferred text editor, as k9s might open it for resource editing. Set the `EDITOR` or `KUBE_EDITOR` environment variable: `export EDITOR=nano` or `export KUBE_EDITOR=vim`.
    

**Installation:**

1. Visit the k9s releases page ([https://github.com/derailed/k9s/releases](https://github.com/derailed/k9s/releases)) to find supported binary for your Linux distribution.
    
2. Download binary by running the following command:
    
    ```plaintext
    curl -LO https://github.com/derailed/k9s/releases/download/v0.31.7/k9s_Linux_amd64.tar.gz
    ```
    
3. Extract binary it using the following command:
    
    ```plaintext
    tar xvzf k9s_Linux_amd64.tar.gz
    ```
    
4. **Make the binary executable:** Once downloaded, change the file permissions to make it executable:
    
    ```plaintext
    chmod +x k9s
    ```
    
5. **Move to a suitable location (optional):** You can move the `k9s` binary to a directory included in your system's `PATH` environment variable so you can run it from anywhere. For example, move it to `/usr/local/bin`: `sudo mv k9s /usr/local/bin` (requires administrative privileges).
    
    ```plaintext
    sudo mv k9s /usr/local/bin/
    ```
    
6. Verify k9s version:
    
    ```plaintext
    k9s version
    ```
    
    Sample output of k9s version:
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1707035162665/2f24bd60-bef0-41db-b8a8-5cc31bec5245.png align="left")
    

**Run k9s:**

1. **Connect to a cluster:** Open a terminal and run `k9s` to get started. If you have multiple clusters, use the `-a` flag to specify the one you want to connect to: `k9s -a my-cluster-name`.
    

**Additional notes:**

* Consider using a terminal multiplexer like `tmux` or `screen` to keep multiple k9s windows open simultaneously, especially for managing complex clusters.
    
* If you encounter issues, check the k9s GitHub repository ([https://github.com/derailed/k9s](https://github.com/derailed/k9s)) for known issues and solutions.
