Start/Stop and Restart Jenkins service on Windows
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
- Open command prompt
-
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
-
Run CMD with admin
-
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/
Related videos on Youtube
![Ripon Al Wasim](https://i.stack.imgur.com/LlQDO.png?s=256&g=1)
Comments
-
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 almost 9 years@kapep: What about start and stop in mac
-
Ripon Al Wasim over 8 yearsHow to know the jenkins status?
-
alex about 7 yearsSure enough, this appears to work for me on Windows 7.
-
Shaiju T about 7 years@Cryptor, check this post to safely shut down jenkins , it may help.
-
Kolby over 6 yearsThis worked for me, and is also what their documentation recommends: wiki.jenkins.io/display/JENKINS/Starting+and+Accessing+Jenkins
-
jayant singh about 6 yearsusing this we can not close the terminal ,coz the jenkins stops on closing the terminal any solution ?
-
Amit Jain almost 6 yearsTo run cmd in admin mode 1. Open task manager 2. File - New Task 3. Select check box "Create task with admin previleges"
-
Vin Shahrdar over 5 yearsI don't know where my Jenkins installation directory is :(
-
Surendra Meena almost 5 yearswhen using this process ,all my previous project on jenkins lost and it runs through terminal only.
-
shehanpathi over 3 yearsJenkins installation directory is in 'Program Files' or 'Program Files(x86)'
-
user4851 over 3 yearsThis is what I was looking for, but there is no
restart
. You must dostop
followed bystart
. -
likejudo over 3 yearsI don't find Jenkins in either of the ProgramFiles folders
-
Lahiru Amarathunge over 3 yearsmaybe, you haven't installed it properly.
-
Jean-François Larvoire about 3 yearsThis is definitely not a batch file for Windows.