Saturday 15 September 2018

How to install Jenkins on CentOS/RHEL

How to install Jenkins on CentOS/RHEL


Jenkins gives consistent integration services to programming improvement. It is server based framework running in servlet holder, for e,g, Apache Tomcat. It support SCM devices including CVS, Git, SVN, RTC, Perforce etc...and can execute Apache Ant and Apache Maven based task. 


Jenkins is opensource and most famous persistent joining device written in Java. There are numerous plugins accessible to make it more simpler. You can design built with different means like, activated by a submit in variant control framework scheduling by cron-jobs etc..

Step 1: Check Java Version
First, we have to check that Java has been installed on the server or not. Jenkins require Java 1.6 or more than. If Java version is less than 1.6 than we have to upgrade the Java. Use following command to check Java Version.
# java -version
openjdk version "1.8.0_45"
OpenJDK Runtime Environment (build 1.8.0_45-b13)
OpenJDK 64-Bit Server VM (build 25.45-b02, mixed mode)
Step 2: Jenkins Repository
After checking the version of Java we need to add Jenkins repositories on the server.
# wget -O /etc/yum.repos.d/jenkins.repo   http://jenkins-ci.org/redhat/jenkins.repo
# rpm --import http://pkg.jenkins-ci.org/redhat/jenkins-ci.org.key

Step 3: Install Jenkins
Use following command to install Jenkins.
# yum install jenkins
Step 4: Start Jenkins
Start Jenkins Service uses following command.
# /etc/init.d/jenkins start | stop | restart
# chkconfig jenkins on
Step 5: Verify Jenkins
By default Jenkins use 8080 port. We use following command to check Jenkins is running or not.
 
# netstat -ntulp | grep 8080
Step 8: Change Jenkins HTTP port number
By default, Jenkins runs on port 8080. If you want to change the default port for Jenkins you need to change the file /etc/sysconfig/jenkins
# vim /etc/sysconfig/jenkins
Default:
JENKINS_PORT="8080"
New:
JENKINS_PORT="8443"
Step 9: Access Jenkins
Go to your browser and type http://localhost:8080/. Presently you ought to ready to see the Jenkins dashboard like below image:

I hope this tutorial will help you to install Jenkins on CentOS.

Thank You...!

Select Language