Open In App

How To Restart Jenkins Manually ?

Jenkins, an open-source automation server, plays an important role by providing continuous integration and continuous delivery (CI/CD) pipelines. Occasionally, you could come across situations in which manually restarting Jenkins becomes important to resolve issues or make some adjustments. In this article, you will learn how to restart Jenkin manually and its requirement

Before you start, it is very important to know that restarting Jenkins will briefly interrupt its services, so it is recommended to plan the restart only during the low-activity period to limit any impact on ongoing jobs and pipelines.



Prerequisites for Manually Restarting Jenkins

How do I restart Jenkins manually?

There are several ways to restart Jenkin manually. We are going to discuss the most commonly used ways to restart Jenkin manually:

  1. Restart using URL
  2. Restart using system-level services

Restart using URL

Step 1: This is one of the easiest ways to restart Jenkin. You can restart it by pasting these commands in the URL:



For the restart: In this restart process, the machine will not wait for the ongoing jobs to be completed.

localhost 8080:/restart

Using Restart in the URL

A dialogue box will appear in that you have to click on the Yes button.

Click on Yes Button

For the Saferestart: In this restart process the machine will wait for the ongoing jobs to get completed first, then it will restart the Jenkin.

localhost 8080:/safeRestart

Using SafeRestart in the URL

A dialogue box will appear in that you have to click on the Yes button.

Click on Yes Button

Restart using System level Services

This is another method to restart the Jenkin, the given set of steps are given below to illustrate the restart process using system level services:

Step 1: If your running jenkins on lnux you can restart by using “sudo systemctl” command, just open the linux terminal and write this command:

sudo systemctl restart jenkins

Restart using System level Services

Step 2: After running the command, go back to browser and refresh the page and then login again.

Reload the page

Login again in the Jenkins

Login

Step 3: You will be redirected to Homepage after successful login and Now, you have successfully restarted the Jenkins manually.

Conclusion

Manually restarting Jenkins is a simple process, and it is important to make some changes or resolve issues. By following these mentioned steps in this article, you will be able to successfully restart Jenkins, that ensures smooth functioning of your CI/CD pipelines. You must remember this point before restarting Jenkin manually that you should always plan to restart only during the low-activity period to minimize the impact on ongoing jobs and pipelines.

How to restart Jenkins manually?- (FAQs)

What is need to restart Jenkins?

These are following reason behind the restart jenkin :

  • To update Jenkins or its plugins.
  • Resolving overall performance issues or unexpected behavior.

What is the difference between “Restart Safely” and “Restart”?

Restart Safely:

  • Allows ongoing tasks to complete before than restarting.
  • Recommended while you need to avoid interrupting running jobs.

Restart:

  • Immediately restarts Jenkins without waiting for ongoing tasks to complete.
  • Use when immediately restart is necessary, and potential job interruptions are desirable.

Can I restart Jenkins with out affecting ongoing jobs?

Yes, by choosing on “Restart Safely” allows Jenkins to complete ongoing task before restarting, minimizing the effect on running jobs.

Which command is used to restart Jenkins manually?

The command to restart Jenkins manually mainly depends upon the operating system we are currently using.

  • For Linux/Unix: sudo systemctl restart jenkins
  • For Windows: Restart-Service Jenkins

Article Tags :