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.
Jenkins server should meet the following minimum hardware requirements to run smoothly.
- 2GB RAM
- 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)
Following are the two mimimim requirements for Jenkins setup.
- Git (Not mandatory)
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
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
Jenkins Installation Methods
Jenkins can be installed in the following ways
- Using yum repository
- 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)
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
Step 2: Run the jar
java -jar jenkins.war
If you want to run
java -jar jenkins.war --httpPort=9090