Start/Stop and Restart Jenkins service on Windows

396,386

Solution 1

Open Console/Command line --> Go to your Jenkins installation directory. Execute the following commands respectively:

to stop:
jenkins.exe stop

to start:
jenkins.exe start

to restart:
jenkins.exe restart

Solution 2

To stop Jenkins Please avoid shutting down the Java process or the Windows service. These are not usual commands. Use those only if your Jenkins is causing problems.

Use Jenkins' way to stop that protects from data loss.

http://[jenkins-server]/[command]

where [command] can be any one of the following

  • exit
  • restart
  • reload

Example: if my local PC is running Jenkins at port 8080, it will be

http://localhost:8080/exit

Solution 3

So by default you can open CMD and write

java -jar jenkins.war

But if your port 8080 is already is in use,so you have to change the Jenkins port number, so for that open Jenkins folder in Program File and open Jenkins.XML file and change the port number such as 8088

Now Open CMD and write

java -jar jenkins.war --httpPort=8088

Solution 4

To start Jenkins from command line

  1. Open command prompt
  2. Go to the directory where your war file is placed and run the following command:

    java -jar jenkins.war

To stop

Ctrl + C

Solution 5

To Start Jenkins through Command Line

  1. Run CMD with admin

  2. You can run following commands

    "net start servicename" to start

    "net restart servicename" to restart

    "net stop servicename" to stop service

for more reference https://www.windows-commandline.com/start-stop-service-command-line/

Share:
396,386

Related videos on Youtube

Ripon Al Wasim
Author by

Ripon Al Wasim

[email protected] skype: ripon_sky

Updated on July 21, 2020

Comments

  • Ripon Al Wasim
    Ripon Al Wasim almost 4 years

    I have downloaded "jenkins-1.501.zip" from http://jenkins-ci.org/content/thank-you-downloading-windows-installer .

    I have extracted zip file and installed Jenkins on Windows 7 successfully. Jenkins runs at http://localhost:8080/ well. I want to stop Jenkins service from console. How can I do that? What's the way to start and restart through console/command line?

  • Nevin Raj Victor
    Nevin Raj Victor almost 9 years
    @kapep: What about start and stop in mac
  • Ripon Al Wasim
    Ripon Al Wasim over 8 years
    How to know the jenkins status?
  • alex
    alex about 7 years
    Sure enough, this appears to work for me on Windows 7.
  • Shaiju T
    Shaiju T about 7 years
    @Cryptor, check this post to safely shut down jenkins , it may help.
  • Kolby
    Kolby over 6 years
    This worked for me, and is also what their documentation recommends: wiki.jenkins.io/display/JENKINS/Starting+and+Accessing+Jenki‌​ns
  • jayant singh
    jayant singh about 6 years
    using this we can not close the terminal ,coz the jenkins stops on closing the terminal any solution ?
  • Amit Jain
    Amit Jain almost 6 years
    To run cmd in admin mode 1. Open task manager 2. File - New Task 3. Select check box "Create task with admin previleges"
  • Vin Shahrdar
    Vin Shahrdar over 5 years
    I don't know where my Jenkins installation directory is :(
  • Surendra Meena
    Surendra Meena almost 5 years
    when using this process ,all my previous project on jenkins lost and it runs through terminal only.
  • shehanpathi
    shehanpathi over 3 years
    Jenkins installation directory is in 'Program Files' or 'Program Files(x86)'
  • user4851
    user4851 over 3 years
    This is what I was looking for, but there is no restart. You must do stop followed by start.
  • likejudo
    likejudo over 3 years
    I don't find Jenkins in either of the ProgramFiles folders
  • Lahiru Amarathunge
    Lahiru Amarathunge over 3 years
    maybe, you haven't installed it properly.
  • Jean-François Larvoire
    Jean-François Larvoire about 3 years
    This is definitely not a batch file for Windows.