Restart Jenkins via CLI Start by downloading the Jenkins CLI . jar file. 2. Open the Jenkins dashboard in your web browser and click the Manage Jenkins link on the left-hand side.
Enter your www. jenkins-ip/restart (for example, http://localhost:8080/restart ) in the browser. Jenkins will restart and load the login page automatically after restart.
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
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
Example: if my local PC is running Jenkins at port 8080, it will be
http://localhost:8080/exit
To start Jenkins from command line
Go to the directory where your war file is placed and run the following command:
java -jar jenkins.war
To stop
Ctrl + C
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
jenkins.exe stop
jenkins.exe start
jenkins.exe restart
These commands will work from cmd only if you run CMD with admin permissions
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/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With