Friday , December 6 2019
Home / Uncategorized / How to install Jenkins on CentOS 7

How to install Jenkins on CentOS 7



Jenkins is a Java-based open source automation server that provides an easy way to set up an integration and continuous delivery (CI / CD) pipeline.

This tutorial will guide you through the steps of installing Jenkins on a CentOS 7 system using the official Jenkins repository.

Prerequisites

Before continuing with this tutorial, make sure you have logged in as a sudo user.

Installation of Jenkins

To install Jenkins on your CentOS system, follow these steps:

  1. Jenkins is a Java application, so the first step is to install Java. A The following command to install the OpenJDK 8 package:

    The current version of Jenkins does not yet support Java 10 (and Java 11). If you have multiple versions of Java installed on your computer, make sure that Java 8 is the default Java version.

  2. The next step is to enable the Jenkins repository. To do so, import the GPG key using the following curl up command:

    And add the repository to your system with:

  3. Once the repository is enabled, install the latest stable version of Jenkins by typing:

    At the end of the installation process, start the Jenkins service with:

    To check if it started correctly:

    You should see something like this:

Adjust the firewall

If you install Jenkins on a remote CentOS server that is protected by a firewall, you need to port it 8080.

Use the following commands to open the necessary port:

Advertisement

Set up Jenkins

To configure your new installation of Jenkins, open your browser and type in your domain or IP address followed by the port 8080:

A screen similar to the following will appear, asking you to enter the administrator password that is created during the installation:

Use the following command to print the password on the terminal:

You should see a long 32-character alphanumeric password as shown below:

Copy the password from your terminal, paste it in the Administrator password field and click Go on.

On the next screen, you'll be asked if you'd like to install the recommended plug-ins or select specific plug-ins. Click on Install the suggested plugins box, and the installation process will start immediately.

Once the installation is complete, you will be prompted to configure the first administrative user. Fill in all the required information and click Save and continue.

On the next page you will be asked to set the URL for the Jenkins instance. The archived URL will be populated with an automatically generated URL.

To complete the configuration, confirm the URL by clicking on the Save and Finish button.

Finally, click on Start using Jenkins button and you will be redirected to the Jenkins dashboard registered as an admin user you created in one of the previous steps.

If you've reached this point, you've successfully installed Jenkins on your CentOS system.

Conclusion

In this tutorial, you learned how to install and complete the initial Jenkins setup on CentOS / RHEL-based systems. You can now visit the official Jenkins documentation page and start exploring Jenkins' workflow and plug-in model.

If you have any questions, please leave a comment below.


Source link

Leave a Reply

Your email address will not be published.