Trigger a Jenkins Job From Remote System

  • Tapas Mahato
  • 0
  • 2017-05-25

Setup Jenkins:

  1. First we have to setup your Jenkins server. To do that start your jenkins server & login to your Jenkins from Web Interface, and then setup your Jenkins Global Tool Configuration.
    Click on Jenkins (under header) > Manage Jenkins .
    Now go to Manage Jenkins Page and click on “Configure Global Security”. Here Uncheck “Prevent Cross Site Request Forgery exploits” option (If you have crumb issuer then no need to uncheck it) and click on “Save” button.


  2. Now again from Manage Jenkins page click on “Manage Plugins” option -


    You will redirect to the ‘Plugin Manager’ page. Click on ‘Installed’ tab and search with ‘Authentication Tokens API Plugin’. Check “Authentication Tokens API Plugin” plugin is installed to your jenkins server or not.


    If plugin isn't intalled to your jenkins server then click on 'Available' tab and install it and restart your jenkins server.


  3. Now go to your respective jenkins job configuration page and scroll to “Build Triggers” section. In this section check 'Trigger builds remotely (e.g., from scripts)' option. Enter your Authenication Token if you have otherwise leave it as it is.

    Now save your job configuration by clicking on 'Save' button.

Trigger Jenkins Job From Remote System :

  1. Leave your jenkins server running and switch to another system. Make sure both the systems are in same network. Check you can access jenkins server from remote machine by entering jenkins server url with port number.

    In my case I have jenkins server running at url –
  2. Download bellow jar file and save it in your system. (currently in this jar jenkins server is fixed at 8080 port number, we will enhance our jar and put flexibility to enter port number from user.)

    Download JAR

  3. Now open command prompt and navigate to your jar file location where you have save it earlier.

    Run your jar file by typing following command:
    java -jar trigger-jenkins-job.jar

  4. Enter required details asked at runtime i.e username, password, jenkins server_url etc (Make sure repective user should have permission to trigger respective job) and that's it, You can check in your jenkins server respective jenkins job has been triggered.


Follow Teknotrait Solutions on

Comments (0)

Recommended Read