Jenkins CI Apps Setup¶
Two separate Jenkins CI Apps are required. They serve different purposes and must be created independently.
| App type | Purpose | Used by |
|---|---|---|
| Jenkins CI App | Jenkins reads repos, posts build status, auto-manages webhooks | Jenkins CI pipeline |
| Jenkins Login App | Jenkins login via GitHub account | Humans logging into Jenkins UI |
Part 1 — Jenkins CI App (CI/CD)¶
Create the app¶
- Go to GitHub → Settings → Developer settings → Jenkins CI Apps → New Jenkins CI App
- Fill in:
- Name:
<your-github-username>-jenkins(or any unique name) - Homepage URL: your
JENKINS_URL(e.g.https://jenkins.yourdomain.com) - Webhook URL:
https://jenkins.yourdomain.com/github-webhook/ -
Webhook secret: generate a strong random string (
openssl rand -hex 32) and enter it here — Jenkins uses it to verify webhook signatures. Add the same value to.envasGITHUB_WEBHOOK_SECRET. -
Set Repository permissions:
| Permission | Access |
|---|---|
| Contents | Read |
| Metadata | Read (mandatory) |
| Pull requests | Read |
| Commit statuses | Read & Write |
| Checks | Read & Write |
| Webhooks | Read & Write |
- Set Subscribe to events:
- Push
-
Pull request
-
Where can this app be installed: Only on this account
-
Click Create Jenkins CI App
Get the App ID¶
Note the App ID shown at the top of the app settings page. Add it to .env:
Generate the private key¶
Scroll to the bottom of the app settings page → Generate a private key
A .pem file downloads automatically. Copy it to the repo root:
github-app.pem is gitignored. Never commit it.
Install the app¶
- In the app settings, click Install App
- Select your account (
<your-github-username>) - Choose All repositories — this covers every current and future repo automatically
Part 2 — Jenkins Login App (user login)¶
Create the app¶
- Go to GitHub → Settings → Developer settings → OAuth Apps → New OAuth App
- Fill in:
- Application name:
Jenkins CI Login - Homepage URL: your
JENKINS_URL -
Authorization callback URL:
https://jenkins.yourdomain.com/securityRealm/finishLogin -
Click Register application
Get credentials¶
On the next page:
- Note the Client ID — add to .env as GITHUB_OAUTH_CLIENT_ID
- Click Generate a new client secret — add to .env as GITHUB_OAUTH_CLIENT_SECRET
Summary — what goes where¶
| Value | Where to put it |
|---|---|
| Jenkins CI App — App ID | .env → GITHUB_APP_ID |
| Jenkins CI App — private key | github-app.pem in repo root |
| Jenkins CI App — webhook URL | Jenkins CI App settings field |
| Jenkins CI App — webhook secret | Jenkins CI App settings field + .env → GITHUB_WEBHOOK_SECRET |
| OAuth App — Client ID | .env → GITHUB_OAUTH_CLIENT_ID |
| OAuth App — Client Secret | .env → GITHUB_OAUTH_CLIENT_SECRET |
| OAuth App — callback URL | OAuth App settings field |
Updating the webhook URL¶
If your Cloudflare Tunnel URL changes, update it in two places: 1. Jenkins CI App settings → Webhook URL 2. Jenkins Login App settings → Authorization callback URL
Then update JENKINS_URL in .env and restart Jenkins.