In this tutorial we will show you how to install and configuration of Jenkins on CentOS 8. For those of you who didn’t know, Jenkins is an open source continuous integration tool written in Java. Jenkins provides continuous integration services for software development. It is a server-based system running in a servlet container such as Apache Tomcat. It supports SCM tools including AccuRev, CVS, Subversion, Git, Mercurial, Perforce, Clearcase and RTC, and can execute Apache Ant and Apache Maven based projects as well as arbitrary shell scripts and Windows batch commands.
This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo’ to the commands to get root privileges. I will show you through the step by step installation Jenkins on CentOS 8.
Install Jenkins on CentOS 8
Step 1. First let’s start by ensuring your system is up-to-date.
Step 2. Installing Java.
Install JAVA on the server so we can use jenkins properly:
dnf install java-1.8.0-openjdk
Verify the Java version by running the following command:
Step 3. Installing Jenkins on CentOS 8.
First, download and enable Jenkins Repository:
wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo
Now, import Jenkins GPG Key:
rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key
Then, start proceed installation Jenkins:
dnf install jenkins
Now you have to start jenkins service so we can use it and enable it on boot so if system will reboot jenkins will start automatically:
systemctl start jenkins systemctl enable jenkins systemctl status jenkins
Step 4. Configure Firewall.
You know Jenkins is works on port 8080 so we need to allow connection on that port by adding it in firewall:
firewall-cmd --zone=public --permanent --add-port=8080/tcp firewall-cmd --reload
Step 5. Accessing Jenkins.
Jenkins will be available on HTTP port 8080 by default. Open your favorite browser and navigate to http://yourdomain.com:8080 or http://server-ip:8080 and complete the required the steps to finish the installation. Default installation password can be found at /var/lib/jenkins/secrets/initialAdminPassword as showing in below image.
Congratulation’s! You have successfully installed Jenkins. Thanks for using this tutorial for installing Jenkins on CentOS 8 system. For additional help or useful information, we recommend you to check the official Jenkins website.