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

# Environment variables

> Settings the desktop app reads from its environment when it starts, and how to set them on each system.

Most people never need these. KubeStacks works out of the box with your kubeconfig, and the app's own settings cover the rest. Environment variables are for what you want fixed before the app opens: a machine where nothing may change, a slow API server, a `helm` in an unusual place.

KubeStacks reads them once, when it starts. Restart it after changing one.

<Note>
  This page is about the desktop app. KubeStacks [in your cluster](/server/overview) has its own settings, set through the Helm chart: see [Configuration](/server/configuration).
</Note>

## Variables

<ResponseField name="KUBECONFIG" type="path list" default="~/.kube/config">
  Where your clusters come from, as for `kubectl`. List several files separated by `:` (`;` on Windows), and KubeStacks merges them the way `kubectl` does: the first file to define a name wins, and so does the first `current-context`. Files that are missing or empty are skipped, and relative paths in a file are read from that file's folder. See [Connecting clusters](/clusters/connect).
</ResponseField>

<ResponseField name="KUBESTACKS_READ_ONLY" type="1 or true">
  Makes every cluster read-only, whatever is set in the app. The read-only switch then reads **Set by KUBESTACKS\_READ\_ONLY** and can't be turned off. The app's main process enforces it, not just the buttons, and it covers shells and Helm too. Useful on shared machines. See [Read-only mode](/changes/read-only).
</ResponseField>

<ResponseField name="KUBESTACKS_MAX_LIST_ITEMS" type="number" default="5000">
  The most objects a list loads. Lists are fetched in chunks of 500 and stop here, with a note saying so. Filter by label to see the rest, or raise the limit for a very large cluster.
</ResponseField>

<ResponseField name="KUBESTACKS_REQUEST_TIMEOUT_MS" type="milliseconds" default="20000">
  How long the API server has to answer a request. Raise it for a slow or distant API server that shows **The cluster isn't responding**.
</ResponseField>

<ResponseField name="KUBESTACKS_VIEWS_DIR" type="path" default="~/.kubestacks/views">
  Where your own [views](/custom-resources/write-a-view) are. Every `.yaml` and `.yml` file in it is read.
</ResponseField>

<ResponseField name="KUBESTACKS_HELM" type="path" default="helm">
  The `helm` to run when you change a Helm release. Without it, KubeStacks runs the `helm` on your login shell's `PATH`. See [Helm releases](/helm/releases).
</ResponseField>

<ResponseField name="KUBESTACKS_ARTIFACT_HUB_URL" type="URL" default="https://artifacthub.io">
  The Artifact Hub to search when you [install a chart](/helm/install).
</ResponseField>

<Info>
  You don't need to set `PATH` for credential plugins. On macOS and Linux, apps opened from the Dock or a launcher don't see the `PATH` your shell sets up, so KubeStacks asks your login shell for it when it starts. That's how `gke-gcloud-auth-plugin`, `aws`, `kubelogin` and `helm` are found. Other variables aren't read from your shell profile: set them as below.
</Info>

## Setting them

<Tabs>
  <Tab title="macOS" icon="apple">
    Quit KubeStacks first. Then start it from Terminal with the variables in front of the command:

    ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}}
    KUBESTACKS_READ_ONLY=1 open -a KubeStacks
    ```

    Apps started with `open` get the environment of the shell that ran it. If KubeStacks is already running, `open` brings that copy to the front instead, without the new settings.

    To have every launch from the Dock or Spotlight pick a variable up, set it for your session:

    ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}}
    launchctl setenv KUBESTACKS_READ_ONLY 1
    ```

    This lasts until you log out or restart. `launchctl unsetenv KUBESTACKS_READ_ONLY` removes it.
  </Tab>

  <Tab title="Linux" icon="terminal">
    Start KubeStacks from a terminal with the variables in front of the command. The `.deb` and `.rpm` packages install it as `kubestacks`:

    ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}}
    KUBESTACKS_READ_ONLY=1 kubestacks
    ```

    For the AppImage, run the file itself:

    ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}}
    KUBESTACKS_READ_ONLY=1 ./KubeStacks-*-linux-x86_64.AppImage
    ```

    To have every launch from your desktop pick a variable up, set it where your desktop session reads its environment (for example `~/.profile`), then log out and back in.
  </Tab>

  <Tab title="Windows" icon="app-window">
    Set the variable for your account, then start KubeStacks again from the Start menu:

    ```powershell theme={"theme":{"light":"github-light","dark":"github-dark-default"}}
    setx KUBESTACKS_READ_ONLY 1
    ```

    Or set it without a terminal: search the Start menu for **environment variables**, choose **Edit environment variables for your account**, and add it there. That's also where you change or remove it later.

    `setx` only affects programs started after it runs, so quit KubeStacks before starting it again.
  </Tab>
</Tabs>

## Examples

<CodeGroup>
  ```bash Look, don't touch theme={"theme":{"light":"github-light","dark":"github-dark-default"}}
  # A shared machine: nothing can be changed through KubeStacks.
  KUBESTACKS_READ_ONLY=1 open -a KubeStacks
  ```

  ```bash Several kubeconfigs theme={"theme":{"light":"github-light","dark":"github-dark-default"}}
  KUBECONFIG="$HOME/.kube/config:$HOME/.kube/staging.yaml" open -a KubeStacks
  ```

  ```bash A slow API server theme={"theme":{"light":"github-light","dark":"github-dark-default"}}
  KUBESTACKS_REQUEST_TIMEOUT_MS=60000 open -a KubeStacks
  ```

  ```bash A huge cluster theme={"theme":{"light":"github-light","dark":"github-dark-default"}}
  KUBESTACKS_MAX_LIST_ITEMS=20000 open -a KubeStacks
  ```
</CodeGroup>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.