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

# Installation

> Install Kong from PyPI or source, configure your environment, and verify everything works.

## Prerequisites

* **Python 3.11+** — [python.org](https://www.python.org/downloads/) or your system package manager
* **uv** — Python package manager ([Install uv](https://docs.astral.sh/uv/getting-started/installation/))
* **Ghidra** — NSA's reverse engineering framework ([Install Ghidra](https://ghidra-sre.org/InstallationGuide.html))
* **JDK 21+** — Required by Ghidra ([Adoptium](https://adoptium.net/))
* **LLM API key** — At least one of:
  * [Anthropic](https://console.anthropic.com/settings/keys) (Claude)
  * [OpenAI](https://platform.openai.com/api-keys) (GPT-4o)

## Install Kong

<Tabs>
  <Tab title="From PyPI (recommended)">
    ```bash theme={null}
    uv pip install kong-re
    ```

    This installs the `kong` CLI and all dependencies, including PyGhidra, the Anthropic SDK, the OpenAI SDK, and z3-solver.
  </Tab>

  <Tab title="From source">
    ```bash theme={null}
    git clone https://github.com/amruth-sn/kong.git
    cd kong
    uv sync
    ```

    When running from source, prefix commands with `uv run`:

    ```bash theme={null}
    uv run kong setup
    uv run kong analyze ./path/to/binary
    ```
  </Tab>
</Tabs>

## Environment Variables

Kong uses environment variables for API keys and optional path overrides. Set at least one API key before running analysis.

| Variable             | Required             | Default          | Description                           |
| -------------------- | -------------------- | ---------------- | ------------------------------------- |
| `ANTHROPIC_API_KEY`  | At least one API key | —                | Anthropic API key for Claude models   |
| `OPENAI_API_KEY`     | At least one API key | —                | OpenAI API key for GPT-4o models      |
| `GHIDRA_INSTALL_DIR` | No                   | Auto-detected    | Path to Ghidra installation directory |
| `JAVA_HOME`          | No                   | Auto-detected    | Path to JDK installation              |
| `KONG_CONFIG_DIR`    | No                   | `~/.config/kong` | Override config directory location    |

Set your API key in your shell profile so it persists across sessions:

```bash theme={null}
# ~/.zshrc or ~/.bashrc
export ANTHROPIC_API_KEY="sk-ant-..."
# and/or
export OPENAI_API_KEY="sk-..."
```

<Tip>
  You only need **one** API key. Kong's smart routing will use whichever provider has a valid key configured. If you have both, the [setup wizard](/getting-started/setup-wizard) lets you pick a default.
</Tip>

## Verify Installation

Confirm that Kong is installed and accessible:

```bash theme={null}
kong --version
```

You should see output like:

```
kong, version 0.2.2
```

## Ghidra Auto-Detection

Kong automatically searches for Ghidra in common installation locations. If auto-detection fails (for example, if you installed Ghidra to a non-standard path), set the `GHIDRA_INSTALL_DIR` environment variable:

```bash theme={null}
export GHIDRA_INSTALL_DIR="/opt/ghidra_11.3.1_PUBLIC"
```

The same applies to the JDK — Kong will find it automatically in most cases, but you can set `JAVA_HOME` explicitly if needed.

## Next Steps

Once installed, run the [setup wizard](/getting-started/setup-wizard) to configure your LLM providers, or jump straight to the [Quickstart](/getting-started/quickstart) to analyze your first binary.
