Triggering Jenkins builds automatically after every code commit is a core requirement in any continuous integration setup. Jenkins supports automated triggers through repository polling or event based notifications. While polling works, it consumes resources and introduces delays. Push based triggering through webhooks is far more efficient.
The difficulty appears when Jenkins is hosted inside a private network and the version control system is hosted on a cloud platform such as GitLab. In this scenario, GitLab cannot directly reach the Jenkins endpoint, making webhook based triggering difficult without exposing Jenkins publicly.
Webhook Relay solves this problem by acting as a secure bridge between GitLab and a privately hosted Jenkins server. This article explains how GitLab webhooks can trigger Jenkins jobs using Webhook Relay, based on real implementation experience.

Installing the Webhook Relay Agent
The Webhook Relay agent needs to run on the same machine where Jenkins is hosted or where Jenkins is reachable internally.
Below is the installation process shown as step based instructions.
Webhook Relay service runs on a public endpoint, while this agent runs locally and listens for forwarded webhook events.
Creating a Webhook Relay Account
Create an account on the official Webhook Relay platform using the registration page shown below.
After signing up, access to the Webhook Relay dashboard is provided, where authentication tokens can be generated.
Authenticating the Relay Agent
From the dashboard, create an access token. This generates a key and secret pair.
Use those credentials to authenticate the relay agent.
A successful login message confirms that the agent is connected and ready.
Creating the GitLab Repository
Create a GitLab repository for testing webhook integration. To keep the setup simple, a public repository can be used.
For reference, assume the repository name is WebhookProject.
Preparing Jenkins for GitLab Webhooks
Install the required Jenkins plugins from the plugin manager.
Navigate through the Jenkins dashboard to install
GitLab Plugin
GitLab Hook Plugin
Once installed, Jenkins becomes capable of receiving GitLab webhook events.
Creating the Jenkins Job
Create a new Jenkins job and configure it to pull source code from the GitLab repository.
Enable the option that allows Jenkins to be triggered by GitLab webhooks.
After enabling this option, Jenkins generates a webhook endpoint associated with the job. It usually follows this pattern.
Example shown for reference only.
Copy this endpoint, as it will be used in the forwarding configuration.
Forwarding Webhooks Using Webhook Relay
Start webhook forwarding by creating a relay bucket. This bucket acts as a routing channel between GitLab and Jenkins.
Important note
Do not stop this process. Keep it running in the background.
Open a new terminal tab for further steps.
Once this command starts, the relay agent generates a public forwarding URL.
Configuring GitLab Webhook
Open the GitLab repository settings and navigate to the integrations or webhook section.
Paste the forwarding URL generated by Webhook Relay into the webhook URL field.
For initial testing, SSL verification can be disabled to avoid certificate related issues.
Save the webhook configuration.
Testing the Integration
Clone the GitLab repository locally and push a new commit.
As soon as the push is completed, GitLab sends a webhook event. Webhook Relay receives it and forwards it to the local agent, which triggers the Jenkins job internally.
You can verify this by checking the Jenkins job build history.
Viewing Logs
GitLab webhook logs can be viewed from
Repository settings
Integrations
Webhook edit section
Webhook Relay logs are available in the Relay Logs section of the Webhook Relay dashboard.
Jenkins build logs confirm successful job execution.
Conclusion
Webhook Relay makes it possible to trigger Jenkins builds through GitLab webhooks even when Jenkins is hosted inside a private network. This approach avoids exposing Jenkins publicly while still enabling real time CI automation.
The same pattern works for GitHub and other webhook enabled platforms. With proper configuration, secure and efficient CI workflows can be achieved in restricted network environments.



