Jenkins is an open source, Java-based automation server that offers an easy way to set up a continuous integration and continuous delivery (CI/CD) pipeline.
Continuous integration (CI) is a DevOps practice in which team members regularly commits their code changes to the version control repository, after which automated builds and tests are run. Continuous delivery (CD) is a series of practices where code changes are automatically built, tested and deployed to production.
This tutorial will walk you through the steps of installing Jenkins on a CentOS 7 system using the official Jenkins repository.
The current version of Jenkins does not support Java 10 (and Java 11) yet. If you have multiple versions of Java installed on your machine [make sure Java 8 is the default Java version](https://linuxize.com/post/install-java-on-centos-7/#set-the-default-version).
2. The next step is to enable the Jenkins repository. To do that, import the GPG key using the following [`curl`](https://linuxize.com/post/curl-command-examples/) command:
```
```console-bash
curl --silent --location http://pkg.jenkins-ci.org/redhat-stable/jenkins.repo | sudo tee /etc/yum.repos.d/jenkins.repo
```
```
 And add the repository to your system with:
```output
jenkins.service is not a native service, redirecting to /sbin/chkconfig.
Executing /sbin/chkconfig jenkins on
```
```

[Adjust the Firewall](https://linuxize.com/post/how-to-install-jenkins-on-centos-7/#adjust-the-firewall)
--------------------------------------------------------------------------------------------------------
If you are installing Jenkins on a remote CentOS server that is [protected by a firewall](https://linuxize.com/post/how-to-setup-a-firewall-with-firewalld-on-centos-7/) you need to port `8080`.
Use the following commands to open the necessary port:
[Setting Up Jenkins](https://linuxize.com/post/how-to-install-jenkins-on-centos-7/#setting-up-jenkins)
------------------------------------------------------------------------------------------------------
To setup your new Jenkins installation, open your browser and type your domain or IP address followed by port `8080`:
```
```url
http://your_ip_or_domain:8080
```
```
A screen similar to the following will appear, prompting you to enter the Administrator password that is created during the installation:
On the next screen you will be asked whether you want to install the suggested plugins or to select specific plugins. Click on the `Install suggested plugins` box, and the installation process will start immediately.
Once the installation is complete, you will be prompted to set up the first administrative user. Fill out all required information and click `Save and Continue`.
Finally, click on the `Start using Jenkins` button and you will be redirected to the Jenkins dashboard logged in as the admin user you have created in one of the previous steps.
If you’ve reached this point, you’ve successfully installed Jenkins on your CentOS system.
[Conclusion](https://linuxize.com/post/how-to-install-jenkins-on-centos-7/#conclusion)
--------------------------------------------------------------------------------------
In this tutorial, you have learned how to install and complete the initial configuration of Jenkins on CentOS/RHEL based systems. You can now visit the official [Jenkins documentation](https://jenkins.io/doc/) page and start exploring Jenkins’s workflow and plug-in model.
If you have any question, please leave a comment below.
评论区