Previously during software development, developers would submit their code to a code repository like GitHub or Git Lab usually, the source code would be fraught with bugs and errors. To make it even worse, developers would have to wait until the entire source code was built & tested to check for errors. This was tedious, time-consuming and frustrating. There was no iterative improvement of code, and overall, the software delivery process was slow. Then came Jenkins.
Jenkins is a free and opensource continuous integration tool written in Java that allows developers to continuously develop, test and deploy code in a simple and effective way. It automates tasks thereby saving time and takes away the stressful part of the software development process.
In this article, we demonstrate how you can install Jenkins on CentOS 8 Linux.
Step 1: Install Java on CentOS 8
For Jenkins to function, you need to install either Java JRE 8 or Java 11. In the example below, we decided to go with the installation of Java 11. Therefore, to install Java 11, run the command.
# dnf install java-11-openjdk-devel
To verify the installation of Java 11, run the command.
# java --version
The output confirms that Java 11 has been successfully installed.
Step 2: Add Jenkins Repository on CentOS 8
Since Jenkins is not available in CentOS 8 repositories, therefore we are going to add Jenkins Repository manually to the system.
Begin by adding Jenkins Key as shown.
# rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key
Now append Jenkinβs repository to CentOS 8.
# cd /etc/yum/repos.d/ # curl -O https://pkg.jenkins.io/redhat-stable/jenkins.repo
Step 3: Install Jenkins on CentOS 8
Having successfully added Jenkins repository, you can proceed to install Jenkins by running.
# dnf install jenkins
Once installed, start and verify the status of Jenkins by executing the commands.
# systemctl start jenkins # systemctl status jenkins
The output above shows that Jenkins is up and running.
Next, you need to configure the firewall to allow access to port 8080 which is used by Jenkins. To open the port on the firewall, run the commands.
# firewall-cmd --add-port=8080/tcp --permanent # firewall-cmd --reload
Step 4: Setting up Jenkins on CentOS 8
With the initial configurations done, the only remaining part is setting up Jenkins on a web browser. To achieve this, browse your serverβs IP address as shown:
http://server-IP:8080
The first section requires you to unlock Jenkins using a password. This password is placed in the file /var/lib/Jenkins/secrets/initialAdminPassword file.
To read the password, simply use the cat command as shown.
# cat /var/lib/Jenkins/secrets/initialAdminPassword
Copy & paste the password in the Administrator password text field & click βContinueβ.
In the second stage, you will be presented with 2 options: βInstall using suggested pluginsβ or βSelect plugins to installβ.
For now, click on βInstall using suggested pluginsβ to install essential plugins for our setup.
Shortly, the installation of the plugins will get underway.
In the next section, fill out the fields in order to create the First Admin user. After you are done, click on βSave and continueβ.
The βInstance Configurationβ section will provide you with the default Jenkins URL. For simplicity, itβs recommended to leave it as it is and click βSave and Finishβ.
At this point, Jenkins setup is now complete. To access the Jenkins dashboard, simply click on βStart using Jenkinsβ.
Jenkinsβs dashboard is displayed below.
Next time you log into Jenkins, simply provide the Admin username and the password you specified when creating the Admin user.
Conclusion
That was a step-by-step procedure of how to install Jenkins Continuous Integration tool on CentOS 8. To learn more about Jenkins. Read Jenkins Documentation. Your feedback on this guide is most welcome.
If this article helped you solve a problem, consider buying a coffee. It helps keep TecMint free, supports the authors, and keeps the project going.

Got Something to Say? Join the Discussion... Cancel reply