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

# helix doctor

> Check an instance's setup: runtime, storage, disk cache, memory, and index use

Reference

Check how an instance is set up and what to change. Doctor checks what the CLI can see itself,
then asks the server for its own checks: whether data is durable, whether the S3 bucket is in the
server's region, whether the disk cache is on local NVMe rather than network block storage like
EBS, whether caches fit in memory, and whether recent queries used indexes. Local, self-hosted,
and Cloud.

Doctor is read-only. It never changes the instance, its data, its caches, or `helix.toml`, and it
never starts a container.

## Usage

```bash theme={"languages":{"custom":["languages/helixql.json"]}}
helix doctor [INSTANCE]
helix doctor --url <URL>
```

## Arguments

| Argument | Description |
| - | - |
| `INSTANCE` | Instance or typed database (`cluster:<id>`, `tenant:<id>`). Defaults to `dev`, else the only instance, else a prompt. A Helix Cloud database gets only the `cli.version` check (and a skipped `cloud.managed`); see its query insights in the Helix dashboard. |

## Options

| Flag | Description | Default |
| - | - | - |
| `--url <URL>` | Diagnose the server at this base URL instead, e.g. a self-hosted server. No `helix.toml` is needed. Cannot be combined with `INSTANCE`. | — |
| `--json` | Print the report as JSON on stdout. | Off |
| `-v`, `--verbose` | Also print the details of passing checks. | Off |
| `--quiet` | Print only warnings, failures, and the summary. | Off |

## Checks

Each check passes, warns, fails, or is skipped with its reason. A warning means the setup works
but costs performance or money; a failure means it risks losing data or cannot work. Warnings and
failures print a fix.

| Check | What it looks at |
| - | - |
| `cli.version` | Whether a newer CLI is released. |
| `runtime.daemon`, `runtime.container`, `runtime.image` | Local instances: Docker or Podman answers, the container is running, and its image is not older than the one this CLI ships with. |
| `server.reachable` | The server answers `GET /healthz` and is ready. It fails when another server opened the same storage as writer and fenced this one, or when its storage failed; any other non-200 answer, such as a proxy's 502 or a 404 from a URL that is not a Helix server, fails with that status. |
| `storage.durability` | Data is in S3 or on disk, not in memory only. |
| `storage.data_device` | `HELIX_DATA_DIR` is on persistent storage: not tmpfs, the container's writable layer, or ephemeral instance storage. |
| `storage.s3_region` | The S3 bucket is in the server's AWS region. The server's region comes from EC2 or ECS metadata; in a container on EC2 that needs an IMDSv2 hop limit of 2. |
| `storage.s3_latency` | The median of five S3 round trips from the server is under 50 ms. |
| `cache.device` | The disk cache is on a local SSD or NVMe instance storage, not network block storage (EBS, Persistent Disk), a network filesystem, tmpfs, or the container's writable layer. |
| `cache.space` | `HELIX_DISK_CACHE_BYTES` fits the cache's filesystem. |
| `cache.warm` | S3 storage warms the disk cache after a restart. |
| `resources.memory` | Cache budgets take at most 70% of the memory the server may use. |
| `indexes.publication` | Vector and text index publication is caught up and holds back no entries. |
| `indexes.dropped_storage` | How many dropped indexes still wait for compactions to discard their rows, an estimate of the bytes that wait, for how long, and how long the one that has gone longest without progress has stood still. The server rewrites the sorted runs that hold the rows itself once its compactor has had nothing to do for a few minutes, when the rows are a large enough part of a run to be worth its rewrite; a server that is never idle that long keeps them until its ordinary compactions rewrite those runs, and rows left in a run not worth rewriting are reported with the size of the run. A server whose compactor runs one compaction at a time never rewrites a run for them, and a server that runs no compaction worker of its own does nothing with dropped indexes but record them: the check says so in each case. It warns when an entry is quarantined (it keeps its rows and is listed with what contradicts it), when the server's background pass over dropped indexes is failing (with the error), and when a dropped index has not been matched to the tables that hold its rows for a quarter of an hour, and reports every one of these that holds. When none waits, that says only that the server holds no entry, not that storage has come back. |
| `queries.missing_indexes` | Recent queries filtered without the secondary index the planner recommends. The fix is the `helix query` command that creates each index. |
| `queries.unbounded_scans` | Recent queries read every element of a label that no index would bound. |

The server also offers `indexes.label_bitmaps`, which reads every node and edge row once to check
that each is in its label's bitmap, the set label scans and index builds read. It reads stored
data, so `helix doctor` does not run it; request
[`GET /v2/diagnostics?audit=labels`](https://docs.helix-db.com/database/helix-db/query-guides/http-api) to run it.

The query checks cover queries from the last 24 hours since the server started. A missing index
stops being reported once the index is active. Queries that only count matches are not analyzed
yet. Server checks need a server image with
`GET /v2/diagnostics`; an older server reports `server.diagnostics` as skipped. Helix Cloud manages
storage, caching, and regions, so a Cloud database reports `cloud.managed` as skipped.

## Behavior

* Prints `Helix doctor`, the target, and the server's uptime, then the checks grouped by area, and a
  summary such as `Setup works, with room to improve · 2 warnings · 9 passed`.
* Passing checks print one line; others also print their detail and fix.
* Exits `1` when any check fails, after printing the report. Warnings alone exit `0`.
* A local instance whose container is not running reports that, and skips the server checks.
* `--json` prints an object with `target`, `uptime_secs` (when the server reported its checks),
  `checks`, and `summary`. Each check has `id`, `category`, `status` (`pass`, `warn`, `fail`, or
  `skip`), `summary`, and, when present, `detail` and `fix`. The server's own report is
  [`GET /v2/diagnostics`](https://docs.helix-db.com/database/helix-db/query-guides/http-api).

## Examples

```bash theme={"languages":{"custom":["languages/helixql.json"]}}
# Check the default instance
helix doctor

# Check a self-hosted server
helix doctor --url http://10.0.1.5:8080

# Machine-readable report for an agent or CI
helix doctor --json
```

## Related

* [`helix status`](https://docs.helix-db.com/cli/command-reference/status) — show instance state.
* [`helix logs`](https://docs.helix-db.com/cli/command-reference/logs) — view server logs.
* [Secondary indexes](https://docs.helix-db.com/database/helix-db/query-guides/secondary-indexes.md) — create the indexes doctor recommends.


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