Skip to content

Instantly share code, notes, and snippets.

@omps
Created May 29, 2016 08:10
Show Gist options
  • Save omps/385e7f4958dd99d364d73edfb652214a to your computer and use it in GitHub Desktop.
Save omps/385e7f4958dd99d364d73edfb652214a to your computer and use it in GitHub Desktop.
Install jenkins on centos
sudo wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat/jenkins.repo
sudo rpm --import https://jenkins-ci.org/redhat/jenkins-ci.org.key
sudo yum install jenkins

sudo wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat-stable/jenkins.repo #Installation of a stable version LTS YUM repository for the LTS Release Lin
sudo rpm --import https://jenkins-ci.org/redhat/jenkins-ci.org.key
sudo yum install jenkins

sudo yum install java #jenkins require Java to be present.

sudo service jenkins start/stop/restart #For centos
sudo chkconfig jenkins on
# disable the firewall
firewall-cmd --zone=public --add-port=8080/tcp --permanent
firewall-cmd --zone=public --add-service=http --permanent
firewall-cmd --reload
firewall-cmd --list-all

# In case of Java version errors remove the previous version and install latest Java from yum.
yum install java-1.7.0-openjdk

java -version
java version "1.7.0_79"
OpenJDK Runtime Environment (rhel-2.5.5.1.el6_6-x86_64 u79-b14)
OpenJDK 64-Bit Server VM (build 24.79-b02, mixed mode)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment