Self-hosting
Create the GitHub App

Every Metis deployment runs as its own GitHub App. The app receives pull request webhooks, lets users sign in, and gives Metis scoped access to the repositories it is installed on.
Start a new app
Open github.com/settings/apps/new, or go to Settings → Developer settings → GitHub Apps → New GitHub App. To create the app under an organization, use that organization's settings instead.
Basic information
Field Value GitHub App name Any unique name, e.g. “Metis Reviewer (Acme)”. Reviews are posted under it. Homepage URL Your dashboard URL, e.g. http://localhost:5173Callback URL <FRONTEND_URL>/auth/callback, e.g.http://localhost:5173/auth/callbackExpire user authorization tokens Leave the default. Request user authorization (OAuth) during installation Leave unchecked. Webhook
Check Active. Set the Webhook URL to
https://<your-api-host>/webhooks/github. If you don't have a public URL yet, enter a placeholder and update it once your tunnel or server is up.Generate a random webhook secret and paste it into the Webhook secret field:
bashopenssl rand -hex 32Save the same value as
GITHUB_WEBHOOK_SECRET. Metis rejects any delivery whose HMAC-SHA256 signature doesn't match it.Repository permissions
Permission Access Used for Contents Read and write Cloning code into the sandbox; pushing branches for Issue → PR Pull requests Read and write Reading diffs, posting reviews and inline comments, updating titles and descriptions, opening PRs Issues Read-only Listing issues and loading their details for coding agents Metadata Read-only Mandatory for all GitHub Apps Leave every other permission at “No access”.
Subscribe to events
Check Pull request. Metis acts on the
opened,reopened, andsynchronizeactions. Other events are acknowledged and ignored.Choose where it can be installed
Only on this account is the right choice for a private deployment. Choose Any account only if other people or organizations will install your instance.
Click Create GitHub App.
Collect the credentials
On the app's settings page:
- Copy the App ID and the Client ID.
- Under Client secrets, click Generate a new client secret and copy it. It is shown only once.
- Under Private keys, click Generate a private key. A
.pemfile downloads.
Install the app
Click Install App in the sidebar, choose the account or organization, and select the repositories Metis may access. Installing the app doesn't start reviews by itself. You also need to enable each repository in the Metis dashboard.
Map the values to environment variables
| GitHub App value | Variable in backend/.env |
|---|---|
| App ID | GITHUB_APP_ID |
| Client ID | GITHUB_CLIENT_ID |
| Client secret | GITHUB_CLIENT_SECRET_ID |
| Webhook secret | GITHUB_WEBHOOK_SECRET |
| Private key file path | GITHUB_SECRET_KEY_PATH |
How Metis uses the app
- As the app: Metis signs a short-lived JWT with your private key and exchanges it for an installation token. It uses that token to read diffs, clone code, and post reviews.
- On behalf of a user: “Login with GitHub” uses the app's OAuth flow. Metis uses the resulting token to find the installations and repositories a user can access. The token is encrypted at rest with your
ENCRYPTION_KEY.
Next: fill in the rest of your environment in the configuration reference.