Jenkins Installtion Guide: Step by Step Instruction For Linux

This guide will help in Jenkins installation using step by step instructions. It explains the different methods to setup jenkins on a Linux server.

Hardware Requirements

Jenkins server should meet the following minimum hardware requirements to run smoothly.

  1. 2GB RAM
  2. 30GB Hard disk (Better to have a additional disk for storing Jenkins data)

Note: This tutorila will work only on Redhat based Linux systems (Redhat & centos)

Prerequisites

Following are the two mimimim requirements for Jenkins setup.

  1. Java
  2. Git (Not mandatory)

Java Installation

Java is a primary requirement for Jenkins as it is a java based application.

Step 1: Install java jdk

sudo yum install -y java-1.8.0-openjdk-devel

Step 2: Verify java installation

java -version

Git Installation

git is not a mandatory requirement. However, most of your Jenkins operations will be based on git. So it is better to have it installed on the Jenkins server.

Step 1: Install git

sudo yum install -y git

Step 2: Verify git installation

git --version

Jenkins Installation Methods

Jenkins can be installed in the following ways

  1. Using yum repository
  2. Using jenkins war file

Jenkins Installation Using yum Repo

Step 1: Add the Jenkins repo to the server

sudo wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat/jenkins.repo
sudo rpm --import https://jenkins-ci.org/redhat/jenkins-ci.org.key

Step 2: Using the following command, find the specific version of Jenkins that you need.

sudo yum --showduplicates list jenkins | expand

Step 3: Install jenkins by following the below syntax.

sudo yum install -y jenkins-(package-info)

For example,

sudo yum install -y jenkins-2.156-1.1

Step 4: Start and enable jenkins service

sudo chkconfig jenkins on
sudo systemctl start jenkins

Step 4: check the jenkins service status

sudo systemctl status jenkins

You will be able to access Jenkins on port 8080.

Jenkins Installation Using Jenkins war File

Step 1: Download the latest jenkins war file from here

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

Step 2: Run the jar

java -jar jenkins.war

If you want to run jenkins on a custom port, execute the jar with –port flag as shown below.

java -jar jenkins.war --httpPort=9090

Other Jenkins Resources:

  1. How To Backup Jenkins Data And Configurations
  2. How To Setup Custom UI Theme For Jenkins

Other Interesting Blogs

Leave a Comment

0 Shares
Share via
Copy link
Powered by Social Snap