How to Update Plugin in Jenkins: Step-by-Step Guide
To update a plugin in Jenkins, go to
Manage Jenkins > Manage Plugins, then select the Updates tab, choose the plugins you want to update, and click Download now and install after restart. Alternatively, use the Jenkins CLI command java -jar jenkins-cli.jar -s http://your-jenkins-url update-plugin <plugin-name> to update plugins from the command line.Syntax
There are two main ways to update plugins in Jenkins: via the web interface or the command line.
- Web Interface: Navigate to
Manage Jenkins > Manage Plugins > Updates. Select plugins and clickDownload now and install after restart. - Command Line: Use the Jenkins CLI tool with the syntax
java -jar jenkins-cli.jar -s http://your-jenkins-url update-plugin <plugin-name>.
bash
java -jar jenkins-cli.jar -s http://your-jenkins-url update-plugin <plugin-name>Example
This example shows how to update the "git" plugin using the Jenkins web interface and the CLI.
bash
java -jar jenkins-cli.jar -s http://localhost:8080 update-plugin gitOutput
Updating plugin git...
Plugin git updated successfully. Restart Jenkins to apply changes.
Common Pitfalls
- Not restarting Jenkins after plugin update can cause the new plugin version not to load.
- Updating plugins without checking compatibility may break Jenkins jobs.
- Failing to back up Jenkins before updates risks losing configuration if something goes wrong.
bash
# Wrong way: # Updating plugin but not restarting Jenkins java -jar jenkins-cli.jar -s http://localhost:8080 update-plugin git # Right way: java -jar jenkins-cli.jar -s http://localhost:8080 update-plugin git # Then restart Jenkins from web UI or CLI to apply update
Quick Reference
| Action | Description |
|---|---|
| Manage Jenkins > Manage Plugins > Updates | Select and update plugins via web UI |
| jenkins-cli.jar update-plugin | Update plugin from command line |
| Restart Jenkins | Apply plugin updates after installation |
| Backup Jenkins | Always backup before updating plugins |
Key Takeaways
Update Jenkins plugins via Manage Plugins > Updates or Jenkins CLI for flexibility.
Always restart Jenkins after updating plugins to activate new versions.
Check plugin compatibility before updating to avoid breaking Jenkins jobs.
Backup Jenkins configuration before plugin updates to prevent data loss.