{"id":774,"date":"2020-04-03T05:22:00","date_gmt":"2020-04-03T05:22:00","guid":{"rendered":"https:\/\/blog.ngocha.biz\/?p=774"},"modified":"2020-04-03T05:22:00","modified_gmt":"2020-04-03T05:22:00","slug":"install-configure-jenkins-2-centos-redhat-servers","status":"publish","type":"post","link":"https:\/\/blog.ngocha.biz\/?p=774","title":{"rendered":"Install and Configure Jenkins 2 on centos\/Redhat servers &#8211; 2025 Guide"},"content":{"rendered":"<p>In our <a href=\"https:\/\/devopscube.com\/install-configure-jenkins-2-0\/\" rel=\"noreferrer noopener\">previous post,<\/a> we explained the latest Jenkins features and installation for Debian-based servers. As per a few user requests, we have created the steps for installing Jenkins 2 versions on centos and Redhat servers.<\/p>\n<h2 id=\"jenkins-2-on-centosredhat\">Jenkins 2 on centos\/Redhat<\/h2>\n<p>This tutorial will guide you to install Jenkins 2 on a centos\/Redhat machines.<\/p>\n<h3 id=\"prerequisites\">Prerequisites:<\/h3>\n<ol>\n<li>Make sure port 22 and 8080 are open in your server firewall.<\/li>\n<li>You should have <code>sudo<\/code> access to execute the commands.<\/li>\n<\/ol>\n<p><strong>Step 1:<\/strong> Install prerequisites.<\/p>\n<pre><code>sudo yum install wget git -y<\/code><\/pre>\n<p><strong>Step 2:<\/strong>  Install java 11  JDK<\/p>\n<pre><code>sudo yum install java-11-openjdk-devel -y<\/code><\/pre>\n<p><strong>Step 3:<\/strong> Add the LTS Jenkins repository.<\/p>\n<pre><code>sudo wget -O \/etc\/yum.repos.d\/jenkins.repo http:\/\/pkg.jenkins-ci.org\/redhat\/jenkins.repo<\/code><\/pre>\n<div class=\"kg-card kg-callout-card kg-callout-card-grey\">\n<div class=\"kg-callout-text\"><b><strong style=\"white-space: pre-wrap;\">Note:<\/strong><\/b> It is recommended to use the LTS version for Jenkins. You can check out the latest <a href=\"https:\/\/jenkins.io\/changelog-stable\/?ref=devopscube.com\" rel=\"noreferrer noopener\">LTS version from here<\/a>.<\/div>\n<\/div>\n<p><strong>Step 4:<\/strong> Import the repo key.<\/p>\n<pre><code>sudo rpm --import https:\/\/jenkins-ci.org\/redhat\/jenkins-ci.org.key<\/code><\/pre>\n<p><strong>Step 5:<\/strong> There are many Jenkins 2 versions. To install the specific version, you need to get the version list from yum. Use the following command to get the list of available Jenkins versions.<\/p>\n<pre><code>sudo yum --showduplicates list jenkins | expand<\/code><\/pre>\n<p>You will see a list like the following.<\/p>\n<p>jenkins.noarch                         2.6-1.1                           jenkins jenkins.noarch                         2.7-1.1                           jenkins jenkins.noarch                         2.8-1.1                           jenkins jenkins.noarch                         2.9-1.1                           jenkins<\/p>\n<p><strong>Step 6:<\/strong> Select a specific version of your choice and install it using the following syntax.<\/p>\n<pre><code>sudo yum install (package name)-(version info)<\/code><\/pre>\n<p>For example, if you want to install 2.9-1.1, you can execute the command as shown below.<\/p>\n<pre><code>sudo yum install jenkins-2.222.1-1.1<\/code><\/pre>\n<p>Or simply execute the following command, it will install the latest LTS version.<\/p>\n<pre><code>sudo yum install jenkins -y<\/code><\/pre>\n<p><strong>Step 7:<\/strong> Start the Jenkins 2 service.<\/p>\n<pre><code>sudo systemctl start jenkins<\/code><\/pre>\n<p><strong>Step 8:<\/strong> Enable Jenkins as a startup service.<\/p>\n<pre><code>sudo systemctl enable jenkins<\/code><\/pre>\n<p><strong>Step 9:<\/strong> Access the Jenkins dashboard on port 8080 using your servers IP address.<\/p>\n<pre><code>http:\/\/&lt;jenkins-ip&gt;:8080<\/code><\/pre>\n<p><strong>Step 10:<\/strong> Open the following file in the terminal and copy the password. supply the password on the dashboard.<\/p>\n<pre><code>sudo cat \/var\/lib\/jenkins\/secrets\/initialAdminPassword<\/code><\/pre>\n<figure class=\"kg-card kg-image-card kg-card-hascaption\"><img decoding=\"async\" src=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/03\/image-333.png\" class=\"kg-image\" alt=\"\" loading=\"lazy\" width=\"988\" height=\"440\" srcset=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/size\/w600\/2025\/03\/image-333.png 600w, https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/03\/image-333.png 988w\" sizes=\"auto, (min-width: 720px) 720px\"><figcaption><span style=\"white-space: pre-wrap;\">Click to view in HD<\/span><\/figcaption><\/figure>\n<p><strong>Step 11:<\/strong> Install suggested plugins<\/p>\n<figure class=\"kg-card kg-image-card kg-card-hascaption\"><img decoding=\"async\" src=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/03\/image-1-60.png\" class=\"kg-image\" alt=\"\" loading=\"lazy\" width=\"989\" height=\"514\" srcset=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/size\/w600\/2025\/03\/image-1-60.png 600w, https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/03\/image-1-60.png 989w\" sizes=\"auto, (min-width: 720px) 720px\"><figcaption><span style=\"white-space: pre-wrap;\">Click to view in HD<\/span><\/figcaption><\/figure>\n<p><strong>Step 12:<\/strong> Create a admin Jenkins user.<\/p>\n<figure class=\"kg-card kg-image-card kg-card-hascaption\"><img decoding=\"async\" src=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/03\/image-4-57.png\" class=\"kg-image\" alt=\"\" loading=\"lazy\" width=\"986\" height=\"416\" srcset=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/size\/w600\/2025\/03\/image-4-57.png 600w, https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/03\/image-4-57.png 986w\" sizes=\"auto, (min-width: 720px) 720px\"><figcaption><span style=\"white-space: pre-wrap;\">Click to view in HD<\/span><\/figcaption><\/figure>\n<p><strong>Step 13:<\/strong> All the other steps are self-explanatory. You can follow the dashboard steps start using Jenkins<\/p>\n<p>To add slaves, you can follow the <a href=\"https:\/\/devopscube.com\/setup-slaves-on-jenkins-2\/\" rel=\"noreferrer noopener\">Jenkins SSH slave setup<\/a> article.<\/p>\n<hr>\n<p><strong>Ngu\u1ed3n:<\/strong> <a href=\"https:\/\/devopscube.com\/install-configure-jenkins-2-centos-redhat-servers\/\" target=\"_blank\" rel=\"noopener noreferrer\">Install and Configure Jenkins 2 on centos\/Redhat servers &#8211; 2025 Guide \u2014 DevOpsCube<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Source: https:\/\/devopscube.com\/install-configure-jenkins-2-centos-redhat-servers\/<\/p>\n","protected":false},"author":1,"featured_media":775,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-774","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-devops"],"_links":{"self":[{"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=\/wp\/v2\/posts\/774","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=774"}],"version-history":[{"count":0,"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=\/wp\/v2\/posts\/774\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=\/wp\/v2\/media\/775"}],"wp:attachment":[{"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=774"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=774"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=774"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}