0
0
JenkinsHow-ToBeginner · 3 min read

How to Install Plugins in Jenkins: Step-by-Step Guide

To install a plugin in Jenkins, go to Manage Jenkins > Manage Plugins, then select the Available tab, find your plugin, and click Install without restart or Download now and install after restart. Alternatively, use the Jenkins CLI with jenkins-cli.jar and the install-plugin command.
📐

Syntax

There are two main ways to install plugins in Jenkins: via the web interface or using the Jenkins CLI.

  • Web Interface: Navigate to Manage Jenkins > Manage Plugins > Available, search for the plugin, and click Install without restart or Download now and install after restart.
  • CLI Command: Use the Jenkins CLI tool with the syntax:
bash
java -jar jenkins-cli.jar -s http://your-jenkins-url install-plugin plugin-name
💻

Example

This example shows how to install the git plugin using the Jenkins web interface and CLI.

bash
java -jar jenkins-cli.jar -s http://localhost:8080 install-plugin git
java -jar jenkins-cli.jar -s http://localhost:8080 safe-restart
Output
Installing git plugin... Plugin git installed successfully. Jenkins is restarting safely...
⚠️

Common Pitfalls

Common mistakes when installing Jenkins plugins include:

  • Not having proper permissions to install plugins.
  • Trying to install plugins without restarting Jenkins when required.
  • Using outdated Jenkins CLI commands or wrong Jenkins URL.
  • Installing incompatible plugin versions.

Always check plugin compatibility and restart Jenkins if the plugin requires it.

bash
Wrong way:
java -jar jenkins-cli.jar -s http://wrong-url install-plugin git

Right way:
java -jar jenkins-cli.jar -s http://localhost:8080 install-plugin git
📊

Quick Reference

ActionDescription
Manage Jenkins > Manage PluginsAccess plugin manager in Jenkins UI
Available tabFind and select plugins to install
Install without restartInstall plugin immediately without restarting
Download now and install after restartInstall plugin after Jenkins restarts
CLI install-pluginInstall plugin via Jenkins CLI tool
safe-restartRestart Jenkins safely after plugin installation

Key Takeaways

Use Jenkins UI Manage Plugins to easily find and install plugins.
Jenkins CLI allows plugin installation with the install-plugin command.
Check plugin compatibility and restart Jenkins if needed.
Ensure correct Jenkins URL and permissions when using CLI.
Use safe-restart to apply plugin changes without downtime.