# GitHub

> Part of the NocoDB documentation (Product docs > Sync > App Sync > On Premise Auth Integration). Index of all pages: https://nocodb.com/llms.txt. Any docs page is available as Markdown by adding `.md` to its URL.

URL: https://nocodb.com/docs/product/sync/app-sync/on-premise-oauth/github
Last updated: 2026-10-03

Set up the GitHub OAuth2 or GitHub App authentication integration for a self-hosted NocoDB instance.

This document tells you how to set up the GitHub authentication integration for NocoDB.

## Environment Variables

To enable OAuth2 authentication with GitHub, set up these environment variables:

### Step 1: Create a GitHub OAuth App

1. Log in to your GitHub account.
2. Go to Settings > Developer settings > OAuth Apps.
3. Click "New OAuth App".
4. Fill in the form:

| Field                          | Value                                                                                                   |
| ------------------------------ | ------------------------------------------------------------------------------------------------------- |
| **Application name**           | Your application name (for example, "NocoDB")                                                           |
| **Homepage URL**               | The homepage URL of your application                                                                    |
| **Application description**    | (Optional) A short description of your app                                                              |
| **Authorization callback URL** | The URL where GitHub sends users after authorization (for example, `https://your-nocodb-instance.com/`) |
| **Icon**                       | (Optional) Upload an icon for your application                                                          |

5. Click "Register application".

### Step 2: Get Client ID and Client Secret

After you register your OAuth App, GitHub gives you:

* Client ID
* Client Secret (to create one, click "Generate a new client secret")

### Step 3: Set Environment Variables

Configure your NocoDB instance with these environment variables:

```
INTEGRATION_AUTH_GITHUB_CLIENT_ID=your_github_client_id
INTEGRATION_AUTH_GITHUB_CLIENT_SECRET=your_github_client_secret
INTEGRATION_AUTH_GITHUB_REDIRECT_URI=your_redirect_uri
```

Where:

* `your_github_client_id`: The Client ID from your GitHub OAuth App
* `your_github_client_secret`: The Client Secret from your GitHub OAuth App
* `your_redirect_uri`: The callback URL that you specified when you created the OAuth App (for example, `https://your-nocodb-instance.com/api/v1/integrations/auth/github/callback`)

## OAuth Scopes

The GitHub integration requests these GitHub scopes:

* `read:user`: Read-only access to user profile data
* `repo`: Full control of repositories

## GitHub App Installation

A deployment can register a GitHub App as an alternative to an OAuth App. Users do not authorize an OAuth App. They install the GitHub App on the organization or account that has the repositories to connect.

NocoDB stores only the installation identifier. Each time NocoDB calls GitHub, it makes a short-lived installation token from the private key of the App.

### Step 1: Create a GitHub App

1. Go to Settings > Developer settings > GitHub Apps.
2. Click "New GitHub App".
3. Set the callback URL to the same value that you use for `INTEGRATION_AUTH_GITHUB_REDIRECT_URI`.
4. Give the App the repository permissions that your integrations need.
5. Click "Create GitHub App".
6. Click "Generate a private key". GitHub downloads the key in PEM format.

### Step 2: Set Environment Variables

```
INTEGRATION_AUTH_GITHUB_APP_ID=your_github_app_id
INTEGRATION_AUTH_GITHUB_APP_SLUG=your_github_app_slug
INTEGRATION_AUTH_GITHUB_APP_PRIVATE_KEY=your_github_app_private_key
```

Where:

* `your_github_app_id`: The App ID on the settings page of the App
* `your_github_app_slug`: The URL slug of the App, that is the last segment of `https://github.com/apps/<slug>`
* `your_github_app_private_key`: The contents of the PEM private key. You can escape newlines as `\n`

You must set all three variables and `INTEGRATION_AUTH_GITHUB_REDIRECT_URI`. Then the GitHub connection form shows **GitHub App** next to the existing authentication types.

When the user selects **GitHub App**, `https://github.com/apps/<slug>/installations/new` opens. There, the user selects the repositories to give access to. When you test the connection, it lists the repositories that the installation can access.

## Availability

* App Sync is available on **NocoDB Cloud** (Plus plan and above) and licensed self-hosted deployments (Business plan and above). This page covers OAuth app setup for **self-hosted** deployments. On NocoDB Cloud, these OAuth apps are preconfigured.

---

## Related pages

- [Bitbucket](https://nocodb.com/docs/product/sync/app-sync/on-premise-oauth/bitbucket.md): Set up the Bitbucket OAuth2 authentication integration for a self-hosted NocoDB instance.
- [GitLab](https://nocodb.com/docs/product/sync/app-sync/on-premise-oauth/gitlab.md): Set up the GitLab OAuth2 authentication integration for a self-hosted NocoDB instance.
- [Google Calendar](https://nocodb.com/docs/product/sync/app-sync/on-premise-oauth/google-calendar.md): Set up the Google Calendar OAuth2 authentication integration for a self-hosted NocoDB instance.
- [Linear](https://nocodb.com/docs/product/sync/app-sync/on-premise-oauth/linear.md): Set up the Linear OAuth2 authentication integration for a self-hosted NocoDB instance.
- [Outlook Calendar](https://nocodb.com/docs/product/sync/app-sync/on-premise-oauth/outlook-calendar.md): Set up the Outlook Calendar OAuth2 authentication integration for a self-hosted NocoDB instance.
