How to Install Jenkins on Oracle Linux 8.5

To Install Jenkins On Oracle Linux 8.5

Introduction:

Jenkins is an open-source automation tool written in Java with plugins built for Continuous Integration purposes. Jenkins is used to build and test your software projects continuously making it easier for developers to integrate changes to the project, and making it easier for users to obtain a fresh build.

Installation Steps:

Step 1: Check the OS Version by using the below command

[root@linuxhelp linuxhelp]# cat /etc/os-release
NAME="Oracle Linux Server"
VERSION="8.5"

Step 2: Install java package by using the below command

[root@linuxhelp linuxhelp]# yum install java-11-openjdk-devel –y
Installed:
  copy-jdk-configs-4.0-2.el8.noarch                                                                
  java-11-openjdk-1:11.0.15.0.10-2.el8_6.x86_64                                                    
  java-11-openjdk-devel-1:11.0.15.0.10-2.el8_6.x86_64                                              
  java-11-openjdk-headless-1:11.0.15.0.10-2.el8_6.x86_64                                           
  javapackages-filesystem-5.3.0-1.module+el8+5136+7ff78f74.noarch                                  
  lksctp-tools-1.0.18-3.el8.x86_64                                                                 
  ttmkfdir-3.0.9-54.el8.x86_64                                                                     
  tzdata-java-2022a-1.el8.noarch                                                                   
  xorg-x11-fonts-Type1-7.5-19.el8.noarch                                                           

Complete!

Step 3: To Check the Java Version use the below command.

[root@linuxhelp linuxhelp]# java --version
openjdk 11.0.15 2022-04-19 LTS
OpenJDK Runtime Environment 18.9 (build 11.0.15+10-LTS)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.15+10-LTS, mixed mode, sharing)

Step 4: Import the repository key from Jenkins by using the below command

[root@linuxhelp linuxhelp]#  rpm --import https://jenkins-ci.org/redhat/jenkins-ci.org.key

Step 5: Add the repository on the system by using the below command

[root@linuxhelp linuxhelp]# wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat/jenkins.repo
--2022-07-01 05:43:31--  http://pkg.jenkins-ci.org/redhat/jenkins.repo
Resolving pkg.jenkins-ci.org (pkg.jenkins-ci.org)... 52.202.51.185
Connecting to pkg.jenkins-ci.org (pkg.jenkins-ci.org)|52.202.51.185|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 71
Saving to: ‘/etc/yum.repos.d/jenkins.repo’
/etc/yum.repos.d/jenkins 100%[=================================>]      71  --.-KB/s    in 0s      
2022-07-01 05:43:31 (9.18 MB/s) - ‘/etc/yum.repos.d/jenkins.repo’ saved [71/71]

Step 6: Install Jenkins by using the below command.

[root@linuxhelp linuxhelp]# yum install jenkins* -y
Installing:
 jenkins               noarch               2.357-1.1                  jenkins                89 M	
Running transaction
  Preparing        :                                                                           1/1 
  Running scriptlet: jenkins-2.357-1.1.noarch                                                  1/1 
  Installing       : jenkins-2.357-1.1.noarch                                                  1/1 
  Running scriptlet: jenkins-2.357-1.1.noarch                                                  1/1 
  Verifying        : jenkins-2.357-1.1.noarch                                                  1/1 

Installed:
  jenkins-2.357-1.1.noarch                                                                         

Complete!

Step 7: Enable Start and Check the Status of Jenkins by using the below command

[root@linuxhelp linuxhelp]# systemctl enable jenkins
Synchronizing state of jenkins.service with SysV service script with /usr/lib/systemd/systemd-sysv-install.
Executing: /usr/lib/systemd/systemd-sysv-install enable jenkins
Created symlink /etc/systemd/system/multi-user.target.wants/jenkins.service → /usr/lib/systemd/system/jenkins.service.

[root@linuxhelp linuxhelp]# systemctl start Jenkins

[root@linuxhelp linuxhelp]# systemctl status jenkins
● jenkins.service - Jenkins Continuous Integration Server
   Loaded: loaded (/usr/lib/systemd/system/jenkins.service; enabled; vendor preset: disabled)
   Active: active (running) since Fri 2022-07-01 05:46:44 IST; 17s ago

Step 8: Add the port Number in Firewall by using the below command

[root@linuxhelp linuxhelp]# firewall-cmd --add-port=8080/tcp --permanent
success
[root@linuxhelp linuxhelp]# firewall-cmd --reload
Success 
[root@linuxhelp linuxhelp]# firewall-cmd --list-all
public (active)
  target: default
  icmp-block-inversion: no
  interfaces: ens160
  sources: 
  services: cockpit dhcpv6-client ssh
  ports: 8080/tcp
  protocols: 
  forward: no
  masquerade: no
  forward-ports: 
  source-ports: 
  icmp-blocks: 
  rich rules:

Step 9: Open the browser and enter the ip address with port number as shown in the below images

Step 10: Copy the Password to Unlcok Jenkins by using the below command

[root@linuxhelp linuxhelp]# vi /var/lib/jenkins/secrets/initialAdminPassword
c5b252e3adce49bc8b6f6ff1e59743d2

Step 11: Install Plugins and Create Admin user as shown in the below images

Step 12: This is the Dashboard of Jenkins

Conclusion:

We have reached the end of this article. In this guide, we have walked you through the steps required to Install Jenkins on Oracle Linux 8.5. Your feedback is much welcome.

FAQ
Q
How reduce Jenkins memory usage?
A
One is to make sure you're rotating your build history or discarding your old builds.
Q
How does Jenkins choose a node?
A
By default, Jenkins employs the algorithm known as consistent hashing to make this decision.
Q
What is an agent in Jenkins?
A
An agent is typically a machine, or container, which connects to a Jenkins controller and executes tasks when directed by the controller.
Q
What are Jenkins plugins?
A
Plugins are the primary means of enhancing the functionality of a Jenkins environment to suit organization- or user-specific needs.
Q
Is Jenkins a CI tool or both CI CD?
A
Jenkins is a popular open-source tool for CI/CD that is free to use.