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

# Configuration on self-hosted CodeRabbit

> See which configuration layers apply on self-hosted CodeRabbit, set an instance-wide base with YAML_CONFIG, and learn what isn't available.

Self-hosted CodeRabbit has a shorter configuration chain than CodeRabbit Cloud. There are no web interface layers, and an environment variable supplies an instance-wide base. This page lists the chain, shows how to set that variable, and names what isn't available.

## Two meanings of self-hosted

The word covers two different setups. Configuration works differently in each.

| Setup | What it is | Configuration |
| - | - | - |
| **Self-hosted CodeRabbit** | CodeRabbit runs in your environment, set up with the CodeRabbit team. Intended for Enterprise customers with 500 or more seats. | The chain on this page |
| **Self-hosted Git provider on CodeRabbit Cloud** | GitHub Enterprise Server, self-managed GitLab or another self-hosted provider connected to CodeRabbit Cloud | The full CodeRabbit Cloud chain, with workspace settings when the organization is linked |

If you connect GitHub Enterprise Server or self-managed GitLab to CodeRabbit Cloud, skip to [Central configuration](https://docs.coderabbit.ai/configuration/central.md) and [Workspace settings](https://docs.coderabbit.ai/configuration/workspace.md). This page doesn't apply to you.

## The priority order on self-hosted CodeRabbit

From highest to lowest priority:

| Priority | Layer | Label in `@coderabbitai configuration` |
| - | - | - |
| 1 | Repository YAML (`.coderabbit.yaml`, or `.coderabbit.config.ts` when no YAML file exists) | `Repository YAML` |
| 2 | Central YAML, from the `coderabbit` repository | `Central YAML` |
| 3 | Environment YAML, from `YAML_CONFIG` | `Environment YAML` |
| 4 | Schema defaults | `defaults` |

CodeRabbit uses the first layer that exists as the starting layer. Other layers join only through `inheritance: true`. In that case the parents merge in the order central, then environment YAML, then defaults. See [Inheritance and merging](https://docs.coderabbit.ai/configuration/inheritance-and-merging.md).

CodeRabbit never reads **Repository settings**, **Organization defaults** or workspace settings on self-hosted CodeRabbit. It skips workspace global overrides and workspace defaults.

## Set an instance-wide base with YAML\_CONFIG

`YAML_CONFIG` is an environment variable that holds configuration YAML as one string. It sets the base for every repository that doesn't get its own settings from a repository file or the central repository. Set it with the other environment variables of your CodeRabbit deployment.

```bash theme={null}
export YAML_CONFIG='language: "en-US"\nreviews:\n  profile: "chill"\n  auto_review:\n    enabled: true'
```

* **Escapes.** Write line breaks as the literal characters `\n`. CodeRabbit also expands `\r` and `\t`.
* **Parsed like a repository file.** It supports `inheritance`. It doesn't support `remote_config`.
* **Errors.** A parse failure is logged and ignored, so the layer is skipped.
* **Check it.** Values from the variable show `# Source: Environment YAML` in the reply to `@coderabbitai configuration`.

## Turn off repository or central files

Self-hosted CodeRabbit has no global overrides. To make `YAML_CONFIG` the configuration of every repository instead of a fallback, turn off the files that outrank it with two environment variables:

| Variable | Effect while set to `true` |
| - | - |
| `DISABLE_REPO_CONFIG` | CodeRabbit ignores configuration files in the reviewed repository. |
| `DISABLE_CENTRAL_CONFIG` | CodeRabbit ignores the `coderabbit` repository, both as the starting layer and as a parent during inheritance. |

Both default to `false`. With both set, every review starts from `YAML_CONFIG`, or from schema defaults when it isn't set.

## Configuration source

Self-hosted CodeRabbit always reads the repository file with **Auto**. Auto reads the pull request branch for trusted pull requests, and the base commit for fork pull requests and other authors. See [Choose the configuration branch](https://docs.coderabbit.ai/configuration/branch.md).

## What self-hosted CodeRabbit doesn't support

| Feature | Self-hosted CodeRabbit | Self-hosted Git provider on CodeRabbit Cloud |
| - | - | - |
| **Repository settings** and **Organization defaults** | No | Yes |
| Workspace settings | No | Yes, when the organization is linked |
| **Use workspace settings as defaults** | No | No. SSO workspaces on CodeRabbit Cloud only. |
| **Configuration source** choices (**Default branch**, **Custom**) | No. Auto only. | No. GitHub Cloud only. |
| Configuration directory (`.coderabbit/`) | No | No. GitHub Cloud only. |
| Schema V3 | No | No. Limited preview. |
| The configuration API | No | Yes |
| Organization global overrides | No | Yes |

## What's next

> [card] [Resolution order](https://docs.coderabbit.ai/configuration/resolution.md)
>
> Compare the CodeRabbit Cloud chain with this one.

> [card] [Central configuration](https://docs.coderabbit.ai/configuration/central.md)
>
> Share a file across repositories.

> [card] [Configuration in CLI and IDE reviews](https://docs.coderabbit.ai/configuration/local-reviews.md)
>
> See how local reviews pick up configuration.


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