Install Jenkins on RHEL9 or CentOS9

Install Jenkins on RHEL9

Are you tired of manually building, testing, and deploying your software? Learn how to install Jenkins on RHEL9 or CentOS9 and automate your software development processes to increase productivity and reduce time to market.

Table of Contents

Introduction

Jenkins is a popular open-source automation server that helps to automate software development processes like building, testing, and deploying software. Jenkins was initially developed as the Hudson project in 2004, but the project was forked in 2011 and renamed Jenkins. Since then, Jenkins has become a go-to tool for DevOps professionals looking to streamline software development and delivery processes.

What is Jenkins?

Jenkins is an automation server that allows developers to automate repetitive tasks associated with building, testing, and deploying software. Jenkins provides a powerful set of features and plugins that help teams to streamline their software development processes, increase productivity, and reduce time to market. With Jenkins, developers can automate tasks like building and testing code, deploying software, and monitoring performance.

Install Jenkins on RHEL9

Photo by Jeff Tan from Pixabay

Minimum System Requirements

Before installing Jenkins, it’s essential to ensure that your system meets the minimum requirements. The minimum system requirements for running Jenkins are:

  • A minimum of 512 MB RAM
  • A minimum of 10 GB of free disk space
  • A CPU with a minimum clock speed of 2.0 GHz
  • Java Runtime Environment (JRE) 8 or higher installed on the system

Install Jenkins on RHEL9: Installation

In this section, we will walk you through the steps to install Jenkins on RHEL9 or CentOS9 using the command line. The installation process involves the following steps:

Step 1: Install Java

The first step is to ensure that Java is installed on the system. You can check if Java is already installed by running the following command:

				
					$ java -version
-bash: java: command not found

				
			

If Java is not installed, you can install it using the following command:

				
					$ sudo dnf install java-11-openjdk-devel -y

				
			

Step 2: Install Jenkins

Once Java is installed, you can proceed to install Jenkins by running the following commands:

				
					$ sudo wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo

$ sudo rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key

$ sudo dnf upgrade

$ sudo dnf install jenkins

				
			

Step 3: Start Jenkins

Once Jenkins is installed, you can start the service by running the following command:

				
					$ sudo systemctl status jenkins
○ jenkins.service - Jenkins Continuous Integration Server
     Loaded: loaded (/usr/lib/systemd/system/jenkins.service; enabled; preset: disabled)
     Active: inactive (dead)

$ sudo systemctl start jenkins
				
			

Enable the jenkins.service to automatically start on boot up.

				
					$ sudo systemctl is-enabled jenkins
disabled

$ sudo systemctl enable jenkins
Created symlink /etc/systemd/system/multi-user.target.wants/jenkins.service → /usr/lib/systemd/system/jenkins.service.
				
			

Step 4: Configure Jenkins

You can access the Jenkins web interface by navigating to http://<your_server_IP>:8080 in your web browser.

The first time you access the interface, you will be prompted to enter an administrator password. The password can be found in the /var/lib/jenkins/secrets/initialAdminPassword file.

Install Jenkins on RHEL9

Photo by admingeek from Infotechys

Step 5: Customize Jenkins

You will also be presented with the following two options: Install suggested plugins and select plugins to Install. For the purposes of this example, we’re going with the first option.

Install Jenkins on RHEL9

Photo by admingeek from Infotechys

Select the option that suits your organization’s needs and proceed with the setup wizard.

Install Jenkins on RHEL9

Photo by admingeek from Infotechys

Step 6: Getting Started

Set up an account by entering a username, password, full name,  and email address. You can also select the skip option to continue as the admin user.

Also, you will be presented with the URL for your Jenkins instance at port 8080. Confirm and proceed. Note: It’s best practice to secure your Jenkins instance by enabling SSL certificates.

Photo by admingeek from Infotechys

That’s it! We’ve successfully installed Jenkins on RHEL9. The same instructions will work for a CentOS9 installation.

Best Practices

When installing Jenkins, there are some best practices that you should follow to ensure that your installation is secure and efficient. These include:

  • Use a non-root user to run Jenkins
  • Keep Jenkins up to date with the latest security patches and updates
  • Limit access to Jenkins to only authorized users
  • Use strong passwords for user accounts and avoid using the default admin account
  • Secure Jenkins by enabling SSL certificates
  • Configure backup and restore processes for Jenkins to prevent data loss

Conclusion

Jenkins is a powerful tool that can help streamline software development processes and improve team productivity. By following the steps outlined in this article, you can install Jenkins on RHEL9 or CentOS9 and start automating your software development processes.

Remember to follow best practices to ensure that your installation is secure and efficient. Was this article helpful to you? If so, leave us a comment below and share!

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *