How to do install and setup Jenkins on CentOS 7

Installing Jenkins

To install Jenkins on your CentOS system, follow the steps below:

Jenkins is a java-application, so the first step is to install java.

yum install java-1.8.0-openjdk-devel

Next step is to enable the Jenkins repository. To do that, import the GPG key using the following curl command:

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

And add the repository to your system with:

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

Once the repository is enabled, install the latest stable version of Jenkins by typing:

yum install jenkins

After the installation process is completed, start the Jenkins service with:

systemctl start jenkins
systemctl status jenkins
systemctl enable jenkins

Configure the firewall to allow access for the Jenkins portal from external machines

firewall-cmd –permanent –add-port=8080/tcp
firewall-cmd –reload

Open  web browser and go to the following URL.

http://your.ip.add.ress:8080

For security reasons, Jenkins puts up the initial password in /var/lib/Jenkins/secrets/initialAdminPassword file to prevent an unauthorised Jenkins installation. To unlock Jenkins copy the initial password and put into the administrator password section.

run this command to get the initialAdminPassword

cat /var/lib/jenkins/secrets/initialAdminPassword 
817376e8d1e44fffaafa66ce3a983f33

After this you will see the window and click on “install suggested plugin”

After installation your Jenkins is ready ?. Now you can create your first job and enjoy the CI/CD tool.

Also checkout This Setup:- How to migrate GitLab from one server to another on CentOS7

Leave a Reply

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