Home / Articles / Devops / jenkins / 2.426.2 / install-jenkins

Install Jenkins

PackageVersion
OSRHEL 8.8
JDK21
Jenkins2.426.2

Prerequisite

  • Download JDK from Official website.
  • # wget -O https://download.oracle.com/java/21/latest/jdk-21_linux-x64_bin.rpm
  • Download Jenkins from Official Website.
  • # wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo # rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io-2023.key # yum download jenkins
  • We have following RPMs available for install.
  • jdk-21_linux-x64_bin.rpm jenkins-2.426.2-1.1.noarch.rpm

    Install JDK & Jenkins

    • Install JDK RPM Package using yum.
    • # yum localinstall jdk-21_linux-x64_bin.rpm -y Dependencies resolved. ==================================================================================================================================================== Package Architecture Version Repository Size ==================================================================================================================================================== Installing: jdk-21 x86_64 2000:21.0.1-12 @commandline 188 M Transaction Summary ==================================================================================================================================================== Install 1 Package Total size: 188 M Installed size: 331 M Downloading Packages: Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Installing : jdk-21-2000:21.0.1-12.x86_64 1/1 Running scriptlet: jdk-21-2000:21.0.1-12.x86_64 1/1 Verifying : jdk-21-2000:21.0.1-12.x86_64 1/1 Installed products updated. Installed: jdk-21-2000:21.0.1-12.x86_64 Complete!
    • Install Jenkins RPM Package using yum.
    • # yum localinstall jenkins-2.426.2-1.1.noarch.rpm -y Dependencies resolved. ==================================================================================================================================================== Package Architecture Version Repository Size ==================================================================================================================================================== Installing: jenkins noarch 2.426.2-1.1 @commandline 85 M Transaction Summary ==================================================================================================================================================== Install 1 Package Total size: 85 M Installed size: 85 M Downloading Packages: Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Running scriptlet: jenkins-2.426.2-1.1.noarch 1/1 Installing : jenkins-2.426.2-1.1.noarch 1/1 Running scriptlet: jenkins-2.426.2-1.1.noarch 1/1 Verifying : jenkins-2.426.2-1.1.noarch 1/1 Installed products updated. Installed: jenkins-2.426.2-1.1.noarch Complete!
    • Check Installed JDK Version.
    • # java --version java 21.0.1 2023-10-17 LTS Java(TM) SE Runtime Environment (build 21.0.1+12-LTS-29) Java HotSpot(TM) 64-Bit Server VM (build 21.0.1+12-LTS-29, mixed mode, sharing)
    • Check Installed Jenkins Version.
    • # jenkins --version 2.426.2

    Start Jenkins Service

    • Start and Enable Jenkins Service using systemctl
    • # systemctl enable jenkins
      # systemctl start jenkins
    • Check Status of Jenkins Service
    • # systemctl status jenkins ● jenkins.service - Jenkins Continuous Integration Server Loaded: loaded (/usr/lib/systemd/system/jenkins.service; disabled; vendor preset: disabled) Active: active (running) since Thu 2024-01-18 17:14:17 CST; 4min 18s ago Main PID: 4500 (java) Tasks: 44 (limit: 12357) Memory: 628.4M CGroup: /system.slice/jenkins.service └─4500 /usr/bin/java -Djava.awt.headless=true -jar /usr/share/java/jenkins.war --webroot=/var/cache/jenkins/war --httpPort=8080 Jan 18 17:13:03 jenkins-62.linuxtechspace.com jenkins[4500]: Jenkins initial setup is required. An admin user has been created and a password gener> Jan 18 17:13:03 jenkins-62.linuxtechspace.com jenkins[4500]: Please use the following password to proceed to installation: Jan 18 17:13:03 jenkins-62.linuxtechspace.com jenkins[4500]: 9c89e016cc204bc6a78567379f6a4122 Jan 18 17:13:03 jenkins-62.linuxtechspace.com jenkins[4500]: This may also be found at: /var/lib/jenkins/secrets/initialAdminPassword Jan 18 17:13:03 jenkins-62.linuxtechspace.com jenkins[4500]: ************************************************************* Jan 18 17:14:16 jenkins-62.linuxtechspace.com jenkins[4500]: 2024-01-18 23:14:16.888+0000 [id=39] INFO jenkins.InitReactorRunner$1#on> Jan 18 17:14:17 jenkins-62.linuxtechspace.com jenkins[4500]: 2024-01-18 23:14:17.026+0000 [id=31] INFO hudson.lifecycle.Lifecycle#onR> Jan 18 17:14:17 jenkins-62.linuxtechspace.com systemd[1]: Started Jenkins Continuous Integration Server. Jan 18 17:14:18 jenkins-62.linuxtechspace.com jenkins[4500]: 2024-01-18 23:14:18.140+0000 [id=56] INFO h.m.DownloadService$Downloadab> Jan 18 17:14:18 jenkins-62.linuxtechspace.com jenkins[4500]: 2024-01-18 23:14:18.142+0000 [id=56] INFO hudson.util.Retrier#start: Per>

    Access Jenkins UI Dashboard

    • Get the initial Admin credentials from setup file.
    • # cat /var/lib/jenkins/secrets/initialAdminPassword
    • Open Jenkins URL in browser.
    • Note: Replace IP Address with your server IP Address

      http://<IP_Address>:8080/
    • At first page, enter the initial Admin credential password that you collected from previous step. Click on Continue button.
    • Click on the "Install Suggested Plugin" option.
    • Wait for all the default plugin to install.
    • Optionally, create another Admin user account and click on "Save and Continue" button.
    • You can leave the default URL setting and click on "Save and Finish" button.
    • Now Jenkins initial setup is complete and its ready for use. Click on the "Start Using Jenkins" button.
    • You now have the Jenkins Dashboard.
    • Jenkins Install is complete.