How to Install Several Windows Slaves as a Service?


You want to connect multiple Windows slaves, each installed as a service.



Java Web Start offers the possibility to connect multiple slaves on the same machine. In addition, it is possible to install a JNLP slave as a service in Windows. Thus, this article is aimed to explain how to install multiple Windows slaves as services.

Install Several Slaves

1) Create a slave to launch via Java Web Start


2) There are different ways to launch the slave agent:

  • The easiest way is to access Jenkins from the slave machine, go to the node page computer/<my-node>/ and click on the Launch button. This downloads the file slave-agent.jnlp and runs it.
    • Another way is to run the command java -jar slave.jar -jnlpUrl http://<my-server>/computer/<my-node>/slave-agent.jnlp -secret <my-secret> described at computer/<my-node>/
    • You can download slave-agent.jnlp from the client master, copy it to the slave machine and run javaws slave-agent.jnlp


3) Once the slave is launched, you should see a popup in Windows. To install this slave as a service, click on File/Install as a service.

4) The service appears in the services popup. (run services.msc to see windows services). You can double click on the service to show its name:


5) All slaves are installed with the same service display name in Windows: “Jenkins Slave”. In order to be able to install several slaves, the displayname needs to be modified. Run the following command as an administrator to change the display name of the service.

> $ sc config <service-name> displayname="jenkins-slave-1"

6) In order to delete an already existing slave

> $ sc delete <service-name>

7) For each slave you want to add and install as a service, reproduce steps 1 to 6.


Configure Slave User

Although it is recommended to run master/slaves with a single jenkins user, it is possible to run each slave as a different user. This can be configured in the slave service properties, in the logon tab. For example, the following slave is run with the user Administrator:


Further Information

Further documentation can be found on the wiki regarding Windows slave.

Have more questions?


  • 0
    Harsh Sarode

    awesome !! can you please help me about how to launch slave agent automatically via Launch method "Let Jenkins control this Windows slave as a Windows service" with using admin user i tried varied attempts for this but doesn't Jenkins server is Linux machine and slave node is Windows Server 2012 r2. i will be glad if i get solution.Thanks in advance.

  • 0
    Denys Digtiar

    Hi Harsh,

    This article is not related to the Launch method you are trying to use.

    Have you gone through the troubleshooting guide?

    If it didn't help you can request help on Users Mailing list or IRC. If you are a CloudBees customer feel free to raise a support ticket.

  • 0
    Radjammin Radjammin

    Step 2 , 3rd bullet. Creating a service is an administrator right.

    Edited by Radjammin Radjammin
Please sign in to leave a comment.