Jenkins is an open-source automation server that enables developers to build, test, and deploy their software. This article covers the step by step detailed installation of Jenkins on CentOS 7.
Installing Java
Jenkins requires Java to run. Install Java with:
sudo yum install java-1.8.0-openjdk-devel -y
Adding Jenkins Repository
Add the Jenkins repository to your system:
sudo wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo sudo rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key
Installing Jenkins
Now, install Jenkins:
sudo yum install jenkins -y
Starting and Enabling Jenkins
Enable and start the Jenkins service:
sudo systemctl start jenkins sudo systemctl enable jenkins
Configuring Firewall
If your server is protected by a firewall, open the Jenkins port (default: 8080):
sudo firewall-cmd --permanent --zone=public --add-port=8080/tcp sudo firewall-cmd --reload
Accessing Jenkins
Access Jenkins by navigating to `http://your_server_ip_or_domain:8080` in your web browser. You’ll be prompted to enter the initial admin password, found in:
sudo cat /var/lib/jenkins/secrets/initialAdminPassword
Setting Up Jenkins
Follow the instructions on screen to complete the Jenkins setup, including installing suggested plugins and creating an admin user.
Jenkins is now installed and running on your CentOS 7 server. You can begin using Jenkins to automate your development and deployment processes.