Jenkins Installation On CentOS7

TechWeed
3 min readMar 30, 2022

Step-by-Step process to install Jenkins on your CentOS machine like a pro !!

Jenkins Setup on CentOS7

To install Jenkins, we require JAVA to be installed, as Jenkins is written in Java. We also require wget to retrieve files using internet protocols like, HTTP and FTP.

  • To install java run the following command in your terminal
sudo yum -y install java-1.8*
  • To check whether Java is installed properly run this command
java
  • To install wget run the following command in your terminal
sudo yum -y install wget

Run the following command in your terminal to update jenkins.repo file

sudo vi /etc/yum.repos.d/jenkins.repo
  • Update jenkins.repo file in /etc/yum.repos.d/
[jenkins]
name=Jenkins-stable
baseurl=http://pkg.jenkins.io/redhat-stable
gpgcheck=1
  • Now to import the key from jenkins, run the following command in your terminal
sudo rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key

Note: If you’ve previously imported the key from Jenkins, the rpm --import will fail because you already have a key.

  • To install EPEL repository which is required to provide free and open source packages that are not available in the official package repository of RHEL and CentOS to extend the functionalities, run the following command in your terminal
sudo yum -y install epel-release
  • Now our key has been imported, now the main process starts, we can now install Jenkins, run the following command in your terminal
sudo yum -y install jenkins
  • To enable the service, run the following command in your terminal
sudo systemctl enable jenkins
  • To start the service, run the following command in your terminal
sudo systemctl start jenkins
  • Jenkins runs on port 8080, run the following command in your terminal
sudo netstat -ntpl | grep 8080
  • You can check the status of the Jenkins service using the command:
sudo systemctl status jenkins

By following the above steps Jenkins is all set and ready to use, you can access Jenkins on

http://localhost:8080
  • To unlock Jenkins”, you will need the administrator password, run the following command in your terminal to access the password
sudo cat /var/lib/jenkins/secrets/initialAdminPassword
  • Copy the password shown in CLI(Command Line Interface) and paste it.
Unlocking Jenkins
  • After following the above step you will be prompted to install plugins, you can skip the part, click on “Select plugins to install”
Customizing Jenkins with plugins

NOTE: Don’t install any plugins select “NONE” and click on “INSTALL”, you can install plugins later when required.

  • After the above step is done, it will prompt to create the first Admin user
Creating Admin User for Jenkins
  • After creating the admin user Jenkins is all set up and ready to use.
Jenkins Dashboard

By following the above steps now you have successfully installed Jenkins up and running on your CentOS 7 machine !! Like A PRO !!

--

--

TechWeed

Embark on my TECHIE journey, and together, let's explore the world of technology. Follow along and discover insightful learnings along the way!