In this article, we will have explained the necessary steps to install Jenkins on Rocky Linux 8. Before continuing with this tutorial, make sure you are logged in as a user with
sudo privileges. All the commands in this tutorial should be run as a non-root user.
Jenkins is an open-source automation server that enables developers around the world to reliably build, test, and deploy their software.
- Operating System with Rocky Linux 8
- Server IPv4 Address with Superuser Privileges (Root Access)
- Gnome Terminal for Linux Desktop
- PuTTy SSH client for Windows or macOS
- Powershell for Windows 10/11
- Familiar with DNF Commands
Install Jenkins on Rocky Linux 8
Step 1. First, before you start installing any package on your Rocky Linux server, we always recommend making sure that all system packages are updated.
sudo dnf install epel-release sudo dnf update sudo dnf upgrade
Step 2. Install Java.
Run the following command below to install Java:
sudo dnf install java-1.8.0-openjdk
Once java is installed, you can verify that the software is installed properly by checking its version:
Step 3. Install Jenkins on the Rocky Linux system.
Add Jenkins YUM repository to Rocky Linux:
sudo tee /etc/yum.repos.d/jenkins.repo<<EOF [jenkins] name=Jenkins-stable baseurl=http://pkg.jenkins.io/redhat-stable gpgcheck=1 EOF
Next, import the public PGP key that the Jenkins official:
rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key
Let’s check if the repository is now available for local use:
sudo dnf repolist
After that, you can install the Jenkins by typing the following command below:
sudo dnf update sudo dnf install jenkins
You can start and check the status of the Jenkins service using the command:
sudo systemctl start jenkins sudo systemctl enable jenkin sudo systemctl status jenkins
Step 4. Configuring the Firewall.
Jenkins uses port 8080 by default for remote access, so you may want to open this port to allow an external connection:
sudo firewall-cmd --permanent --zone=public --add-port=8080/tcp sudo firewall-cmd --reload
Step 5. Accessing Jenkins on Rocky Linux 8 From Web Interface.
After installing and running Jenkins using one of the procedures above, the post-installation setup wizard begins. Now head over to the web browser console on URL:
When you first access a new Jenkins instance, you are asked to unlock it using an automatically generated password:
sudo cat /var/lib/jenkins/secrets/initialAdminPassword
You should see a 32-character long alphanumeric password:
Copy this password value and use it to complete the Administrator password field in the Jenkins web UI. Fill in the password you copied and click the Continue button.
Next, click on the Install suggested plugins box, and the installation process will start immediately:
That’s all you need to do to install Jenkins on Rocky Linux 8. I hope you find this quick tip helpful. For further reading on Jenkins, please refer to their official knowledge base. If you have questions or suggestions, feel free to leave a comment below.