[jenkins] How to install a plugin in Jenkins manually

Installing a plugin from the Update center results in:

Checking internet connectivity Failed to connect to http://www.google.com/. Perhaps you need to configure HTTP proxy? Deploy Plugin Failure - Details hudson.util.IOException2: Failed to download from http://updates.jenkins-ci.org/download/plugins/deploy/1.9/deploy.hpi

Is it possible to download the plugin and install it manually into Jenkins?

This question is related to jenkins jenkins-plugins

The answer is


Update for Docker: use the install-plugins.sh script. It takes a list of plugin names minus the '-plugin' extension. See the description here.

install-plugins.sh replaces the deprecated plugins.sh which now warns :

WARN: plugins.sh is deprecated, please switch to install-plugins.sh

To use a plugins.txt as per plugins.sh see this issue and this workaround:

RUN /usr/local/bin/install-plugins.sh $(cat /usr/share/jenkins/plugins.txt | tr '\n' ' ')


This is a way to copy plugins from one Jenkins box to another.

Copy over the plugins directory:

scp -r jenkins-box.url.com:/var/lib/jenkins/plugins .

Compress the plugins:

tar cvfJ plugins.tar.xz plugins

Copy them over to the other Jenkins box:

scp plugins.tar.xz different-jenkins-box.url.com
ssh different-jenkins-box.url.com "tar xvfJ plugins.tar.xz -C /var/lib/jenkins"

Restart Jenkins.


I have created a simple script that does the following:

  • Download one or more plugins to the plugin directory
  • Scan all plugins in that directory for missing dependencies
  • download this dependencies as well
  • loop until no open dependencies are left

The script requires no running jenkins - I use it to provision a docker box.

https://gist.github.com/micw/e80d739c6099078ce0f3


To install plugin "git" with all its dependencies:

curl -XPOST http://localhost:8080/pluginManager/installNecessaryPlugins -d '<install plugin="git@current" />'

Here, the plugin installed is git ; the version, specified as @current is ignored by Jenkins. Jenkins is running on localhost port 8080, change this as needed. As far as I know, this is the simplest way to install a plugin with all its dependencies 'by hand'. Tested on Jenkins v1.644


Use https://updates.jenkins-ci.org/download/plugins/. Download it from this central update repository for Jenkins.


Sometimes when you download plugins you may get (.zip) files then just rename with (.hpi) and then extract all the plugins and move to <jenkinsHome>/plugins/ directory.


The accepted answer is accurate, but make sure that you also install all necessary dependencies as well. Installing using the CLI or web seems to take care of this, but my plugins were not showing up in the browser or using java -jar jenkins-cli.jar -s http://localhost:8080 list-plugins until I also installed the dependencies.


The answers given work, with added plugins.

If you want to replace/update a built-in plugin like the credentials plugin, that has dependencies, then you have to use the frontend. To automate I use:

 curl -i -F [email protected] http://jenkinshost/jenkins/pluginManager/uploadPlugin

If you use Docker, you should read this file: https://github.com/cloudbees/jenkins-ci.org-docker/blob/master/plugins.sh

Example of a parent Dockerfile:

FROM jenkins
COPY plugins.txt /plugins.txt
RUN /usr/local/bin/plugins.sh /plugins.txt

plugins.txt

<name>:<version>
<name2>:<version2>

  1. Download the plugin.
  2. Inside Jenkins: Manage Jenkins ? Manage Plugins ? There is a tab called Advanced and on that page there is an option to upload a plugin (the extension of the file must be hpi).

Sometimes, when you download plugins you may get (.zip) files then just rename with (.hpi) and use the UI to install the plugin.


In my case, I needed to install a plugin to an offline build server that's running a Windows Server (version won't matter here). I already installed Jenkins on my laptop to test out changes in advance and it is running on localhost:8080 as a windows service.

So if you are willing to take the time to setup Jenkins on a machine with Internet connection and carry these changes to the offline server Jenkins (it works, confirmed by me!), these are steps you could follow:

  • Jenkins on my laptop: Open up Jenkins, http://localhost:8080
  • Navigator: Manage Jenkins | Download plugin without install option
  • Windows Explorer: Copy the downloaded plugin file that is located at "c:\program files (x86)\Jenkins\plugins" folder (i.e. role-strategy.jpi)
  • Paste it into a shared folder in the offline server
  • Stop the Jenkins Service (Offline Server Jenkins) through Component Services, Jenkins Service
  • Copy the plugin file (i.e. role-strategy.jpi) into "c:\program files (x86)\Jenkins\plugins" folder on the (Offline Jenkins) server
  • Restart Jenkins and voila! It should be installed.