Jenkins is an open-source automation server that allows continuous integration and delivery capabilities to a project. Projects ranging from simple functionalities to complex and detailed ones can use Jenkins to automate their code testing and deployment. In this answer, we will see how to restart the Jenkins server safely.
There are two ways through which we can access the Jenkins dashboard on the web browser:
If we want to access the Jenkins dashboard on our system, we can use the following URL:
http://localhost:8080
localhost
means that the Jenkins server is running on our own system.
8080
is the default port to run the Jenkins server.
If we want to access the Jenkins dashboard on another system, we can use the following URL:
http://<system's host name>:8080
<system's host name>
is the IP address of the system on which the Jenkins server runs.
Jenkins provides a feature to restart the server safely. It waits for all the running jobs to finish and then restarts it. We can safely restart Jenkins in the following way:
/safeRestart
to URLWe can safely restart our Jenkins server by adding /safeRestart
at the end of the URL, as demonstrated below:
The highlighted URL in the above demonstration is given below:
http://<system's host name>:8080/safeRestart
Note: We have to replace the
system's host name
according to the system on which we want to access the Jenkins server.
Once we press enter, we are redirected to a page confirming whether we want to restart Jenkins. The redirected page is shown below:
When we click yes, then we will see a waiting screen that waits for all the jobs to finish, and Jenkins will safely restart.
By following the steps mentioned above, we can safely restart Jenkins.
Free Resources