How to install Jenkins plugins offline
To install Jenkins plugins offline, you can follow these steps:
- Firstly, download the .hpi file of the required plugin from the Jenkins plugin website (https://plugins.jenkins.io/). Make sure to download a plugin that is compatible with your current version of Jenkins.
- Copy the downloaded .hpi file to the plugin directory on the Jenkins server. The location of the plugin directory depends on your Jenkins installation method and operating system.
- For standalone installations of Jenkins, the plugin directory is typically located in the $JENKINS_HOME/plugins/ folder.
- For Jenkins within Docker containers, the plugins directory is typically located in the /var/jenkins_home/plugins/ folder.
- Create an empty file named .hpi.pinned in the plugins directory to prevent Jenkins from automatically updating the plugins.
- Please restart the Jenkins service to apply the plugins. You can restart Jenkins through either the command line or the web interface, depending on your operating system and installation method.
- For a standalone installation of Jenkins, you can restart the service using the command sudo service jenkins restart.
- You can restart Jenkins in a Docker container by restarting the Docker container.
- Navigate to the “Manage Jenkins” section in the Jenkins web interface and then go to the “Manage Plugins” page. You should be able to see the plugin you just installed.
Following these steps will allow you to install and use Jenkins plugins in an offline environment. Please note that plugins installed offline will not automatically update. If you wish to update a plugin, you will need to manually download and install the latest version.