How to Set Up Jenkins on Rocky Linux in VirtualBox | Step-by-Step Guide

Are you looking to set up Jenkins on Rocky Linux in VirtualBox? Jenkins, one of the most popular tools for automating software builds, tests, and deployments, can help streamline your DevOps workflows. Setting up Jenkins in a VirtualBox VM running Rocky Linux is a practical way to get started and enhance your skills.

In this guide, we’ll walk you through the step-by-step process to set up Jenkins on Rocky Linux in VirtualBox. Watch the complete tutorial to see each step in action.


Step-by-Step Guide to Set Up Jenkins on Rocky Linux in VirtualBox

Step 1: Preparing the Environment for Jenkins

Before you start the process to set up Jenkins on Rocky Linux in VirtualBox, ensure the following:

  1. Rocky Linux is installed on your VirtualBox VM. Need help? Watch our video on how to install Rocky Linux on VirtualBox.
  2. Your system is updated:
    sudo dnf update -y  
    

Step 2: Installing Java for Jenkins

Jenkins requires Java to run. Follow these steps to install Java:

  1. Install OpenJDK 11, the recommended version for Jenkins:
    sudo dnf install java-11-openjdk -y  
    
  2. Verify the Java installation:
    java -version  
    

Step 3: Adding the Jenkins Repository on Rocky Linux

To set up Jenkins on Rocky Linux, we first need to add its official repository:

  1. Install wget:
    sudo dnf install wget -y  
    
  2. Add the Jenkins repository:
    wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo  
    
  3. Import the GPG key:
    sudo rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key  
    

Step 4: Installing Jenkins on Rocky Linux

After setting up the repository, install Jenkins by running:

  1. Install Jenkins:
    sudo dnf install jenkins -y  
    
  2. Start and enable Jenkins:
    sudo systemctl start jenkins  
    sudo systemctl enable jenkins  
    

Step 5: Configuring the Firewall for Jenkins

By default, Jenkins uses port 8080. Open this port to allow access:

  1. Add a firewall rule:
    sudo firewall-cmd --permanent --add-port=8080/tcp  
    
  2. Reload the firewall:
    sudo firewall-cmd --reload  
    

Step 6: Accessing Jenkins on Rocky Linux

  1. Open your web browser and enter the IP address of your VM followed by :8080. Example:
    http://192.168.1.100:8080  
    
  2. Retrieve the initial admin password:
    sudo cat /var/lib/jenkins/secrets/initialAdminPassword  
    
  3. Paste the password into the browser, complete the setup wizard, and install the recommended plugins.

FAQs

Q1: What are the prerequisites to set up Jenkins on Rocky Linux in VirtualBox?
You need Rocky Linux installed on VirtualBox, an updated system, and internet access.

Q2: Why is Jenkins an essential tool for DevOps?
Jenkins automates build, test, and deployment processes, making it a vital component of CI/CD pipelines.

Q3: How can I troubleshoot Jenkins setup issues?
Check logs in /var/log/jenkins/jenkins.log and ensure Java is correctly installed.

Q4: Can I change Jenkins’ default port?
Yes, edit the /etc/sysconfig/jenkins file and modify the JENKINS_PORT variable.

Q5: Is VirtualBox the only way to practice Jenkins?
No, you can also use Docker, cloud services, or local installations for Jenkins practice.


Conclusion

By following this guide, you’ve successfully set up Jenkins on Rocky Linux in VirtualBox. This configuration is perfect for learning Jenkins and experimenting with its features in a safe environment.

For a detailed walkthrough, watch the video tutorial here. Don’t forget to share your feedback and stay tuned for more DevOps tutorials!

See also:

List of monitoring tools 

Linux Blogs

AWS Cloud Blogs

Database Blogs

DevOps Blogs

Interview Questions & Answers

Docker Blogs

Google Cloud Blogs







Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.