Install Jenkins on CentOS 7

Installation

The Jenkins Installation is quit simple, because Jenkins has its own repo, so just show the code:

1
2
3
4
wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat/jenkins.repo
rpm --import https://jenkins-ci.org/redhat/jenkins-ci.org.key
# V 1.617-1.1
yum install jenkins

we also need java environment:

1
2
# install openjdk 1.8
yum install java

or u can search java version and install:

1
yum search java | grep 'java-'

Next, we should expose port 8080:

1
2
3
systemctl status firewalld
firewall-cmd --add-port=8080/tcp
firewall-cmd --list-ports

then u can open browser and request the page:
http://ip:8080/

Same installation on Ubuntu:

1
2
3
4
wget -q -O - https://jenkins-ci.org/debian/jenkins-ci.org.key | sudo apt-key add -
sudo sh -c 'echo deb http://pkg.jenkins-ci.org/debian binary/ > /etc/apt/sources.list.d/jenkins.list'
sudo apt-get update
sudo apt-get install jenkins

Update

Just run:

1
yum install jenkins

Ubuntu:

1
apt-get install jenkins

Errors

if you get the error, u can try to fix it:

1
2
# error: Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
yum install deltarpm

Reference

Installing Jenkins