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

# Configuration

> Environment variables and the ~/.nagare data directory structure for Nagare.

## Environment variables

### Gateway

| Variable | Default | Description |
| - | - | - |
| `NAGARE_GATEWAY_HOST` | `localhost` | The listen address. `nagare gateway start --host` sets this variable. |
| `NAGARE_GATEWAY_PORT` | `9832` | The port for the REST API and WebSocket. |
| `NAGARE_GATEWAY_PUBLIC_KEY` | | The public key used to verify tokens. `nagare gateway start` sets this automatically from the keyring. |
| `NAGARE_GATEWAY_MODE` | | `nagare gateway start` sets it to `prod`. The value `debug` also enables `/metrics` and `/debug/pprof`. |

Plugins inherit the entire environment of the gateway. For example, the Telegram plugin reads `NAGARE_TELEGRAM_TOKEN`.

### Web UI and desktop

| Variable | Used by | Description |
| - | - | - |
| `NAGARE_WEB_UI_PORT` | `nagare web` | The web UI port (default `3005`). |
| `NAGARE_GATEWAY_URL` | `nagare web`, `nagare-desktop` | The gateway URL. |
| `NAGARE_AUTH_TOKEN` | `nagare-desktop` | The token for automatic login. |

### Plugin

See [Plugin runtime environment](https://docs.nagare.smtdfc.net/en/plugins/overview.md#runtime-environment).

## Data directory

All data lives in `~/.nagare`:

```text theme={null}
~/.nagare/
├── .gateway.pid             # PID of the running gateway
├── config.json
├── assets/                  # Web UI and bundled plugin packages
├── artifacts/               # Files created by tools (e.g. screenshots)
├── configs/
│   ├── plugins/<package>/   # Per-plugin configuration
│   └── modules/
├── credentials/
├── data/
│   ├── plugins/<package>/   # Per-plugin data
│   └── modules/
├── databases/
│   └── nagare.db            # SQLite database
├── logs/
│   ├── app.log              # Gateway logs
│   ├── plugins/<package>.log
│   └── modules/
├── modules/                 # Modules, e.g. nagare_vector
├── plugins/                 # Installed plugins
├── temp/
├── trusted/                 # Trusted public keys for verifying plugins
├── uploads/
├── nagare-plugin.sock       # IPC socket for plugins (Linux/macOS)
└── nagare-external-module.sock
```

On Windows, IPC uses named pipes `\\.\pipe\nagare-plugin` and `\\.\pipe\nagare-external-module`.

## Security keys

The 4096-bit RSA key pair used for signing tokens is stored in the operating system's keyring, service `nagare.security.keyring`. It is not located in `~/.nagare`. If you delete the key from the keyring, Nagare will create a new one and all old tokens will become invalid.


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