How to Install Jenkins in centos 7

Installing jenkins in centos 7


Jenkins is an open source, Java-based automation server that provides an easy way to set up continuous integration and continuous deployment pipeline (CI / CD).

Continuous Integration (CI) is a DevOps practice where team members execute their commitments regularly switching to version control code, after which automation and automation testing are performed. Continuous Delivery (CD) is a series of practices in which code changes are automatically generated, tested, and transferred to production.


This tutorial will walk you through the steps to install Jenkins on the CentOS 7 system using Jenkins’ official site.

Open terminal and the first step is to install Java. Run the following command to install the OpenJDK package:

[root@fosnix ~]# yum install java-1.8.0-openjdk-devel

 This command is used to enable the Jenkins repository, importing the GPG key using the curl command:

[root@fosnix ~]# curl --silent --location | sudo tee /etc/yum.repos.d/jenkins.repo

 By this command, the repository is added to the system.

[root@fosnix ~]# rpm --import

When the repositories are installed completely install the package of Jenkins

[root@fosnix ~]# yum install jenkins

This command is to start the service of Jenkins.

[root@fosnix ~]# systemctl start jenkins

To check whether it started successfully run:

[root@fosnix ~]# systemctl status jenkins

Finally, enable the Jenkins service to start on system boot.

[root@fosnix ~]# sudo systemctl enable jenkins

For adjusting the firewall, we need to run this command and add the port number 8080 permanently in it so the service won’t be interrupted.

[root@fosnix ~]# firewall-cmd --permanent --zone=public --add-port=8080/tcp
[root@fosnix ~]# firewall-cmd --reload
[root@fosnix ~]# firewall-cmd --permanent --zone=public --add-service=http

Now, open your browser and access the URL with your domain or IP address and it will take you to this page.




Go to the above-mentioned location and copy the password and paste it in the box then click on continue

[root@fosnix ~]# cat /var/lib/jenkins/secrets/initialAdminPassword

In the next windows select the option: Install suggested plugins

Let the package complete its installation.

Now, setup the username and password for accessing Jenkins then click on save and continue.

Here, Jenkins is ready to use.


No responses yet

Leave a Reply

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

Latest Comments

No comments to show.