How to install Jenkins on CentOS 8
Installing Jenkins on CentOS 8 requires the use of an root account or an account with sudo privileges. Because Jenkins is written in Java, you need to install the Java environment
1. Install OpenJDK.
Sudo dnf install java-1.8.0-openjdk-devel
2. Enable Jenkins repository. Run the following command to download and import the GPG key
Sudo wget-O / etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat-stable/jenkins.repo
Sudo rpm-- import https://jenkins-ci.org/redhat/jenkins-ci.org.key
Install the latest stable version of Jenkins by typing the following command
Sudo dnf install jenkins
Or download jenkins-2.190.3-1.1.noarch.rpm from https://pkg.jenkins.io/redhat-stable/
Sudo dnf install jenkins-2.190.3-1.1.noarch.rpm
Start the Jenkins service and enable it to start when the system boots
Sudo systemctl start jenkins
Sudo systemctl enable jenkins
5. Check whether Jenkins is running
Systemctl status jenkins
6. Open the necessary ports using the following command
Sudo firewall-cmd-permanent-zone=public-add-port=8080/tcp
Sudo firewall-cmd-reload
7. Browser http://ip: 8080
8. Cat command to view the administrator account password of Jenkins on server CentOS 8
Sudo cat / var/lib/jenkins/secrets/initialAdminPassword
9. Copy the password from the terminal, paste it into the Administrator password field, and then click continue
10. Click the "install recommended plug-ins" box, and the installation process will begin
11 、
Jenkins was successfully installed on the CentOS system