Steps to install Jenkins in centOS/RHEL
Step 1: Install Java OpenJDK on CentOS 7
Jenkins requires Java in order to run, but CentOS 7 doesn’t include it by default. To install the Open Java Development Kit (OpenJDK) run the following:
Enter the command to install epel release:
sudo yum –y install epel-release
Package will show the download size and installation size:
Enter “Y” to install the package
Enter the command to check the Java Version installed in the machine:
Java -version
Step 2: Add Jenkins RPM repository
Start by importing the repository key from Jenkins and After importing the key, add the repository to the system
sudo rpm --import https://jenkins-ci.org/redhat/jenkins-ci.org.key
sudo yum -y install wget
sudo wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat/jenkins.repo
Step 3: Install Jenkins on RHEL 8 / CentOS 7
Then install Jenkins package using yum:
sudo yum -y install Jenkins
After installation, start and enable Jenkins service using the below commands:
sudo systemctl start jenkins
sudo systemctl enable jenkins
To check the status of Jenkins service, Use the below command:
systemctl satus jenkins
Allow port 8080/tcp on the firewall and reload:
sudo firewall-cmd --add-port=8080/tcp --permanent
sudo firewall-cmd --reload
sudo firewall-cmd --list-all
Step 4: Configure Jenkins on RHEL / CentOS 7
Browse to the URL http://[serverip|hostname]:8080 to access web installation wizard.
When you first access a new Jenkins instance, you are asked to unlock it using an automatically generated password.
Enter the below command to view the password:(use sudo command to avoid access denied error)
cat /var/lib/jenkins/secrets/initialAdminPassword
Copy-paste the automatically-generated alphanumeric password into the Administrator password field and click Continue.
Select Plugins to Install
Create Admin User/Password
Comments
Post a Comment