Jenkins is an opensource and free tool for developers to develop, test and deploy the code continuously. It is developed in Java. Main benefit of Jenkins is to automate the task which helps to save the developer time in development process.
Following are the steps to install Jenkins on Centos 7.
- We will Install JAVA 8 to use Jenkins function.
# sudo yum install java-1.8.0-openjdk-devel
- Verify the JAVA Version.
# java --version
- Add Jenkins repository on centos with the below command.
# curl --silent --location http://pkg.jenkins-ci.org/redhat-stable/jenkins.repo | sudo tee /etc/yum.repos.d/jenkins.repo
- Add Repository in system with below command.
# sudo rpm --import https://jenkins-ci.org/redhat/jenkins-ci.org.key
- After installation of Repository, install Jenkins using below command.
# sudo yum install jenkins
- Start the Jenkins and enable the Jenkins service to start on system boot. # sudo systemctl enable jenkins
# sudo systemctl start jenkins
# sudo systemctl enable jenkins
- Jenkins uses port 8080. If you have the firewall enabled, you will need to allow a port in Firewall.
# sudo firewall-cmd --permanent --zone=public --add-port=8080/tcp # sudo firewall-cmd --reload
- Open Jenkins in Web-browser with IPAddress:8080. We will setup Jenkins further.
- Once you access the Jenkins in web browser,it will ask for the password. Execute the below command to view the password.
# sudo cat /var/lib/jenkins/secrets/initialAdminPassword
- Copy the Password from the terminal and paste into your Jenkins setup.
- Click on the Install suggested plugins Box. It will start the installation process.
- Enter your credentials to Create First Admin User.
- Confirm the URL for the Jenkins and click on Save and Finish.
- At last, click on Start using the Jenkins button. It will redirect you to the Jenkins Dashboard.
This is it. We are done with Jenkins's installation.