What is Jenkins, Install Jenkins and Fundamental Concepts

What is Jenkins, Install Jenkins and Jenkins Overview

Jenkins for Beginners

In this tutorial i will show you how to install Jenkins, configure it with Tomcat,  do Apache configuration to run it on port 80, secure Jenkins and add users.

What is Jenkins

Jenkins is one of the tools for continuous integration and deployment. You can use Jenkins for  repetitive tasks and even for scheduled jobs.

Install Jenkins on Linux

In this tutorial i will be installing Jenkins on RHEL 7 but the steps can be applied on other versions and Linux flavors too.

Jenkins and Java

Jenkins is Java based so you have to install Java and be sure that nothing is using 8080 port in case you will be using it for Jenkins.

You can also use another port like port 80 which i will show in this tutorial.

To check if 8080 is used by any other services you can run any of the below commands:

telnet localhost 8080
nmap -sT -O localhost
netstat -tulpen | grep -i 8080

Install Java

yum install java

Add Java path to system environment, to find the path by following the symlinks use below command:

readlink -f $(which java)

Add the output folder (Don't include java) to /etc/environment like below example:

vi /etc/environments
export JAVA_HOME="/usr/lib/jvm/jre-1.7.0-openjdk.x86_64/"

Test that everything went fine by running below command:

java -version

Install Jenkins

Go to jenkins.io and find the right version for your operating system, always use the LTS version which is the long term support version

Download and use it's repo and import the Jenkins key:

sudo wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo
sudo rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key

Install Jenkins

yum install jenkins

Test Jenkins by going to your localhost or ip address and point to port 8080.

Jenkins on 8080

First password will be found on the path which Jenkins give on the first screen (above figure).

Getting Started with Jenkins

You will have the first time a wizard which will ask you for installing suggested plugins or you choose yours, if you are not familiar or it's your first time you can proceed by selecting 'Install suggested plugins'.

You can use below command if you want to know all about Jenkins arguments and parameters:

ps aux | grep -i jenkins

Secure Jenkins
  1. Login to Jenkins console
  2. Select 'manage Jenkins'
  3. Select 'Configure Global Security'
    Enable security
    Choose Jenkins Own User Database
    Uncheck allow user to signup
    Apply and Save
Add Jenkins Users
  1. Login to Jenkins console
  2. Select 'manage Jenkins'
  3. Then select 'Manage Users'
  4. After that select 'Create User'
  5. Fill all required information
  6. Now select 'Back to Dashboard'
  7. After that select 'manage Jenkins'
  8. Select 'Configure Global Security'
  9. Check the 'Matrix-based security'
  10. Add the user and select 'add' then choose all user/group privileges

 


Subscribe to
for video tutorials updates