Our Support: During the COVID-19 outbreak, we request learners to CALL US for Special Discounts!

- DevOps Blogs -

Awesome way to Download and Install Jenkins on Linux



Introduction

Before going into Jenkins installation, question comes into our mind i.e. What exactly is Jenkins? Why is there even any need for such a tool? So, the answer would be, Jenkins is similar to a CI server, which incorporates continuous integration and delivery of almost all languages and source code repositories. It is free and open source. Jenkins helps in

  • Continuous integration
  • Continuous deployment
  • Continuous delivery
  • Continuous testing

Most commonly, Jenkins is known as CI/CD server as well. Jenkins is mainly known as “Jenkins for DevOps” as it is a single point to perform all DevOps related activities which makes it a widely used open source tool for Devops automation. 

DevOps Training & Certification Course

  • Detailed Coverage
  • Best-in-class Content
  • Prepared by Industry leaders
  • Latest Technology Covered

As time progressed, “Jenkins for DevOps” started being to “Jenkins for QA” and Jenkins for “Developers” too as it handles complete software cycle. Now, let’s come back to the topic i.e. 

  • download Jenkins and 
  • Jenkins Installation. 

Jenkins installation can be done for every OS(Operating System) whether Windows or any flavor of Linux(FreeBSD, Gentoo, OpenBSD, openSUSE, Fedora, CentOS, Ubuntu, Debian) or cloud(like Azure) or through Docker containers. List of jenkins download support type is defined here

As the best practice, always go for LTS(Long Term Support) release. At the time of writing this blog, 2.222.3 is the LTS version. 

Here, we will explain two ways which are widely used:

  • .war way(can be used on any OS like Windows/Linux)
  • rpm way(can be used on different flavors of Linux)

Download Jenkins using “war”

1. As a prerequisite, Jenkins installation requires JAVA to be present on system. We can check whether JAVA is installed or not by executing following command:

opt]# java -version 

 bash: java: command not found

2.Java is not in place or installed, so let's install JAVA first to start with our main goal and then need to set the Environment Variable i.e. JAVA_HOME. Execute following command directly from your machine:

yum install java

3. Please note as I am working on Centos 7, so used “yum” for installation. Depending on type of flavors, you can use “apt-get” or “deb” also & for Windows OS, users have to place the “.exe” file and then install. For Linux, “tar.gz” file option is also available to download, instead of package

4. If downloading “tar.gz” or “.exe”/ “.zip”, follow these steps

Go to URL: http://www.oracle.com/technetwork/java/javase/downloads/index.html. Under “Java Platform, Standard Edition”, you will find different JAVA options. Select “Java SE 11.0.{x}”, then click “Download”, accept License Agreement, select required OS and respective package.

DevOps Training & Certification Course

  • Personalized Free Consultation
  • Access to Our Learning Management System
  • Access to Our Course Curriculum
  • Be a Part of Our Free Demo Class

Then that package will be downloaded in your system and then move forward.

So, we just discussed different ways of installing JAVA depending on OS and now for this blog, for Jenkins, we will be using openJDK 1.8 which is present as default package in CentOS machine. 

5. Once Java gets installed or unzipped, set JAVA_HOME as Environment variable with /path/where/java/is/located.

6. Check installation by executing

opt]# java -version 

 openjdk version "1.8.0_242" 

 OpenJDK Runtime Environment (build 1.8.0_242-b08) 

 OpenJDK 64-Bit Server VM (build 25.242-b08, mixed mode) 

7. Go to the already created directory “/opt”(It’s user choice) or create your own directory at desired location where we will download Jenkins war and perform Jenkins installation from war.

Execute:

sudo wget http://mirrors.jenkins.io/war-stable/latest/jenkins.war

Jenkins installation

8. Now, Jenkins installation from war can performed by using any of the following methods:

“java” command 
Execute: 

 java -jar jenkins.war &  

 ‘&’ (Ampersand) is to run it as a background process. 

 Once executed, you can view the process running by executing  

 ps -ef | grep jenkins 

Logs will start coming up. 

 Jenkins installation

b.by placing the war behind an application server like “Tomcat”. 

Download Apache Tomcat(if not already installed) from https://tomcat.apache.org/download-90.cgi

and place “jenkins.war” inside /webapps folder

Note:- It will be straightforward to download/install TOMCAT, I am not explaining it here as it’s out of context. Thanks

Jenkins installation

Start Tomcat application server. Go to /bin directory and execute: 

 ./startup.sh  

 Check the logs in file “catalina.out” using tail command. 

 tail -f logs/catalina.out 

Try any one of the above methods and once you see “Jenkins is fully up and running” in the logs, open the URL in the browser.

http://:8080 (If executed by “java” command) 

 http://:8080/jenkins (If executed by “Tomcat” application server)

Note:- There can be a scenario where it will say “Address already in Use”. This issue can occur as the 8080 port might be already in use and can not be used for Jenkins. So, run Jenkins by specifying new “--httpPort” or change “server.xml” file in TOMCAT and define new port

Download Jenkins and Install using “rpm”

1. Download jenkins.repo from the red hat package and place it in the local “yum” package location. With this, it will download jenkins key also that can be imported using the “rpm” command. (RPM — Red Hat Package Manager) Execute below commands to perform this operation:

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

sudo rpm --import https://pkg.jenkins.io/redhat/jenkins.io.key

2. There can be a case that your key import will fail, that can be because the key was already imported before and not required again and again. Once key imported successfully, Install Jenkins using “yum” command:

sudo yum install jenkins

3. Once Jenkins installation is done successfully, open the URL in the browser.

http://:8080

Now, let’s explore Jenkins in below section

Exploring Jenkins

DevOps Training & Certification Course

  • No cost for a Demo Class
  • Industry Expert as your Trainer
  • Available as per your schedule
  • Customer Support Available

This will be the first screen(when Jenkins starting first time)

Jenkins Installation

2.Enter “Administrator password” from the mentioned location(as you can see from above screenshot) in the file “initialAdminPassword” and click “Continue”.

Initially start with selecting “Install Suggested Plugins”

Jenkins Installation

Jenkins Installation

Wait for a few minutes to complete installation of plugins. As you can see, it will install some default plugins like “Ant”, “Gradle”, “Github Branch Source”, “GIT” etc. 

4. Create the first Admin user and “Save and Continue”. Remember this for future logins. 

Jenkins Installation

5. Let Jenkins URL field remain the same and then “Save and Finish”.

6. Now, here comes the Jenkins Dashboard. Following will be your actual screen which will be the default page now whenever you open Jenkins. Start using Jenkins. 

Exploring Jenkins Dashboard

Jenkins dashboard can be beautified in multiple ways. First screen is the actual dashboard which provides an overview of the whole Jenkins. Let’s try to explain Jenkins dashboard by categorizing it into three parts:

  • Left side

Jenkins Installation

As you can see, the left side of Jenkins dashboard comprises various links. Following will give you a basic idea of each and every link/text.

New Item → Type of Job you want to create 

 People → Users 
 Build History → History of all builds of Jenkins 
 Manage Jenkins → Single point window to administer/manage Jenkins 

 My Views → Job(s) view specific to logged-in user

 Credentials → List of all credentials/secrets stored in Jenkins for third party tools 

 Lockable Resources → If a build requires a resource which is already locked, it will wait for the resource to be free. 

 New View → Used when creating a view for a specific set of jobs. 
 Build queue → List all builds pending to start 

Build Executor Status → List of builds currently executing
  • Middle

Jenkins Installation

Middle part of Jenkins dashboard is having a shortcut to “create new jobs”(as this is the first time). Once jobs are created, Jenkins dashboard will consist of job details or any view (set of jobs) created in the future. You will get all the details regarding jobs like “Job Name”, “Last Success”, “Last Failure” and “Last Duration”.

  • Right

 Install Jenkins on Linux

Right side of Jenkins dashboard mainly describes user and Jenkins general info:

Admin → User Name from which you have logged-in

log-out → to log out from the current user. After logging-out, you will see a log-in option but that too depends how you configure Jenkins. Sometimes, you will see only the login page before the dashboard.

enable auto refresh → Jenkins browser will be refreshed automatically. Once this is clicked, you will see “disable auto refresh” option to disable automatic refreshing of page

add description → To add something about Jenkins for the whole team.

Conclusion

This blog will help you in creating a Jenkins instance on various platforms and through awesome multiple ways as different teams/organizations use their own set of tools. We can’t deny the fact that Jenkins can configure almost each third-party tool and integrate easily with all of them.

So, did you try the Jenkins installation at your end? Please let me know if you were able to successfully create the Jenkins instance or ran into several issues. We can discuss over issues and work for the resolution.After successful completion, now what do you think, can we move ahead and study about most heard concept of Jenkins i.e. “Jenkins pipeline” in the next blog.

Hope This Helps!!

See you soon !!


    Vipin Bansal

    As an experienced DevOps professional, I am having a good understanding of Change and Configuration Management as well. I like to meet new technical challenges and finding effective solutions to meet the needs of the project. I believe in Sharing is Learning.


Comments

Trending Courses

AWS

  • AWS & Fundamentals of Linux
  • Amazon Simple Storage Service
  • Elastic Compute Cloud
  • Databases Overview & Amazon Route 53

Upcoming Class

1 day 21 Sep 2020

DevOps

  • Intro to DevOps
  • GIT and Maven
  • Jenkins & Ansible
  • Docker and Cloud Computing

Upcoming Class

6 days 26 Sep 2020

Data Science

  • Data Science Introduction
  • Hadoop and Spark Overview
  • Python & Intro to R Programming
  • Machine Learning

Upcoming Class

4 days 24 Sep 2020

Hadoop

  • Architecture, HDFS & MapReduce
  • Unix Shell & Apache Pig Installation
  • HIVE Installation & User-Defined Functions
  • SQOOP & Hbase Installation

Upcoming Class

19 days 09 Oct 2020

Salesforce

  • Salesforce Configuration Introduction
  • Security & Automation Process
  • Sales & Service Cloud
  • Apex Programming, SOQL & SOSL

Upcoming Class

1 day 21 Sep 2020

QA

  • Introduction and Software Testing
  • Software Test Life Cycle
  • Automation Testing and API Testing
  • Selenium framework development using Testing

Upcoming Class

10 days 30 Sep 2020

Business Analyst

  • BA & Stakeholders Overview
  • BPMN, Requirement Elicitation
  • BA Tools & Design Documents
  • Enterprise Analysis, Agile & Scrum

Upcoming Class

5 days 25 Sep 2020

MS SQL Server

  • Introduction & Database Query
  • Programming, Indexes & System Functions
  • SSIS Package Development Procedures
  • SSRS Report Design

Upcoming Class

5 days 25 Sep 2020

Python

  • Features of Python
  • Python Editors and IDEs
  • Data types and Variables
  • Python File Operation

Upcoming Class

9 days 29 Sep 2020

Artificial Intelligence

  • Components of AI
  • Categories of Machine Learning
  • Recurrent Neural Networks
  • Recurrent Neural Networks

Upcoming Class

4 days 24 Sep 2020

Machine Learning

  • Introduction to Machine Learning & Python
  • Machine Learning: Supervised Learning
  • Machine Learning: Unsupervised Learning

Upcoming Class

7 days 27 Sep 2020

Tableau

  • Introduction to Tableau Desktop
  • Data Transformation Methods
  • Configuring tableau server
  • Integration with R & Hadoop

Upcoming Class

5 days 25 Sep 2020

Search Posts

Reset

Receive Latest Materials and Offers on DevOps Course

Interviews