The self-hosted option is only available for CodeRabbit Enterprise customers with 500 user seats or more. Please contact CodeRabbit Sales to learn more about the CodeRabbit Enterprise plan.
Create a GitHub App
Set the following Repository permissions:- Checks: Read-only
- Contents: Read and write
- Commit statuses: Read and write
- Discussions: Read-only
- Issues: Read & write
- Metadata: Read-only
- Pull requests: Read & write
- Actions: Read-only
- Members: Read-only
- Meta
- Issue comment
- Issues
- Label
- Public
- Pull request
- Pull request review
- Pull request review comment
- Pull request review thread
- Push
- Release
Gather information from the GitHub App
- App ID
- Client ID
- Client Secret
- Webhook Secret
Prepare an .env
file
.env
- If you are using Azure OpenAI, verify that the model deployment names are in the .env file.
- Values marked with [] are optional to provide.
- For
GITHUB_APP_PEM_FILE
, flatten the PEM file by replacing newlines with\n
. - For
GITHUB_HOSTNAME
, use GitHub Enterprise server’s hostname, for example, “github.acme-inc.com” - You can generate
CODERABBIT_API_KEY
from CodeRabbit UI -> Organizations Settings -> API Keys. - When
ENABLE_LEARNINGS
is set totrue
, CodeRabbit will useCODERABBIT_API_KEY
to store learnings on our servers. YAML_CONFIG
is an optional configuration file that can be used to customize CodeRabbit’s behavior at the deployment level. It takes the same format as the CodeRabbit YAML configuration file. It requires the entire YAML file to be in an escaped string format, for example,YAML_CONFIG="key1: value1\nkey2: value2"
. You can use Escape YAML to generate the escaped string.
Pull the CodeRabbit Docker image
Using the credentials file shared with you, first authenticate and then pull the image.Host the image
You can choose to host it on a server, serverless function, or a container environment and expose the port “8080”. Run the Docker image with the equivalent of the following command on the platform of your choice, replacing the “.env” file with the path to your “.env” file:Verify the image is up
You can query/health
endpoint to verify that the coderabbit-agent
service is up and running.
Install the GitHub App
You can install the GitHub App on your GitHub organization or user account and point the Webhook URL to the hosted CodeRabbit instance, for example,http://127.0.0.1:8080/github_webhooks
. GitHub will send events to the CodeRabbit instance.