{"id":720,"date":"2024-07-11T20:09:41","date_gmt":"2024-07-12T02:09:41","guid":{"rendered":"https:\/\/kop.lat\/blog\/?p=720"},"modified":"2024-12-07T12:21:15","modified_gmt":"2024-12-07T18:21:15","slug":"install-jenkins-in-rocky-linux-9","status":"publish","type":"post","link":"https:\/\/kop.lat\/blog\/install-jenkins-in-rocky-linux-9\/","title":{"rendered":"Install Jenkins in Rocky Linux 9"},"content":{"rendered":"\n<p><\/p>\n\n\n\n<p>Install Jenkins on Rocky Linux:<\/p>\n\n\n\n<ol>\n<li><strong>Update:<\/strong><\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>   sudo dnf update -y<\/code><\/pre>\n\n\n\n<ol start=\"2\">\n<li><strong>Install Java:<\/strong> Jenkins requires Java to run. Install OpenJDK 11, which is a recommended version for Jenkins:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>   sudo dnf install -y java-11-openjdk-devel\n\n(optional) sudo dnf install java-1.8.0-openjdk wget gnupg<\/code><\/pre>\n\n\n\n<ol start=\"3\">\n<li><strong>Add the Jenkins repository:<\/strong> Create a new repo file for Jenkins in <code>\/etc\/yum.repos.d\/<\/code>:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>   sudo tee \/etc\/yum.repos.d\/jenkins.repo &lt;&lt;EOF\n   <\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;jenkins]\nname=Jenkins\nbaseurl=http:\/\/pkg.jenkins.io\/redhat-stable\/\nenabled=1\ngpgcheck=1\ngpgkey=https:\/\/pkg.jenkins.io\/redhat-stable\/jenkins.io.key<\/code><\/pre>\n\n\n\n<ol start=\"4\">\n<li><strong>Import the Jenkins GPG key:<\/strong><\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>   sudo rpm --import https:\/\/pkg.jenkins.io\/redhat\/jenkins.io.key<\/code><\/pre>\n\n\n\n<ol start=\"5\">\n<li><strong>Install Jenkins:<\/strong><\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>   sudo dnf install -y jenkins<\/code><\/pre>\n\n\n\n<ol start=\"6\">\n<li><strong>Start and enable Jenkins service:<\/strong><\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>   sudo systemctl start jenkins\n   sudo systemctl enable jenkins<\/code><\/pre>\n\n\n\n<ol start=\"7\">\n<li><strong>Open the necessary firewall ports:<\/strong> Jenkins by default runs on port 8080. To allow traffic through this port, run:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>   sudo firewall-cmd --permanent --zone=public --add-port=8080\/tcp\n   sudo firewall-cmd --reload<\/code><\/pre>\n\n\n\n<ol start=\"8\">\n<li><strong>Access Jenkins:<\/strong> Open web browser and navigate to <code>http:\/\/localhost:8080<\/code>, should see the Jenkins setup wizard.<\/li>\n\n\n\n<li><strong>Retrieve the initial admin password:<\/strong> To complete the setup wizard, will need the initial admin password. Can retrieve it using the following command:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo su -\ncd \/var\/lib\/jenkins\/secrets\/\ncat \/var\/lib\/jenkins\/secrets\/initialAdminPassword | xclip -selection clipboard<\/code><\/pre>\n\n\n\n<p>Use this password to unlock Jenkins and complete the initial setup.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Install Jenkins on Rocky Linux: Use this password to unlock Jenkins and complete the initial setup.<\/p>\n","protected":false},"author":1,"featured_media":465,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[20,1,9,4,8],"tags":[],"_links":{"self":[{"href":"https:\/\/kop.lat\/blog\/wp-json\/wp\/v2\/posts\/720"}],"collection":[{"href":"https:\/\/kop.lat\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kop.lat\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kop.lat\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kop.lat\/blog\/wp-json\/wp\/v2\/comments?post=720"}],"version-history":[{"count":3,"href":"https:\/\/kop.lat\/blog\/wp-json\/wp\/v2\/posts\/720\/revisions"}],"predecessor-version":[{"id":724,"href":"https:\/\/kop.lat\/blog\/wp-json\/wp\/v2\/posts\/720\/revisions\/724"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/kop.lat\/blog\/wp-json\/wp\/v2\/media\/465"}],"wp:attachment":[{"href":"https:\/\/kop.lat\/blog\/wp-json\/wp\/v2\/media?parent=720"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kop.lat\/blog\/wp-json\/wp\/v2\/categories?post=720"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kop.lat\/blog\/wp-json\/wp\/v2\/tags?post=720"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}