In this tutorial, we will show you how to install 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 the step-by-step installation of Jenkins on CentOS 8.
Install Jenkins on CentOS 8
Step 1. First, let’s start by ensuring your system is up-to-date.
sudo dnf update
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 to proceed installation Jenkins:
dnf install jenkins
Now you have to start the Jenkins service so we can use it and enable it on boot so if the system will reboot Jenkins will start automatically:
systemctl start jenkins systemctl enable jenkins systemctl status jenkins
Step 4. Configure Firewall.
You know Jenkins is working on port 8080 so we need to allow connection on that port by adding it to the firewall:
firewall-cmd --zone=public --permanent --add-port=8080/tcp firewall-cmd --reload
Step 5. Accessing Jenkins Web Interface.
Jenkins will be available on HTTP port 8080 by default. Open your favorite browser and navigate to
http://server-ip:8080 and complete the required steps to finish the installation. Default installation password can be found at
/var/lib/jenkins/secrets/initialAdminPassword as showing in the below image.
Congratulations! 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.