Jenkins Installation on Red Hat distributions

On RPM-based distributions, such as Red Hat, CentOS, Fedora etc.. you can install Jenkins through yum.


Jenkins requires Java in order to run. To install the Open Java Development Kit (OpenJDK) run the following:

[root@jenkins-server ~]# yum install java -y
[root@jenkins-server ~]# java -version
openjdk version "1.8.0_161"
OpenJDK Runtime Environment (build 1.8.0_161-b14)
OpenJDK 64-Bit Server VM (build 25.161-b14, mixed mode)
[root@jenkins-server ~]#

Jenkins Installation :

Step 1: Add the Jenkins repository to the yum repos.

[root@jenkins-server ~]# wget -O /etc/yum.repos.d/jenkins.repo
--2018-03-24 08:52:47--
Resolving (
Connecting to (||:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 71
Saving to: ‘/etc/yum.repos.d/jenkins.repo’

100%[==========================================================================================================================>] 71 --.-K/s in 0s

2018-03-24 08:52:51 (13.2 MB/s) - ‘/etc/yum.repos.d/jenkins.repo’ saved [71/71]

[root@jenkins-server ~]#

You can install stable version from below:

wget -O /etc/yum.repos.d/jenkins.repo

Step 2: Add Jenkins key to rpm

[root@jenkins-server ~]# rpm --import
[root@jenkins-server ~]#

Step 3: Run the following command to install Jenkins.

[root@jenkins-server ~]# yum install jenkins -y

Step 4: Restart jenkins service once installation got completed.

[root@jenkins-server ~]# systemctl status jenkins
● jenkins.service - LSB: Jenkins Automation Server
 Loaded: loaded (/etc/rc.d/init.d/jenkins; bad; vendor preset: disabled)
 Active: inactive (dead)
 Docs: man:systemd-sysv-generator(8)
[root@jenkins-server ~]# 
[root@jenkins-server ~]# systemctl restart jenkins
[root@jenkins-server ~]# systemctl status jenkins 
● jenkins.service - LSB: Jenkins Automation Server
 Loaded: loaded (/etc/rc.d/init.d/jenkins; bad; vendor preset: disabled)
 Active: active (running) since Sat 2018-03-24 09:04:51 UTC; 3s ago
 Docs: man:systemd-sysv-generator(8)
 Process: 1192 ExecStart=/etc/rc.d/init.d/jenkins start (code=exited, status=0/SUCCESS)
 CGroup: /system.slice/jenkins.service
 └─1211 /etc/alternatives/java -Dcom.sun.akuma.Daemon=daemonized -Djava.awt.headless=true -DJENKINS_HOME=/var/lib/jenkins -jar /usr/lib/jenkins/jenkins...

Mar 24 09:04:51 jenkins-server systemd[1]: Starting LSB: Jenkins Automation Server...
Mar 24 09:04:51 jenkins-server runuser[1197]: pam_unix(runuser:session): session opened for user jenkins by (uid=0)
Mar 24 09:04:51 jenkins-server jenkins[1192]: Starting Jenkins [ OK ]
Mar 24 09:04:51 jenkins-server systemd[1]: Started LSB: Jenkins Automation Server.
[root@jenkins-server ~]#

Step 5: Enable jenkins service to start on reboot

[root@jenkins-server ~]# systemctl enable jenkins 
jenkins.service is not a native service, redirecting to /sbin/chkconfig.
Executing /sbin/chkconfig jenkins on
[root@jenkins-server ~]#

Now, you can access Jenkins with below url.


It will ask for Administrator password to unlock Jenkins at first time. Run following to get password.

[root@jenkins-server ~]# cat /var/lib/jenkins/secrets/initialAdminPassword
[root@jenkins-server ~]#


Copy paste the password and click on Continue. In next step, click on “Install suggested plugins”.



Once plugins installed successfully, enter user account details and click Save and Finish button.


Now Jenkins is ready to use. Click on Start using Jenkins. It will take you to Jenkins Dashboard where you can create jobs, pipelines etc..



Here, you create your jobs by clicking on New Item and also you can create user accounts, configure your jenkins and install/uninstall plugins etc…