jenkins Installation


For apt-get based systems such as Ubuntu

Add the Jenkins repository:

wget -q -O - | sudo apt-key

sudo sh -c 'echo deb binary/ > /etc/apt/sources.list.d/jenkins.list'

Update sources and install Jenkins:

sudo apt-get update

sudo apt-get install jenkins

A jenkins user is now created and by default Jenkins will be running on port 8080.

For RPM Based distributions such as Red Hat Enterprise Linux (RHEL), CentOS, Fedora or Scientific Linux

To download the repository file for the stable version:

sudo wget -O /etc/yum.repos.d/jenkins.repo

Or if you want the latest weekly releases:

sudo wget -O /etc/yum.repos.d/jenkins.repo

Import the public key:

sudo rpm --import

Install Jenkins using yum:

sudo yum install jenkins

Jenkins requires java in order to run, to install it:

sudo yum install java

To start/stop/restart jenkins use:

sudo service jenkins start/stop/restart

Upgrading jenkins(RPM installations)

  1. Backup jenkins home directory
  2. Replace jenkins.war in following location with new WAR file. /usr/lib/jenkins/jenkins.war`
  3. Restart Jenkins
  4. Check pinned plugins and unpin if required
  5. Reload Configuration from Disk

note: For Jenkins 2 upgrades for bundled jetty app server,disable AJP port(set JENKINS_AJP_PORT="-1") in /etc/sysconfig/jenkins.