


How to Set Up CI/CD Using Jenkins with GitHub Integration
By:
Vanshika Doshi
14 Jul 2025
In modern backend development, automation is a must. You want every code change to be tested, built, and deployed — without manual steps that slow you down or cause mistakes. This is the promise of CI/CD (Continuous Integration / Continuous Deployment).
In this post, you’ll learn how to:
Install Jenkins on Windows
Connect Jenkins with GitHub
Set up a pipeline (Jenkinsfile)
Deploy your backend automatically
What is CI/CD (and Why Jenkins)?

Continuous Integration (CI): Automatically build and test your code when you push changes
Continuous Deployment (CD): Automatically deploy after tests pass
Why Jenkins?
Open-source and proven
Works with any language or tool
Huge plugin ecosystem
You control where it runs, including your Windows machine
How to Set Up Jenkins on Windows

Download and install Jenkins
Download the Windows installer (.msi)
Run the installer - follow the wizard (accept defaults is fine for most)

Access Jenkins UI
Open browser: http://localhost:8080
Unlock Jenkins: find the password at (C:\Program Files\Jenkins\secrets\initialAdminPassword)
Paste it into the web UI

Install recommended plugins
Pipeline: Enables defining CI/CD as code via
Jenkinsfile
. Core for modern CI/CD.Git plugin: Allows Jenkins to pull from your GitHub repository.
GitHub plugin: Provides GitHub integration (webhooks, commit status reporting, PR builds).
SSH Agent: Lets Jenkins handle SSH keys securely, needed for GitHub access or server deployment.
Credentials Binding: Helps securely inject API tokens, SSH keys, passwords into your builds.
NodeJS plugin (if using Node.js): Manage Node.js versions for build/test steps.
PowerShell plugin: Run PowerShell commands/scripts directly in your pipeline (essential for Windows).
Publish Over SSH (optional): Transfer files / execute commands on remote servers over SSH.
AnsiColor plugin: Makes console logs more readable by adding color support.
Email Extension plugin (optional): Send detailed build status notifications.
Timestamper plugin (optional): Adds timestamps to console output, helpful for debugging long builds.
You can always add plugins later via Manage Jenkins > Manage Plugins > Available tab

Create admin user
Navigate to the Manage Jenkins page from the Jenkins dashboard.
Select Users under the Security section.
Select create user and fill the details.

Connect Jenkins to GitHub
Generate SSH key on Windows (for Jenkins)
Use Git Bash or PowerShell: ssh-keygen -t rsa -b 4096 -C jenkins@yourdomain.com
You'll be prompted to enter a file in which to save the key. You can accept the default or specify a different location.
You can optionally set a passphrase for added security, but this is not required.
This will generate two files: id_rsa (private key) and id_rsa.pub (public key).
Add the public key to GitHub deploy keys
GitHub > Your repo > Settings > Deploy keys > Add deploy key
Name it
Jenkins
Paste the content of
id_rsa.pub
Allow write access (if Jenkins will push)
Add private key in Jenkins credentials
Jenkins > Manage Jenkins > Credentials > Global > Add Credentials
Kind: SSHUsername with private key
Username:
git
Private key: paste or load from file
Set up GitHub webhook for automatic builds
GitHub > Your repo > Settings > Webhooks > Add webhook
Payload URL: http://YOUR-PC-IP:8080/github-webhook/
Content type:
application/json
Event: Push events
In Jenkins pipeline job > Build Triggers > GitHub hook trigger for GITScm polling

Create Jenkins Pipeline Job
Jenkins dashboard > New Item > Pipeline
Pipeline script from SCM > Git
Repository: git@github.com:YOUR-USERNAME/YOUR-REPO.git
Credentials: select your SSH credential you added earlier
Branch:
*/main
(or your branch)
Example Jenkinsfile
pipeline { agent any stages { stage('Checkout') { steps { git branch: 'main', url: 'git@github.com:YOUR-USERNAME/YOUR-REPO.git' } } stage('Install Dependencies') { steps { bat 'npm ci' } } stage('Run Tests') { steps { bat 'npm test' } } stage('Deploy') { when { branch 'main' } steps { bat 'echo Deploy step: Copy files to server or trigger deployment script' } } } post { success { echo 'Pipeline succeeded.' } failure { echo 'Pipeline failed.' } } }
Deployment on Windows
Copy files to another server using xcopy, robocopy, or WinSCP
Use PowerShell scripts for remote deploy
Use Docker if installed
Reference Links
Jenkins official site: https://www.jenkins.io/
Jenkins Windows install guide: https://www.jenkins.io/doc/book/installing/windows/
Jenkins pipeline syntax: https://www.jenkins.io/doc/book/pipeline/syntax/
Jenkins credentials: https://www.jenkins.io/doc/book/using/using-credentials/
GitHub deploy keys: https://docs.github.com/en/developers/overview/managing-deploy-keys
GitHub webhooks: https://docs.github.com/en/webhooks
Final Thoughts
By setting up Jenkins on Windows and connecting it with GitHub:
Your backend builds and tests automatically on every push
You reduce manual deployment work
You’re ready to add more automation (Docker, Kubernetes, cloud deploys)
Frequently Asked Questions
1. What is Jenkins used for in CI/CD?
A. Jenkins is an open-source automation tool used in CI/CD pipelines to build, test, and deploy code automatically whenever changes are pushed to the repository. It helps developers deliver faster and with fewer errors.
2. How do I install Jenkins on Windows?
A. To install Jenkins on Windows, download the .msi
installer from jenkins.io, run the setup wizard, unlock Jenkins using the initial admin password, and install the recommended plugins.
3. How do I connect Jenkins to GitHub?
A. You can connect Jenkins to GitHub by adding an SSH deploy key to your GitHub repo, saving the private key in Jenkins credentials, and configuring a webhook in GitHub to trigger Jenkins builds on push events.
In modern backend development, automation is a must. You want every code change to be tested, built, and deployed — without manual steps that slow you down or cause mistakes. This is the promise of CI/CD (Continuous Integration / Continuous Deployment).
In this post, you’ll learn how to:
Install Jenkins on Windows
Connect Jenkins with GitHub
Set up a pipeline (Jenkinsfile)
Deploy your backend automatically
What is CI/CD (and Why Jenkins)?

Continuous Integration (CI): Automatically build and test your code when you push changes
Continuous Deployment (CD): Automatically deploy after tests pass
Why Jenkins?
Open-source and proven
Works with any language or tool
Huge plugin ecosystem
You control where it runs, including your Windows machine
How to Set Up Jenkins on Windows

Download and install Jenkins
Download the Windows installer (.msi)
Run the installer - follow the wizard (accept defaults is fine for most)

Access Jenkins UI
Open browser: http://localhost:8080
Unlock Jenkins: find the password at (C:\Program Files\Jenkins\secrets\initialAdminPassword)
Paste it into the web UI

Install recommended plugins
Pipeline: Enables defining CI/CD as code via
Jenkinsfile
. Core for modern CI/CD.Git plugin: Allows Jenkins to pull from your GitHub repository.
GitHub plugin: Provides GitHub integration (webhooks, commit status reporting, PR builds).
SSH Agent: Lets Jenkins handle SSH keys securely, needed for GitHub access or server deployment.
Credentials Binding: Helps securely inject API tokens, SSH keys, passwords into your builds.
NodeJS plugin (if using Node.js): Manage Node.js versions for build/test steps.
PowerShell plugin: Run PowerShell commands/scripts directly in your pipeline (essential for Windows).
Publish Over SSH (optional): Transfer files / execute commands on remote servers over SSH.
AnsiColor plugin: Makes console logs more readable by adding color support.
Email Extension plugin (optional): Send detailed build status notifications.
Timestamper plugin (optional): Adds timestamps to console output, helpful for debugging long builds.
You can always add plugins later via Manage Jenkins > Manage Plugins > Available tab

Create admin user
Navigate to the Manage Jenkins page from the Jenkins dashboard.
Select Users under the Security section.
Select create user and fill the details.

Connect Jenkins to GitHub
Generate SSH key on Windows (for Jenkins)
Use Git Bash or PowerShell: ssh-keygen -t rsa -b 4096 -C jenkins@yourdomain.com
You'll be prompted to enter a file in which to save the key. You can accept the default or specify a different location.
You can optionally set a passphrase for added security, but this is not required.
This will generate two files: id_rsa (private key) and id_rsa.pub (public key).
Add the public key to GitHub deploy keys
GitHub > Your repo > Settings > Deploy keys > Add deploy key
Name it
Jenkins
Paste the content of
id_rsa.pub
Allow write access (if Jenkins will push)
Add private key in Jenkins credentials
Jenkins > Manage Jenkins > Credentials > Global > Add Credentials
Kind: SSHUsername with private key
Username:
git
Private key: paste or load from file
Set up GitHub webhook for automatic builds
GitHub > Your repo > Settings > Webhooks > Add webhook
Payload URL: http://YOUR-PC-IP:8080/github-webhook/
Content type:
application/json
Event: Push events
In Jenkins pipeline job > Build Triggers > GitHub hook trigger for GITScm polling

Create Jenkins Pipeline Job
Jenkins dashboard > New Item > Pipeline
Pipeline script from SCM > Git
Repository: git@github.com:YOUR-USERNAME/YOUR-REPO.git
Credentials: select your SSH credential you added earlier
Branch:
*/main
(or your branch)
Example Jenkinsfile
pipeline { agent any stages { stage('Checkout') { steps { git branch: 'main', url: 'git@github.com:YOUR-USERNAME/YOUR-REPO.git' } } stage('Install Dependencies') { steps { bat 'npm ci' } } stage('Run Tests') { steps { bat 'npm test' } } stage('Deploy') { when { branch 'main' } steps { bat 'echo Deploy step: Copy files to server or trigger deployment script' } } } post { success { echo 'Pipeline succeeded.' } failure { echo 'Pipeline failed.' } } }
Deployment on Windows
Copy files to another server using xcopy, robocopy, or WinSCP
Use PowerShell scripts for remote deploy
Use Docker if installed
Reference Links
Jenkins official site: https://www.jenkins.io/
Jenkins Windows install guide: https://www.jenkins.io/doc/book/installing/windows/
Jenkins pipeline syntax: https://www.jenkins.io/doc/book/pipeline/syntax/
Jenkins credentials: https://www.jenkins.io/doc/book/using/using-credentials/
GitHub deploy keys: https://docs.github.com/en/developers/overview/managing-deploy-keys
GitHub webhooks: https://docs.github.com/en/webhooks
Final Thoughts
By setting up Jenkins on Windows and connecting it with GitHub:
Your backend builds and tests automatically on every push
You reduce manual deployment work
You’re ready to add more automation (Docker, Kubernetes, cloud deploys)
Frequently Asked Questions
1. What is Jenkins used for in CI/CD?
A. Jenkins is an open-source automation tool used in CI/CD pipelines to build, test, and deploy code automatically whenever changes are pushed to the repository. It helps developers deliver faster and with fewer errors.
2. How do I install Jenkins on Windows?
A. To install Jenkins on Windows, download the .msi
installer from jenkins.io, run the setup wizard, unlock Jenkins using the initial admin password, and install the recommended plugins.
3. How do I connect Jenkins to GitHub?
A. You can connect Jenkins to GitHub by adding an SSH deploy key to your GitHub repo, saving the private key in Jenkins credentials, and configuring a webhook in GitHub to trigger Jenkins builds on push events.
In modern backend development, automation is a must. You want every code change to be tested, built, and deployed — without manual steps that slow you down or cause mistakes. This is the promise of CI/CD (Continuous Integration / Continuous Deployment).
In this post, you’ll learn how to:
Install Jenkins on Windows
Connect Jenkins with GitHub
Set up a pipeline (Jenkinsfile)
Deploy your backend automatically
What is CI/CD (and Why Jenkins)?

Continuous Integration (CI): Automatically build and test your code when you push changes
Continuous Deployment (CD): Automatically deploy after tests pass
Why Jenkins?
Open-source and proven
Works with any language or tool
Huge plugin ecosystem
You control where it runs, including your Windows machine
How to Set Up Jenkins on Windows

Download and install Jenkins
Download the Windows installer (.msi)
Run the installer - follow the wizard (accept defaults is fine for most)

Access Jenkins UI
Open browser: http://localhost:8080
Unlock Jenkins: find the password at (C:\Program Files\Jenkins\secrets\initialAdminPassword)
Paste it into the web UI

Install recommended plugins
Pipeline: Enables defining CI/CD as code via
Jenkinsfile
. Core for modern CI/CD.Git plugin: Allows Jenkins to pull from your GitHub repository.
GitHub plugin: Provides GitHub integration (webhooks, commit status reporting, PR builds).
SSH Agent: Lets Jenkins handle SSH keys securely, needed for GitHub access or server deployment.
Credentials Binding: Helps securely inject API tokens, SSH keys, passwords into your builds.
NodeJS plugin (if using Node.js): Manage Node.js versions for build/test steps.
PowerShell plugin: Run PowerShell commands/scripts directly in your pipeline (essential for Windows).
Publish Over SSH (optional): Transfer files / execute commands on remote servers over SSH.
AnsiColor plugin: Makes console logs more readable by adding color support.
Email Extension plugin (optional): Send detailed build status notifications.
Timestamper plugin (optional): Adds timestamps to console output, helpful for debugging long builds.
You can always add plugins later via Manage Jenkins > Manage Plugins > Available tab

Create admin user
Navigate to the Manage Jenkins page from the Jenkins dashboard.
Select Users under the Security section.
Select create user and fill the details.

Connect Jenkins to GitHub
Generate SSH key on Windows (for Jenkins)
Use Git Bash or PowerShell: ssh-keygen -t rsa -b 4096 -C jenkins@yourdomain.com
You'll be prompted to enter a file in which to save the key. You can accept the default or specify a different location.
You can optionally set a passphrase for added security, but this is not required.
This will generate two files: id_rsa (private key) and id_rsa.pub (public key).
Add the public key to GitHub deploy keys
GitHub > Your repo > Settings > Deploy keys > Add deploy key
Name it
Jenkins
Paste the content of
id_rsa.pub
Allow write access (if Jenkins will push)
Add private key in Jenkins credentials
Jenkins > Manage Jenkins > Credentials > Global > Add Credentials
Kind: SSHUsername with private key
Username:
git
Private key: paste or load from file
Set up GitHub webhook for automatic builds
GitHub > Your repo > Settings > Webhooks > Add webhook
Payload URL: http://YOUR-PC-IP:8080/github-webhook/
Content type:
application/json
Event: Push events
In Jenkins pipeline job > Build Triggers > GitHub hook trigger for GITScm polling

Create Jenkins Pipeline Job
Jenkins dashboard > New Item > Pipeline
Pipeline script from SCM > Git
Repository: git@github.com:YOUR-USERNAME/YOUR-REPO.git
Credentials: select your SSH credential you added earlier
Branch:
*/main
(or your branch)
Example Jenkinsfile
pipeline { agent any stages { stage('Checkout') { steps { git branch: 'main', url: 'git@github.com:YOUR-USERNAME/YOUR-REPO.git' } } stage('Install Dependencies') { steps { bat 'npm ci' } } stage('Run Tests') { steps { bat 'npm test' } } stage('Deploy') { when { branch 'main' } steps { bat 'echo Deploy step: Copy files to server or trigger deployment script' } } } post { success { echo 'Pipeline succeeded.' } failure { echo 'Pipeline failed.' } } }
Deployment on Windows
Copy files to another server using xcopy, robocopy, or WinSCP
Use PowerShell scripts for remote deploy
Use Docker if installed
Reference Links
Jenkins official site: https://www.jenkins.io/
Jenkins Windows install guide: https://www.jenkins.io/doc/book/installing/windows/
Jenkins pipeline syntax: https://www.jenkins.io/doc/book/pipeline/syntax/
Jenkins credentials: https://www.jenkins.io/doc/book/using/using-credentials/
GitHub deploy keys: https://docs.github.com/en/developers/overview/managing-deploy-keys
GitHub webhooks: https://docs.github.com/en/webhooks
Final Thoughts
By setting up Jenkins on Windows and connecting it with GitHub:
Your backend builds and tests automatically on every push
You reduce manual deployment work
You’re ready to add more automation (Docker, Kubernetes, cloud deploys)
Frequently Asked Questions
1. What is Jenkins used for in CI/CD?
A. Jenkins is an open-source automation tool used in CI/CD pipelines to build, test, and deploy code automatically whenever changes are pushed to the repository. It helps developers deliver faster and with fewer errors.
2. How do I install Jenkins on Windows?
A. To install Jenkins on Windows, download the .msi
installer from jenkins.io, run the setup wizard, unlock Jenkins using the initial admin password, and install the recommended plugins.
3. How do I connect Jenkins to GitHub?
A. You can connect Jenkins to GitHub by adding an SSH deploy key to your GitHub repo, saving the private key in Jenkins credentials, and configuring a webhook in GitHub to trigger Jenkins builds on push events.
Explore our services
Explore other blogs
Explore other blogs

let's get in touch
Have a Project idea?
Connect with us for a free consultation !
Confidentiality with NDA
Understanding the core business.
Brainstorm with our leaders
Daily & Weekly Updates
Super competitive pricing

let's get in touch
Have a Project idea?
Connect with us for a free consultation !
Confidentiality with NDA
Understanding the core business.
Brainstorm with our leaders
Daily & Weekly Updates
Super competitive pricing
DEFINITELY POSSIBLE
Our Services
Technologies
Crafted & maintained with ❤️ by our Smartees | Copyright © 2025 - Smartters Softwares PVT. LTD.
Our Services
Technologies
Created with ❤️ by our Smartees
Copyright © 2025 - Smartters Softwares PVT. LTD.