FoxuTech

How to Install Jenkins in CentOS and Ubuntu

How to Install Jenkins

Jenkins is an open source continuous integration tool written in Java. The project was forked from Hudson after a dispute with Oracle. Jenkins provides continuous integration services for software development. It is a server-based system running in a servlet container such as Apache Tomcat. It supports SCM tools including AccuRev, CVS, Subversion, Git, Mercurial, Perforce, Clearcase and RTC, and can execute Apache Ant and Apache Maven based projects as well as arbitrary shell scripts and Windows batch commands. The primary developer of Jenkins is Kohsuke Kawaguchi, and it is released under the MIT License. Lets see How to Install Jenkins.

Install Jenkins in Redhat/centos 7

# 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

Install jenkins

# yum install jenkins

Install java

yum install java-1.7.0-openjdk

Setup firewall

# firewall-cmd –zone=public –add-port=8080/tcp –permanent

# firewall-cmd –reload

Start Jenkins

# /etc/init.d/jenkins restart

# systemctl restart jenkins.service

Open your browser http://ip-addre:8080 or http://localhost:8080

In Debian family

Update your system first

# apt-get update

You need apache installed configure jenkins

# apt-get install apache2

Install Java

# apt-get install openjdk-7-jdk

Check you java installed

# java -version

Install Jenkins

Add the key and source list to apt.

# wget -q -O - https://pkg.jenkins.io/debian/jenkins-ci.org.key | sudo apt-key add -

Create a sources list for Jenkins:

# sudo sh -c 'echo deb http://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list'

Update the cache

# apt-get update

Start The installation

# apt-get install jenkins

Start Jenkins

# /etc/init.d/jenkins start

The log file will be placed in /var/log/jenkins/jenkins.log.

Open your browser http://ip-addre:8080

Exit mobile version