I received a few requests to share the approach for Configuring Jenkins Slave on Windows Machine.
So here I am with a new guide on how to Configure a Jenkins Slave on Windows Machine and Install it as a Windows Service.
1- Login to Jenkins and click on Manage Jenkins
2- To create a new Slave – Click on New Node
3- Name the node
4- Fill in all the required details.
Please refer to our master-slave configuration article to know all the details of parameters present on the node configuration page
5- Choose the appropriate Launch method
Below mentioned steps to configure and enable security are essential.
If you miss this, you might not be able to start/configure the Jenkins slave because, by default, Jenkins disabled the TCP Port for JNLP agents and due to this, Agent is not able to reach master.
6 – Again, click on Manage Jenkins
7- Then click on Configure Global Security
8- Find out the Enable Security option
9- And then change the
10- Once the new node is created, it will be in Offline mode
11- Now click on the Slave agent
12- You will see Agent is not able to reach the master Jenkins and the new jnlp jar can be downloaded from Jenkins
13- Open the Jenkins URL from Agent Windows Machine and navigate to the Slave Configuration page
Once done, click on Launch Button – You will see a new pop-up that confirms the Jenkins Master-Slave Connection.
Let’s now create and install this as a Windows service to avoid the hassle of going to URL and performing the same operation every time.
Once you create the service, it will always be up & running, and then you can manage it through Windows Services
14- Don’t close the pop-up; instead just click on File Menu – If it’s not visible, just maximise the pop-up window
15- Now, click on the Install as a service option
16- It will prompt you for the confirmation
17- Click on OK
18- Go to Windows Settings and then check the Windows Services
19- You can see the Jenkins Windows Slave is successfully configured and running (If not, then Start the Service)
20- Go back to your Jenkins Slave Page, and now you will see that Agent is Successfully Running and ready to build your project
That’s it. You have successfully configured the Jenkins Slave on Windows Machine and installed it as a Windows Service.