You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在不清除Jenkins安装的情况下手动重启Jenkins(Windows服务器)

Restart Jenkins on Windows Without Reinstalling

Hey there! Let me walk you through a few straightforward, safe ways to restart Jenkins on your Windows server—no need to wipe your existing installation or lose any configurations.

Method 1: Use Jenkins' Built-in Restart Endpoint

This is the easiest way if you can access the Jenkins web UI:

  • Open your Jenkins dashboard (usually at http://<your-server-ip>:8080 or http://localhost:8080) and log in.
  • Append /restart to the end of the URL in your address bar. For example:
    http://localhost:8080/restart
    
  • You’ll see a confirmation page—click Yes to trigger an immediate restart.
  • Pro tip: If you want to wait for all running builds to finish before restarting, use /safeRestart instead:
    http://localhost:8080/safeRestart
    

Method 2: Restart via Windows Services

Since Jenkins typically runs as a Windows service, this method works even if the web UI is unresponsive:

  • Press Win + R to open the Run dialog, type services.msc, and hit Enter.
  • Scroll through the list to find the service named Jenkins (if you’ve customized the service name, look for something containing "Jenkins").
  • Right-click the service and select Restart from the menu. Wait a few moments for the service to stop and start back up.

Method 3: Use Command Line (CMD/PowerShell)

If you prefer using the terminal, these commands will get the job done:

Using Command Prompt (CMD)

  1. Open CMD as Administrator.
  2. Stop the Jenkins service first:
    net stop Jenkins
    
  3. Once it’s stopped, start it back up:
    net start Jenkins
    

Using PowerShell

  1. Open PowerShell as Administrator.
  2. You can restart the service in one line:
    Restart-Service Jenkins
    
  3. If you’re unsure of the exact service name, run this to find it:
    Get-Service | Where-Object {$_.DisplayName -like "*Jenkins*"}
    
    Use the Name value from the output in place of "Jenkins" in the restart command.

Quick Notes

  • Always check if there are active builds running before restarting. The /safeRestart option or waiting for builds to finish helps avoid broken builds or data loss.
  • If Jenkins is frozen and the web UI isn’t loading, the Windows Services or command line methods are your best bet—they’ll force the service to restart regardless of the UI state.

内容的提问来源于stack exchange,提问作者Gayanjani Gamage

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.25 07:02:46