For apt-get based systems such as Ubuntu
Add the Jenkins repository:
wget -q -O - https://jenkins-ci.org/debian/ Jenkins-ci.org.key | sudo apt-key
sudo sh -c 'echo deb http://pkg.jenkins-ci.org/debian-stable 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 http://pkg.jenkins-ci.org/redhat-stable/jenkins.repo
Or if you want the latest weekly releases:
sudo wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat/jenkins.repo
Import the public key:
sudo rpm --import https://jenkins-ci.org/redhat/jenkins-ci.org.key
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
note: For Jenkins 2 upgrades for bundled jetty app server,disable AJP port(set JENKINS_AJP_PORT="-1"
) in /etc/sysconfig/jenkins
.