{"id":10694,"date":"2021-10-05T08:04:12","date_gmt":"2021-10-05T08:04:12","guid":{"rendered":"https:\/\/linuxways.net\/?p=10694"},"modified":"2021-10-05T08:04:12","modified_gmt":"2021-10-05T08:04:12","slug":"how-to-install-jenkins-on-centos-8","status":"publish","type":"post","link":"https:\/\/linuxways.net\/de\/centos\/how-to-install-jenkins-on-centos-8\/","title":{"rendered":"How to Install Jenkins on CentOS 8"},"content":{"rendered":"<p>Jenkins is a popular and open-source automation program based on Java. It helps developers to efficiently manage their tasks like building, testing, and deploying software. It automates software builds in a systematic way and notifies developers of errors as early as possible. It is a feature-rich program that can be extended through various plugins.<\/p>\n<p>In today\u2019s post, we will be describing how to install Jenkins on <strong>CentOS<\/strong>. You will require root or sudo privileges for installing Jenkins on your CentOS machine.<\/p>\n<p><strong>Note:<\/strong> We have tested the procedure and commands described here on <strong>CentOS 8<\/strong> machine.<\/p>\n<h2>Installing Jenkins on CentOS<\/h2>\n<p>Jenkins is not available in the CentOS default package repositories. We can install it by manually adding the Jenkins repository to our system repositories. Let\u2019s get started.<\/p>\n<h3>1. Install Prerequisites<\/h3>\n<p>First, install prerequisites using the command below:<\/p>\n<pre>$ sudo yum install java-11-openjdk-devel<\/pre>\n<p>Enter sudo password and if it asks for confirmation, press <strong>y <\/strong>and then<strong> Enter <\/strong>to confirm. After that, prerequisites will be installed.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"813\" height=\"180\" class=\"wp-image-10695\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-677.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-677.png 813w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-677-300x66.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-677-768x170.png 768w\" sizes=\"auto, (max-width: 813px) 100vw, 813px\" \/><\/p>\n<h3>2. Add Jenkins Repository<\/h3>\n<p>Add the Jenkins repository to your system repositories using the below command:<\/p>\n<pre>$ sudo wget -O \/etc\/yum.repos.d\/jenkins.repo <a href=\"https:\/\/pkg.jenkins.io\/redhat-stable\/jenkins.repo\">https:\/\/pkg.jenkins.io\/redhat-stable\/jenkins.repo<\/a><\/pre>\n<p>This command will add Jenkins repository file <strong>jenkins.repo<\/strong> to the <strong>\/etc\/yum.repos.d<\/strong> directory.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1005\" height=\"271\" class=\"wp-image-10696\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-678.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-678.png 1005w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-678-300x81.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-678-768x207.png 768w\" sizes=\"auto, (max-width: 1005px) 100vw, 1005px\" \/><\/p>\n<h3>3. Import Repository Key<\/h3>\n<p>Now import the Jenkins repository key so that the system can verify the package.<\/p>\n<pre>$ sudo rpm \u2013\u2013import https:\/\/pkg.jenkins.io\/redhat\/jenkins.io.key<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"906\" height=\"43\" class=\"wp-image-10697\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-679.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-679.png 906w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-679-300x14.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-679-768x36.png 768w\" sizes=\"auto, (max-width: 906px) 100vw, 906px\" \/><\/p>\n<h3>4. Install Jenkins<\/h3>\n<p>Now in order to install Jenkins, use the command below:<\/p>\n<pre>$ sudo yum install jenkins<\/pre>\n<p>If it asks for confirmation, press <strong>y <\/strong>and then<strong> Enter <\/strong>to confirm. After that, Jenkins will be installed on your machine.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"811\" height=\"400\" class=\"wp-image-10698\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-680.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-680.png 811w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-680-300x148.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-680-768x379.png 768w\" sizes=\"auto, (max-width: 811px) 100vw, 811px\" \/><\/p>\n<h3>5. Start Jenkins<\/h3>\n<p>After Jenkins is installed, you will need to start and enable its service. To start Jenkins on your system, here is the command:<\/p>\n<pre>$ sudo systemctl start jenkins<\/pre>\n<p>To enable the service to start it automatically at boot, use the command below:<\/p>\n<pre>$ sudo systemctl enable jenkins<\/pre>\n<p>Then you can verify the status of service using the command below:<\/p>\n<pre>$ sudo systemctl status jenkins<\/pre>\n<p>If everything is working well, there will be active (running) status in the command output.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"824\" height=\"159\" class=\"wp-image-10699\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-681.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-681.png 824w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-681-300x58.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-681-768x148.png 768w\" sizes=\"auto, (max-width: 824px) 100vw, 824px\" \/><\/p>\n<h3>6. Adjust Firewall<\/h3>\n<p>Jenkins listens on port 8080. If your system is protected by a firewall and you want to access Jenkins from a remote machine, you will have to open port 8080 in your firewall.<\/p>\n<p>First, to check if your system (where Jenkins is installed) is protected by a firewall, use the command below:<\/p>\n<pre>$ sudo systemctl status firewalld<\/pre>\n<p>If you see <strong>active (running)<\/strong> status in the output, it means the firewall is enabled on your system.<\/p>\n<p>To open the port 8080 used by Jenkins in the firewall, use the command below:<\/p>\n<pre>$ sudo firewall-cmd \u2013\u2013permanent \u2013\u2013zone=public \u2013\u2013add-port=8080\/tcp<\/pre>\n<p>Then reload firewall:<\/p>\n<pre>$ sudo firewall-cmd --reload<\/pre>\n<h3>7. Post-installation Setup Wizard<\/h3>\n<p>Now open your web browser and access <a href=\"http:\/\/IP_address:8080\">http:\/ip_address:8080<\/a> where <strong>ip_address<\/strong> is the IP address of the system where Jenkins is installed.<\/p>\n<p>It will open the following <strong>Unlock Jenkins<\/strong> page in your web browser which contains the location of the administrator password.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"826\" height=\"678\" class=\"wp-image-10700\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-682.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-682.png 826w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-682-300x246.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-682-768x630.png 768w\" sizes=\"auto, (max-width: 826px) 100vw, 826px\" \/><\/p>\n<p>You will have to retrieve the password from this location. To do so, open the Terminal and type <strong><em>sudo cat<\/em><\/strong> followed by the location of the password mentioned in the <strong>Unlock Jenkins<\/strong> page. The command will output the Administrator password on the Terminal.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"758\" height=\"64\" class=\"wp-image-10701\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-683.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-683.png 758w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-683-300x25.png 300w\" sizes=\"auto, (max-width: 758px) 100vw, 758px\" \/><\/p>\n<p>Copy the password and type it under <strong>the Administrator password<\/strong> bar, then click <strong>Continue<\/strong>.<\/p>\n<p>Then on the next page, click <strong>Install suggested plugins<\/strong> or click <strong>Select plugins to install<\/strong> if you want to select the plugins manually.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"827\" height=\"466\" class=\"wp-image-10702\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-684.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-684.png 827w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-684-300x169.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-684-768x433.png 768w\" sizes=\"auto, (max-width: 827px) 100vw, 827px\" \/><\/p>\n<p>Plugins will then be installed.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"888\" height=\"563\" class=\"wp-image-10703\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-685.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-685.png 888w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-685-300x190.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-685-768x487.png 768w\" sizes=\"auto, (max-width: 888px) 100vw, 888px\" \/><\/p>\n<p>Then the following page will appear for you to create the first Administrative user. Provide the asked information and click <strong>Save and Continue<\/strong> or click <strong>Skip and continue as admin<\/strong> if you want to continue as admin. In the later case, you can use <strong>admin<\/strong> as the username and password that we used to access the setup wizard.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"889\" height=\"616\" class=\"wp-image-10704\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-686.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-686.png 889w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-686-300x208.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-686-768x532.png 768w\" sizes=\"auto, (max-width: 889px) 100vw, 889px\" \/><\/p>\n<p>Next, on the <strong>Instance Configuration<\/strong> page, you will see the automatically generated URL of the Jenkins. Click <strong>Save and Finish<\/strong>.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"887\" height=\"623\" class=\"wp-image-10705\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-687.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-687.png 887w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-687-300x211.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-687-768x539.png 768w\" sizes=\"auto, (max-width: 887px) 100vw, 887px\" \/><\/p>\n<p>Now the following page will appear showing how you to log in using the admin as username and password that you used to access the setup wizard. The post-installation wizard has been completed, click <strong>Start using Jenkins<\/strong>.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"886\" height=\"368\" class=\"wp-image-10706\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-688.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-688.png 886w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-688-300x125.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-688-768x319.png 768w\" sizes=\"auto, (max-width: 886px) 100vw, 886px\" \/><\/p>\n<p>You will then see the below Dashboard. Now the Jenkins has been successfully installed and you can start using it.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1240\" height=\"629\" class=\"wp-image-10707\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-689.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-689.png 1240w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-689-300x152.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-689-1024x519.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-689-768x390.png 768w\" sizes=\"auto, (max-width: 1240px) 100vw, 1240px\" \/><\/p>\n<h2>Remove Jenkins from CentOS<\/h2>\n<p>In case you want to remove Jenkins from your system, use the command below to do so:<\/p>\n<pre>$ sudo yum remove Jenkins<\/pre>\n<p>Provide sudo password. If prompted for confirmation, press <strong>y<\/strong>. After which, it will remove Jenkins from your system.<\/p>\n<p>In today\u2019s post, we described how to install Jenkins on CentOS system. We also described how to manage Jenkins services, allow them in firewall, and access Jenkins using the web browser. In the end, we described how to uninstall Jenkins in case you need to do so. If you are working on Ubuntu OS, visit <a href=\"https:\/\/linuxways.net\/de\/ubuntu\/how-to-install-jenkins-on-ubuntu-20-04\/\">how to install Jenkins on Ubuntu<\/a>.<\/p>","protected":false},"excerpt":{"rendered":"<p>Jenkins is a popular and open-source automation program based on Java. It helps developers to efficiently manage their tasks like building, testing, and deploying software. It automates software&hellip;<\/p>","protected":false},"author":1,"featured_media":10918,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[93,248],"class_list":["post-10694","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-centos","tag-centos-8","tag-jenkins"],"_links":{"self":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/10694","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/comments?post=10694"}],"version-history":[{"count":1,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/10694\/revisions"}],"predecessor-version":[{"id":10917,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/10694\/revisions\/10917"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media\/10918"}],"wp:attachment":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media?parent=10694"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/categories?post=10694"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/tags?post=10694"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}