Jenkins Installation on RHEL
Pre-requisites:-
1. Java 8 or later
2. Port 8080 should be allowed on firewall
3. 256 MB RAM
4. 1 GB HDD
Steps to install and configure Jenkins:-
1. Install java
As Jenkins is based on java so first of all we need to install Java 8 or later.
Here we are going to install java 17
Java can be downloaded from the below given link-
[Link]
# wget [Link]
After downloading the java, install it using command rpm –ivh
# rpm -ivh jdk-17_linux-x64_bin.rpm
We can check the installed java version
# java -version
After installing java, we can proceed towards installation of jenkins.
1
2. Install Jenkins
We can download the jenkins rpm file from below link.
[Link]
# wget [Link]
Then install jenkins using command rpm –ivh
# rpm -ivh [Link]
After installation run the below commands to enable and start the Jenkins service.
# systemctl daemon-reload
# systemctl enable jenkins
# systemctl start jenkins
# systemctl status jenkins
To access jenkins url from external system, firewall can be configured to allow jenkins default port
8080.
# firewall-cmd --permanent --zone=public --add-port=8080/tcp
# firewall-cmd --reload
3. Setup Jenkins
Once, Jenkins basic configurations are done on jenkins server, we need to set up the Jenkins
before accessing the Jenkins web interface.
Open a browser and Access Jenkins url [Link]
2
First, we need to unlock Jenkins using a password.
The password file is /var/lib/Jenkins/secrets/initialAdminPassword
# cat /var/lib/Jenkins/secrets/initialAdminPassword
Copy the password and paste it in the text field & click on continue.
3
Two options will be shown ‘Install suggested plugins’ or ‘Select plugins to install’. We proceed with
the ‘Install suggested plugins’ option as of now.
Installation of Jenkins plugins has been started. It will take some time to complete the installation.
Create the Admin account for Jenkins Portal. Here we use username as ‘devops’.
4
In ‘Instance Configuration’ page, it will ask to set the default URL for the Jenkins. Click on Save and
Finish to proceed.
Jenkins installation has been completed successfully.
5
Now, we can work on Jenkins by clicking on Start using Jenkins.
Jenkins’s dashboard will appear as below.
6
SSL configuration
Create a directory openssl in /opt/ directory
Create self-signed certificate and a key
# openssl req -newkey rsa:4096 -x509 -sha256 -days 3650 -nodes -out [Link] -keyout [Link]
Test the certificate is correct
# openssl x509 -in [Link] -noout –text