Skip to content
Tutorials Center
My learning

Topics

Lesson 22 of 40 ยท Credentials, Plugins and Security

Plugins: Finding, Managing and Pinning

Find, install, update and pin Jenkins plugins. Understand dependencies, plugin-versions files, rollbacks, abandoned plugins and good plugin hygiene.

Jenkins itself is a small core. Nearly everything you use daily (Git, Pipeline, credentials, email, Docker, cloud agents) is a plugin: a package that adds features to the controller. That is Jenkins' greatest strength, because there are well over a thousand of them, and its greatest maintenance burden, because every plugin is code running inside your controller with access to your jobs and secrets.

This lesson teaches you to find plugins, install them, keep them updated, pin their versions in code, and decide when a plugin is a risk. Real Jenkins screens and commands are read-only here. The runnable stand-ins resolve a plugin dependency graph and check a version file the way the real tools reason about them.

A plugin's life

Find Search the update center.
Install With its dependencies.
Pin Record the exact version.
Update Test, then roll out.

Treat plugins like any other dependency.

1 / 2

The plugin manager and the update center

Open Manage Jenkins > Plugins. The tabs are:

  • Updates: installed plugins with newer versions available.
  • Available plugins: everything in the update center that you do not have. Use the search box.
  • Installed plugins: what you run, with enable/disable switches and version numbers.
  • Advanced settings: proxy settings, the update site URL and a form to upload a plugin file by hand.

The update center is a catalog published by the Jenkins project. Your controller downloads it periodically (it needs internet access or a configured mirror). It lists each plugin's versions, its dependencies, its health score and any security warnings. If a plugin you run has a known vulnerability, Jenkins shows a warning banner in the Manage Jenkins page. Read those banners, because many real-world Jenkins incidents came from unpatched plugins.

When you search, check the plugin's documentation page for: when it was last released, how many installs it has, whether it is flagged as "adopt this plugin" (its maintainer left), and what it depends on.

Dependencies

Plugins depend on other plugins, and on a minimum Jenkins version. Installing the Pipeline plugin, for example, pulls in a dozen more. The plugin manager resolves this for you, and it also tells you if an update needs a newer Jenkins core.

flowchart LR
  A["git"] --> B["git-client"]
  A --> C["scm-api"]
  A --> D["credentials"]
  B --> D
  C --> D

The git plugin needs three others; credentials is a shared dependency, so it is installed once.

There are two kinds of dependency:

  • Required: the plugin will not load without it.
  • Optional: extra features appear if the other plugin is present.

If a required dependency is missing or too old, the plugin fails to load and shows an error on the Manage Jenkins page. After an update you may need a restart for the change to apply; the plugin manager offers a "restart when no jobs are running" option.

The stand-in below resolves a dependency list the way an installer must: take what you ask for, add everything it needs, and report an order in which each plugin appears after its dependencies. The plugin names are real, but the dependency data is simplified.

JS Stand-in: resolving a plugin dependency graph

Press Run (or Ctrl + Enter) to see the console output here.

No output.

Asking for one aggregate plugin installs eight, with credentials first because everything depends on it. This is why removing a plugin can be harder than adding one: other plugins may still need it.

Install from code: pinning

Clicking in the UI is fine to explore, but a controller you rebuild or run in several environments should have its plugins defined in a file. The Docker image and several tools use the jenkins-plugin-cli command. A plugin list is one id:version per line:

TEXT
# plugins.txt
workflow-aggregator:600.vb_57cdd26fdd7
git:5.7.0
credentials-binding:687.v619cb_15e923f
configuration-as-code:1967.va_968e15fb_f56

(The version numbers are examples. Take real ones from the update center when you build your list.) In a Dockerfile:

DOCKERFILE
FROM jenkins/jenkins:lts-jdk21
COPY plugins.txt /usr/share/jenkins/ref/plugins.txt
RUN jenkins-plugin-cli --plugin-file /usr/share/jenkins/ref/plugins.txt

jenkins-plugin-cli downloads each listed plugin and its dependencies into the image. Writing git:latest is allowed, but it defeats pinning, because the same file produces different controllers on different days. Pin versions, commit the file and update it through pull requests. Jenkins Configuration as Code builds on this: plugins and configuration together describe a controller you can recreate.

A pinned file needs a check that every line is well-formed. The stand-in below does a simplified version of that review, which you could run in CI over a pull request.

JS Stand-in: reviewing a plugins file

Press Run (or Ctrl + Enter) to see the console output here.

No output.

The review flags four problems: an entry with latest, an entry with no version, a duplicate git, and a line that is not a plugin entry at all. Line numbers count from the first (empty) line of the text.

Updating safely

Updates fix bugs and security holes, so avoid falling far behind. A reasonable routine:

  1. Read the plugin's changelog and the Jenkins security advisories for the update.
  2. Apply updates on a staging controller, or at least in a quiet period, and run representative pipelines.
  3. Back up JENKINS_HOME first (Backup, Monitoring and Troubleshooting).
  4. Update, restart when idle, and check the logs and the Manage Jenkins page for load errors.

If a new version breaks something, the Installed plugins tab offers a Downgrade button for the previously installed version. That is a one-step rollback only; for anything more, reinstall the older version from your pinned file. Updating the Jenkins core can require plugin updates (and the other way round), so keep both moving together instead of postponing for months.

Abandoned and risky plugins

A plugin can stop being maintained. Signs to look for: no release for years, a notice saying it is up for adoption, open vulnerabilities without a fix, or a dependency on very old libraries. The Jenkins security team may also issue warnings for plugins whose problems have no patch.

When that happens, you have options: find an alternative plugin, replace it with a shell step or a shared-library function, or take over maintenance. Prefer plain pipeline steps for simple jobs. A three-line sh 'curl ...' step does not need a plugin that touches your credentials.

Plugin hygiene checklist

  • Install only what you use. Every plugin enlarges your attack surface and your upgrade workload.
  • Prefer plugins that are actively released, widely installed and documented.
  • Keep a pinned plugin file in Git; review changes in pull requests.
  • Subscribe to the Jenkins security advisories and act on them quickly.
  • Disable unused plugins, then uninstall them after confirming nothing needs them.
  • Avoid uploading .hpi files from unknown sources: a plugin runs with the controller's full permissions.
  • Test updates before production, and keep a rollback plan.

Good plugin habits are one part of keeping a controller safe; Security, Users and Authorization covers the rest.

What is real and what is the stand-in

The plugin manager tabs, the plugins.txt format and the jenkins-plugin-cli command are real. The plugin versions shown are examples. The two TryIt blocks are small JavaScript stand-ins that illustrate the reasoning (dependency ordering and file review). They do not contact the update center, and the real installer also checks version compatibility, which the stand-in leaves out.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Why does installing one plugin often install several?

    A plugin cannot load without its required dependencies, so the installer resolves and installs the whole set.
  2. 2. What is the main problem with git:latest in a plugins file?

    Pinning exists to make a controller reproducible. latest resolves to whatever is newest at build time.
  3. 3. Which command installs the plugins named in a file when you build a Jenkins image?

    jenkins-plugin-cli reads the list, downloads each plugin and its dependencies, and is the usual tool in Dockerfiles.
  4. 4. A plugin has had no release for years and has an unfixed vulnerability. What is the sensible response?

    Plugins run inside the controller. Unpatched ones are a real risk, so move off them.

Summary

  • Almost all Jenkins features are plugins; manage them under Manage Jenkins > Plugins.
  • Plugins have required and optional dependencies; the installer resolves them for you.
  • Pin plugin versions in a plugins.txt file used by jenkins-plugin-cli, and commit it to Git.
  • Update regularly but test first, back up before updating, and know how to roll back.
  • Remove unused or abandoned plugins, and follow security advisories.

Next, see how access to all of this is controlled in Security, Users and Authorization.