How to Install and configure Jenkins on CentOS 6.4

Jenkins-LogoJenkins is an opensource and most popular continuous integration tool written in Java. There are many plugins are available to make it more easier. It supports almost all version control systems. You can configure builts with various means like, triggered by a commit in a version control system, scheduling by cron-jobs, built after a specific built completes etc.. ect…

In this article I will show you how to install and configure Jenkins on CentOS 6.4.

Step – 1

To install and configure Jenkins on CentOS we have to first install JAVA on the machine. Below are the steps to install JAVA on CentOS.

Verify the java by issuing the below command

Now we will add Jenkins Repository to our machine.

Now we will Install Jenkins

Add Jenkins to system boot

Start Jenkins

By default Jenkins will start on Port 8080. You can verify that with the below command.

Go to your browser and type http://localhost:8080/. Now you should able to see the Jenkins dashboard like below image.

Jenkins-Dashboard-1Step – 2

Now we will setup Authentication for Jenkins. By default Jenkins allows “Anyone can do anything.”. Here we will setup Matrix based security authentication. For this follow the below steps:

Click on Manage Jenkins > Configure Global Security > Jenkins Own User Database > Allow Users to Signup > Save

Jenkins-User-Signup-Config

Step – 3

After saving the above step then follow the below step to create an user:

Click on Signup button (Top right corner of the dashboard) > Fill all the required information > click on SignUp (Below the Form)

Jenkins-Signup-formStep – 3

Now we will restrict User Signup and add “Matrix based security authentication”. Please follow the below steps:

Click on Manage Jenkins > Configure Global Security > Jenkins Own User Database > Unchek “Allow Users to Signup” > Matrix-based security > Put the user Name @ “User/group to add:” text box > click on add > Check all the Check boxes > Save

Jenkins-Matrix-Authentication-SetupNow onwards User “Tapas Mishra” can administrate Jenkins after login. Also you can add more user to the db by following the below

Step – 4

Click on Manage Jenkins > Manage Users > Create Users

After this follow the Step – 3 again to add previliage to the new user.

In next Tutorial I will show you how to add nodes and configure Jobs to Start a Built Process.

The following two tabs change content below.

Tapas Mishra

Sr. Engineer (DevOps)
Loves to work on Opensource products. Having experience on Linux environment. Knowledge on Public cloud services like AWS, Rackspace, DigitalOcean, Linode. Please don't hesitate to give a comment on the posts. Your comments are my strength.

26 thoughts on “How to Install and configure Jenkins on CentOS 6.4

    • Hi Farhan,

      Sorry for the late reply :(. If you forgot your jenkins username and password then you can just disable the security by following the below steps.

      Stop Jenkins (the easiest way to do this is to kill the servlet container.)
      Go to $JENKINS_HOME in the file system and find config.xml file.
      Open this file in the editor.
      Look for the true element in this file.
      Replace true with false
      Remove the elements authorizationStrategy and securityRealm
      Start Jenkins
      When Jenkins comes back, it’s in the unsecured mode where everyone gets full access to the system.

      If this is still not working, trying renaming or deleting config.xml.

      -Tapas

  1. Hi All,

    This installation will work if internet is available, If internet is not available or internet restricted in companies, then how we can install? any possibilities? or only through internet is possible?

    Please explain.

    My requirement is I want to install Jenkins on RHL machine. there is no internet connectivity.

    Please explain.

    • @babunatesan, As per this article we are using Jeninks repo to install Jenkins in our machine. Also we are using CentOS repo to install Java on the machine. So, yes we required internet connection unless how you will connect to the above repos?

      If you don’t have internet connectivity on the RHL machine then you need to download the rpm package of Jenkins on the system where you have the internet connectivity. Then you can transfer the rpm to the RHL machine and then easily you can install it. Do same of Java.

      -Tapas

  2. Hey,

    I followed all the steps as in this article. After step 3 it logged me out and now when i log in using the Username i created, it gives me an error – is missing the overall/read permission

    How to fix this.

    • Sorry Vineet for the late reply. After adding a user / signup on Jenkins you need to do this step – Click on Manage Jenkins > Configure Global Security > Jenkins Own User Database > Unchek Allow Users to Signup > Matrix-based security > Put the user Name @ User/group to add: text box > click on add > Check all the Check boxes > Save Then it will allow you to login and view all things. NB. The above step will create an admin user. You need to unchek few options for normal users. Let me know if you still have doubts.

  3. Hi Tapas, i have actually installed jenkins for my research paper and installed it on my system everything, went smoothly , but it doesnt get connected to the local port 8080, what should i do in this case , i need your help, because my paper is due very soon, it would be great if you would provide me your mail id

Leave a Reply