RHEL 8 install Jenkins server with JDK 17

This article will document detail steps on Jenkins fresh install with JDK 17 support

Remove existing JDK

Run below command to check any existing jdk installed on RHEL 8 server

rpm -qa | grep jdk

Follow jenkins official link to install long-term support version

Get jenkins repo

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

Import jenkins repo

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

Run system upgrade command

sudo dnf upgrade

Sample output after above command

Updating Subscription Management repositories.
Jenkins-stable                                                                                                                                                                                                                                 49 kB/s |  27 kB     00:00    
Dependencies resolved.
Nothing to do.
Complete!

Install required dependencies

sudo dnf install fontconfig java-17-openjdk

Install Jenkins

sudo dnf install jenkins

Start Jenkins

Enable Jenkins

sudo systemctl enable jenkins

Start Jenkins Server

sudo systemctl start jenkins

Check jenkins status

sudo systemctl status jenkins

Sample output

● jenkins.service - Jenkins Continuous Integration Server
   Loaded: loaded (/usr/lib/systemd/system/jenkins.service; enabled; vendor preset: disabled)
   Active: active (running) since Fri 2023-11-03 12:57:44 EDT; 51min ago
 Main PID: 7813 (java)
    Tasks: 61 (limit: 203625)
   Memory: 3.6G
   CGroup: /system.slice/jenkins.service
           └─7813 /usr/bin/java -Djava.awt.headless=true -jar /usr/share/java/jenkins.war --webroot=/var/cache/jenkins/war --httpPort=8080

Nov 03 12:57:42 rhel8-devops jenkins[7813]: 2023-11-03 16:57:42.908+0000 [id=42]        INFO        jenkins.InitReactorRunner$1#onAttained: Started all plugins
Nov 03 12:57:42 rhel8-devops jenkins[7813]: 2023-11-03 16:57:42.916+0000 [id=34]        INFO        jenkins.InitReactorRunner$1#onAttained: Augmented all extensions
Nov 03 12:57:43 rhel8-devops jenkins[7813]: 2023-11-03 16:57:43.371+0000 [id=35]        INFO        h.p.b.g.GlobalTimeOutConfiguration#load: global timeout not set
Nov 03 12:57:43 rhel8-devops jenkins[7813]: 2023-11-03 16:57:43.847+0000 [id=44]        INFO        jenkins.InitReactorRunner$1#onAttained: System config loaded
Nov 03 12:57:43 rhel8-devops jenkins[7813]: 2023-11-03 16:57:43.849+0000 [id=44]        INFO        jenkins.InitReactorRunner$1#onAttained: System config adapted
Nov 03 12:57:43 rhel8-devops jenkins[7813]: 2023-11-03 16:57:43.947+0000 [id=39]        INFO        jenkins.InitReactorRunner$1#onAttained: Loaded all jobs
Nov 03 12:57:43 rhel8-devops jenkins[7813]: 2023-11-03 16:57:43.968+0000 [id=32]        INFO        jenkins.InitReactorRunner$1#onAttained: Configuration for all jobs updated
Nov 03 12:57:44 rhel8-devops jenkins[7813]: 2023-11-03 16:57:44.027+0000 [id=48]        INFO        jenkins.InitReactorRunner$1#onAttained: Completed initialization
Nov 03 12:57:44 rhel8-devops jenkins[7813]: 2023-11-03 16:57:44.141+0000 [id=26]        INFO        hudson.lifecycle.Lifecycle#onReady: Jenkins is fully up and running
Nov 03 12:57:44 rhel8-devops systemd[1]: Started Jenkins Continuous Integration Server.

Open firewall port (8080) if it’s not

YOURPORT=8080
PERM="--permanent"
SERV="$PERM --service=jenkins"

firewall-cmd $PERM --new-service=jenkins
firewall-cmd $SERV --set-short="Jenkins ports"
firewall-cmd $SERV --set-description="Jenkins port exceptions"
firewall-cmd $SERV --add-port=$YOURPORT/tcp
firewall-cmd $PERM --add-service=jenkins
firewall-cmd --zone=public --add-service=http --permanent
firewall-cmd --reload

Go to your jenkins server install IP:8080 and follow the instruction to complete the setup.

Reference

Leave a Comment

Your email address will not be published. Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.

Scroll to Top