GitHub Webhook Integration with Localhost Jenkins

So you want to integrate your GitHub project repository with a localhost Jenkins build server so that automated builds could be triggered upon code commit. That's a cool way to get your workflow automated. At SocketXP, we understand the challenges involved in setting up a CI/CD pipeline, and that's why we have written this article exclusively for you.

This article will demonstrate how to integrate your GitHub project with your localhost Jenkins server, so that your team could enjoy the benefits of continuous integration and continuous development.

1. Install the GitHub plugin in Jenkins

To receive and handle webhook notifications from GitHub, you need to install the GitHub plugin to your localhost Jenkins server. Go to "Manage Jenkins" -> "Manage Plugins" as shown below.

Note: Recent versions of Jenkins come with the GitHub plugin pre-installed. So you may skip this step, if you have already installed the recommend plugins set during Jenkins installation.


Search the "GitHub" plugin in the available list of plugins and install the plugin, as shown below.


2. Jenkins GitHub Webhook URL

Jenkins GitHub webhook URL looks like this:


Let's say you access your Jenkins via the following Jenkins URL:

Add "/github-webhook/" to the Jenkins URL to create the Jenkins GitHub webhook, as shown below.


Make sure that the "/" is present at the end of the URL.

3. Add the Jenkins webhook to GitHub Project

Follow the instructions below to add the Jenkins webhook to your GitHub project.

  • Login to your GitHub account
  • Go to your GitHub Project repository
  • Click the "Settings" tab on the top
  • Choose "Webhooks" tab in the lefthand side navigation bar.
  • Add the Jenkins webhook in the "Payload URL" text box, as shown below.


Typically, Jenkins build servers are run in the office local network behind NAT and Firewall to prevent hackers and unwanted users from accessing them. As a result, GitHub also cannot access your Jenkins build server, by invoking the Jenkins webhook URL to notify about GitHub code commits.

Notice that the IP address you use to access your Jenkins server "" is a private IP address. This IP address is not reachable from the internet.

How to make GitHub talk to your Jenkins server running in a private network ?

Solution: SocketXP Webhook Relay

The solution to this problem is to use the SocketXP Webhook Relay feature to interconnect your private Jenkins server with the public GitHub repository.

SocketXP gets you a public URL for your private web services.

SocketXP Relays GitHub Webhook Notifications to Local Jenkins Server

Here are the steps you need to follow to install and configure SocketXP to relay the webhook notifications from GitHub to your Jenkins server.

1. Download and install SocketXP client

Download and install a simple and secure SocketXP client on any machine in your private network with reachability to your local Jenkins server. You can even install SocketXP client on the same server where your Jenkins runs.

Follow the instructions here to download and setup SocketXP client for your OS.

2. Relay webhooks using SocketXP

Next, configure SocketXP to relay webhook notifications from GitHub to your local Jenkins server.

You could use SocketXP to relay webhook notifications from any online service to your private network.

Use the below command to request SocketXP to relay GitHub webhook notifications to your private Jenkins. SocketXP will provide a public URL for your private webhook URL.

$ socketxp -relay

Public URL ->

SocketXP relays webhook notifications sent to the public URL ( to your private webhook URL (

Use the above public URL provided by SocketXP to register with GitHub webhook notification system as shown below.


Test and Verify Webhook Notifications:

Finally, commit a test code to your GitHub project and make sure that GitHub sends a webhook notification and gets a successful response message (200 OK) as shown below.


First, check if SocketXP Cloud Gateway has received the webhook notification. Go to to check the webhooks received. Click entries to expand to see the details of the webhook received.

Secondly, check if the SocketXP agent running along with your Jenkins server has received the webhook notification.

$ socketxp -relay

Public URL ->

Webhook received:
Accept: */*
Accept-Encoding: gzip
Content-Length: 9397
Content-Type: application/json
User-Agent: GitHub-Hookshot/f2f2346
X-Github-Delivery: 4aba8354-c279-11ea-980e-6cd6cfda12a3
X-Github-Event: push
X-Hub-Signature: sha1=14e1f0a3d368d9b5dadd7d41cd575af2f45065ce


Next, ensure that Jenkins server has received the webhook notification and processed the same as shown below.


Also check if a new build got triggered for your project in your Jenkins server.


Jenkins is a great tool to automate, build and implement a Continuous Integration (CI) system for development teams.

GitHub is a great online source code management (SCM) tool.

SocketXP is a secure, powerful and easy to use cloud-based SaaS service to integrate a privately run localhost Jenkins with GitHub.

You can build a powerful CI/CD system using these three toolsets.

Bonus: Get any SocketXP Tunnels Subscription Plans at 50% discount using the coupon code - WHSOCKETXP2020

Next Steps:

Push your built and unit-tested application to a local test server or a Kubernetes Cluster for further product tests or integration tests. You coud also push your app to a production server or Kubernetes Cluster in the Cloud. Learn more here:

Continuous Delivery - Autoupdate Kubernetes Deployment on GitHub Webhook