How to Install Jenkins in Linux

install jenkins

Jenkins is a opensource automation server, works with Java. Used for building, Testing, Deploying & Automating lot of jobs with the help of various plugins which we can integrate in the dashboard for easy of use.


Lets see how to Install Jenkins software using YUM package,

Pre-requite for using JENKINS is to have Java to be installed. Lets check that in the server by issuing this command,

# java -version
java version "1.7.0_91"
OpenJDK Runtime Environment (amzn-2.6.2.2.63.amzn1-x86_64 u91-b00)
OpenJDK 64-Bit Server VM (build 24.91-b01, mixed mode)

If Java is not installed, Please follow the article for Installation of Java JDK for Linux flavors such as RHEL or CentOS.

Install Jenkins Steps:-

Adding the JENKINS Repo to the Repository, below commands will add the jenkins repo to the existing repository,

# wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat-stable/jenkins.repo
--2016-01-28 19:10:09--  http://pkg.jenkins-ci.org/redhat-stable/jenkins.repo
Resolving pkg.jenkins-ci.org (pkg.jenkins-ci.org)... 199.193.196.24
Connecting to pkg.jenkins-ci.org (pkg.jenkins-ci.org)|199.193.196.24|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 89 [text/plain]
Saving to: ‘/etc/yum.repos.d/jenkins.repo’
/etc/yum.repos.d/jenkins.repo             100%[====================>]      89  --.-KB/s    in 0s
2016-01-28 19:10:09 (24.1 MB/s) - ‘/etc/yum.repos.d/jenkins.repo’ saved [89/89]

# rpm --import https://jenkins-ci.org/redhat/jenkins-ci.org.key

 

Followed by yum command to install jenkins

# yum install jenkins
Loaded plugins: priorities, update-motd, upgrade-helper
jenkins                                                                                                             |  951 B     00:00
jenkins/primary                                                                                               | 5.7 kB     00:00
Running transaction
................
  Installing : jenkins-1.642.1-1.1.noarch                                                                                                                          1/1
  Verifying  : jenkins-1.642.1-1.1.noarch                                                                                                                          1/1
Installed:
  jenkins.noarch 0:1.642.1-1.1
Complete!

Yes, Installation of Jenkins is completed.

How to start/stop the Jenkins Services:-

We can start, stop & restart the Jenkins services by below standard commands,

To Start

# service jenkins start
Starting Jenkins                                           [  OK  ]

To Stop

# service jenkins stop
Shutting down Jenkins                                   [  OK  ]

For Permanent Reboot configuration,

# chkconfig jenkins on

Location of Important Files:-

Lets see the important files or configuration for jenkins,

To See the Log files,

# tail -100 /var/log/jenkins/jenkins.log

To view the configuration files of Jenkins,

# cd /var/lib/jenkins
# ls -lrt
total 44
-rw-r--r--  1 jenkins jenkins    0 Jan 28 19:34 secret.key.not-so-secret
-rw-r--r--  1 jenkins jenkins   64 Jan 28 19:34 secret.key
drwxr-xr-x  2 jenkins jenkins 4096 Jan 28 19:34 jobs
drwxr-xr-x 21 jenkins jenkins 4096 Jan 28 19:34 plugins
-rw-r--r--  1 jenkins jenkins  159 Jan 28 19:34 hudson.model.UpdateCenter.xml
drwxr-xr-x  2 jenkins jenkins 4096 Jan 28 19:34 nodes
-rw-------  1 jenkins jenkins 1680 Jan 28 19:34 identity.key.enc
drwxr-xr-x  4 jenkins jenkins 4096 Jan 28 19:34 secrets
drwxr-xr-x  2 jenkins jenkins 4096 Jan 28 19:34 userContent
-rw-r--r--  1 jenkins jenkins  907 Jan 28 19:34 nodeMonitors.xml
-rw-r--r--  1 jenkins jenkins    0 Jan 28 19:34 Download metadata.log
drwxr-xr-x  2 jenkins jenkins 4096 Jan 28 19:34 updates
-rw-r--r--  1 jenkins jenkins  129 Jan 28 19:35 queue.xml

Please share your thoughts and also for any suggestions in the below form,

YOU MAY ALSO LIKE....

Leave a Reply

1 Comment on "How to Install Jenkins in Linux"

avatar
166
Sort by:   newest | oldest | most voted
JuneOVentors
Guest

Spot up with this write-up, I truly feel
this site needs far more attention. I’ll probably be
returning to read through more, thank you for the advice!

wpDiscuz