Let's look at the steps required to install Jenkins on CentOS.
Installing Jenkins 2 on CentOS
Getting ready
For a business unit, it is advisable to have the following requirements:
- Java 8
- 4 GB+ RAM
- 500 GB+ free disk space
Jenkins requires Java. To install Java, execute:
sudo yum install java
How to do it...
- Jenkins' stable and recent versions are available in a YUM repository.
- Add the Jenkins repository to the yum repos:
sudo wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat/jenkins.repo
- For the stable version, execute:
sudo wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat-stable/jenkins.repo
- Import the following key:
sudo rpm --import https://jenkins-ci.org/redhat/jenkins-ci.org.key
- Install Jenkins by executing the following command:
sudo yum install jenkins
There's more...
- To start the Jenkins service, execute:
sudo service jenkins start
- To stop the Jenkins service, execute:
sudo service jenkins stop
- To restart the Jenkins service, execute:
sudo service jenkins restart