{"id":1014,"date":"2024-11-20T01:34:31","date_gmt":"2024-11-19T20:34:31","guid":{"rendered":"https:\/\/blake.azuela.info\/?p=1014"},"modified":"2024-11-20T02:23:43","modified_gmt":"2024-11-19T21:23:43","slug":"how-to-set-up-jenkins-on-ubuntu-24-04","status":"publish","type":"post","link":"https:\/\/blake.azuela.info\/index.php\/2024\/11\/20\/how-to-set-up-jenkins-on-ubuntu-24-04\/","title":{"rendered":"How to Set Up Jenkins on Ubuntu 24.04"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Hello, tech enthusiasts! \ud83d\ude80 Whether you&#8217;re a seasoned DevOps guru or just dipping your toes into the world of continuous integration and deployment, this guide is tailored just for you. Today, we&#8217;ll embark on a journey to set up a <strong>Jenkins server<\/strong> on an <strong>Ubuntu 24.04<\/strong> system using the latest <strong>OpenJDK 21<\/strong> and secure it with <strong>Nginx<\/strong> and <strong>Let&#8217;s Encrypt<\/strong> SSL certificates. Ready? Let\u2019s dive in! \ud83c\udf0a<br><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\ud83d\udd27 <strong>Prerequisites<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Before we get our hands dirty, let&#8217;s ensure we have everything in place:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Ubuntu 24.04 Server<\/strong>: A fresh installation is ideal.<\/li>\n\n\n\n<li><strong>Sudo Privileges<\/strong>: You&#8217;ll need administrative rights to install and configure software.<\/li>\n\n\n\n<li><strong>Domain Name<\/strong>: A fully qualified domain name (FQDN) like <code>jenkins.yourdomain.com<\/code> pointing to your server&#8217;s IP (required for SSL).<\/li>\n\n\n\n<li><strong>Internet Connection<\/strong>: To download packages and dependencies.<br><\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\ud83d\ude80 <strong>Step 1: Update Your System<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Keeping your system updated is the first step to a smooth installation process. Let&#8217;s start by updating and upgrading your existing packages.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code><code>sudo apt update<\/code> &amp;&amp; sudo apt upgrade -y<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\ud83d\udcdd <strong>What this does:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>sudo apt update<\/code>: Refreshes the package lists.<\/li>\n\n\n\n<li><code>sudo apt upgrade -y<\/code>: Upgrades all installed packages to their latest versions without prompting.<\/li>\n\n\n\n<li><\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\ud83d\udee0\ufe0f <strong>Step 2: Install OpenJDK 21<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Jenkins runs on Java, so installing the latest version is crucial for performance and security.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>a. Add the OpenJDK PPA<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Ubuntu&#8217;s default repositories might not have OpenJDK 21 yet. We&#8217;ll add a Personal Package Archive (PPA) to get the latest version.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>sudo apt install -y software-properties-common<br>sudo add-apt-repository ppa:openjdk-r\/test -y<br>sudo apt update<br><\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\ud83d\udd0d <strong>Why a PPA?<\/strong><br>PPAs allow you to install newer versions of software that aren&#8217;t yet available in the official repositories.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>b. Install OpenJDK 21<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><code>sudo apt install -y openjdk-21-jdk<\/code><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>c. Verify the Installation<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><code>java -version<br><\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\ud83d\udca1 <strong>Expected Output:<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>openjdk version \"21.0.x\" 202X-XX-XX<br>OpenJDK Runtime Environment (build 21.0.x+XX-Ubuntu-XXXX)<br>OpenJDK 64-Bit Server VM (build 21.0.x+XX-Ubuntu-XXXX, mixed mode, sharing)<br><\/code><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>d. Set Java 21 as the Default (If Multiple Versions are Installed)<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">If you have multiple Java versions, ensure OpenJDK 21 is set as the default.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>sudo update-alternatives --config java<br><\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Select the option corresponding to OpenJDK 21.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\ud83d\uddc4\ufe0f <strong>Step 3: Add Jenkins Repository and GPG Key<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">To install Jenkins, we&#8217;ll add its official repository and ensure our system trusts its packages.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>a. Install Necessary Packages<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><code>sudo apt install -y wget gnupg2 software-properties-common<br><\/code><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>b. Add the Jenkins Repository GPG Key<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">This step ensures that the packages downloaded from the Jenkins repository are authentic.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>wget -q -O - https:\/\/pkg.jenkins.io\/debian-stable\/jenkins.io.key | sudo gpg --dearmor -o \/usr\/share\/keyrings\/jenkins.gpg<br><\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\ud83d\udca1 <strong>Explanation:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>wget -q -O -<\/code>: Downloads the Jenkins GPG key silently and outputs it.<\/li>\n\n\n\n<li><code>sudo gpg --dearmor -o \/usr\/share\/keyrings\/jenkins.gpg<\/code>: Converts the key to GPG format and stores it securely.<br><\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>c. Add the Jenkins Repository to Sources List<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><code>echo \"deb [arch=amd64 signed-by=\/usr\/share\/keyrings\/jenkins.gpg] https:\/\/pkg.jenkins.io\/debian-stable binary\/\" | sudo tee \/etc\/apt\/sources.list.d\/jenkins.list<br><\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\ud83d\udcdd <strong>Breakdown:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>deb [arch=amd64 signed-by=\/usr\/share\/keyrings\/jenkins.gpg]<\/code>: Specifies the architecture and associates the repository with the GPG key.<\/li>\n\n\n\n<li><code>https:\/\/pkg.jenkins.io\/debian-stable binary\/<\/code>: The Jenkins repository URL.<\/li>\n\n\n\n<li><code>sudo tee \/etc\/apt\/sources.list.d\/jenkins.list<\/code>: Adds the repository to your system.<\/li>\n\n\n\n<li><\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\ud83d\udce6 <strong>Step 4: Install Jenkins<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Now that the repository is set up, installing Jenkins is straightforward.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>sudo apt update<br>sudo apt install -y jenkins<br><\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\ud83c\udf89 <strong>Congrats!<\/strong> You&#8217;ve just installed Jenkins on your system.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u23ef\ufe0f <strong>Step 5: Start and Enable Jenkins Service<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Ensure Jenkins starts automatically on boot and is currently running.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>sudo systemctl start jenkins<br>sudo systemctl enable jenkins<br><\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\ud83d\udd0d <strong>Check Jenkins Status:<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>sudo systemctl status jenkins<br><\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\ud83d\udcac <strong>Expected Output:<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">     <code>jenkins.service - Jenkins Continuous Integration Server<br>   Loaded: loaded (\/lib\/systemd\/system\/jenkins.service; enabled; vendor preset: enabled)<br>   Active: active (running) since ...<br><\/code><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\ud83d\udd10 <strong>Step 6: Adjust Firewall Settings<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">To allow traffic to Jenkins, we&#8217;ll adjust the firewall to permit connections on port <code>8080<\/code>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>a. Allow Jenkins Port<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><code>sudo ufw allow 8080<br>sudo ufw status<br><\/code><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>b. Enable UFW (If Not Already Enabled)<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><code>sudo ufw enable<br><\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\ud83d\udee1\ufe0f <strong>Security Tip:<\/strong><br>Only open necessary ports to minimize potential attack vectors.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\ud83c\udf10 <strong>Step 7: Access Jenkins Web Interface<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Now, let&#8217;s see Jenkins in action!<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>a. Retrieve the Initial Admin Password<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Jenkins requires an initial password to unlock the setup wizard.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>sudo cat \/var\/lib\/jenkins\/secrets\/initialAdminPassword<br><\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\ud83d\udd11 <strong>Copy the Password:<\/strong><br>You&#8217;ll see a long string of characters. Copy it to your clipboard.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>b. Open Jenkins in Your Browser<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Navigate to <code>http:\/\/your_domain_or_IP:8080<\/code><br><strong>Example:<\/strong> <code>http:\/\/192.168.1.100:8080<\/code><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>c. Unlock Jenkins<\/strong><\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Paste the Password:<\/strong><br>Enter the copied password into the &#8220;Administrator password&#8221; field.<br><img loading=\"lazy\" decoding=\"async\" width=\"500\" height=\"260\" class=\"wp-image-1015\" style=\"width: 500px;\" src=\"https:\/\/blake.azuela.info\/wp-content\/uploads\/2024\/11\/p1-4.webp\" alt=\"Unlock Jenkins\" srcset=\"https:\/\/blake.azuela.info\/wp-content\/uploads\/2024\/11\/p1-4.webp 1212w, https:\/\/blake.azuela.info\/wp-content\/uploads\/2024\/11\/p1-4-300x156.webp 300w, https:\/\/blake.azuela.info\/wp-content\/uploads\/2024\/11\/p1-4-1024x532.webp 1024w, https:\/\/blake.azuela.info\/wp-content\/uploads\/2024\/11\/p1-4-768x399.webp 768w, https:\/\/blake.azuela.info\/wp-content\/uploads\/2024\/11\/p1-4-600x312.webp 600w\" sizes=\"auto, (max-width: 500px) 100vw, 500px\" \/><\/li>\n\n\n\n<li><strong>Click &#8220;Continue&#8221;<\/strong><\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>d. Customize Jenkins<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Install Suggested Plugins:<\/strong><br>Recommended for beginners to get started quickly.<br><img loading=\"lazy\" decoding=\"async\" width=\"500\" height=\"255\" class=\"wp-image-1016\" style=\"width: 500px;\" src=\"https:\/\/blake.azuela.info\/wp-content\/uploads\/2024\/11\/p2-2.webp\" alt=\"Customize Jenkins\" srcset=\"https:\/\/blake.azuela.info\/wp-content\/uploads\/2024\/11\/p2-2.webp 1240w, https:\/\/blake.azuela.info\/wp-content\/uploads\/2024\/11\/p2-2-300x153.webp 300w, https:\/\/blake.azuela.info\/wp-content\/uploads\/2024\/11\/p2-2-1024x523.webp 1024w, https:\/\/blake.azuela.info\/wp-content\/uploads\/2024\/11\/p2-2-768x392.webp 768w, https:\/\/blake.azuela.info\/wp-content\/uploads\/2024\/11\/p2-2-600x306.webp 600w\" sizes=\"auto, (max-width: 500px) 100vw, 500px\" \/><\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>e. Create the First Admin User<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Fill in User Details:<\/strong><br>Provide a username, password, and other required information.<br><img loading=\"lazy\" decoding=\"async\" width=\"500\" height=\"271\" class=\"wp-image-1017\" style=\"width: 500px;\" src=\"https:\/\/blake.azuela.info\/wp-content\/uploads\/2024\/11\/p3-2.webp\" alt=\"Jenkins - First User\" srcset=\"https:\/\/blake.azuela.info\/wp-content\/uploads\/2024\/11\/p3-2.webp 1159w, https:\/\/blake.azuela.info\/wp-content\/uploads\/2024\/11\/p3-2-300x163.webp 300w, https:\/\/blake.azuela.info\/wp-content\/uploads\/2024\/11\/p3-2-1024x556.webp 1024w, https:\/\/blake.azuela.info\/wp-content\/uploads\/2024\/11\/p3-2-768x417.webp 768w, https:\/\/blake.azuela.info\/wp-content\/uploads\/2024\/11\/p3-2-600x326.webp 600w\" sizes=\"auto, (max-width: 500px) 100vw, 500px\" \/><\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>f. Instance Configuration<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Set Jenkins URL:<\/strong><br>Ensure it&#8217;s set to <code>http:\/\/your_domain_or_IP\/<\/code> or later <code>https:\/\/your_domain\/<\/code> if your going to use SSL.<br><img loading=\"lazy\" decoding=\"async\" width=\"500\" height=\"286\" class=\"wp-image-1019\" style=\"width: 500px;\" src=\"https:\/\/blake.azuela.info\/wp-content\/uploads\/2024\/11\/p4-2.webp\" alt=\"Jenkins URL\" srcset=\"https:\/\/blake.azuela.info\/wp-content\/uploads\/2024\/11\/p4-2.webp 1104w, https:\/\/blake.azuela.info\/wp-content\/uploads\/2024\/11\/p4-2-300x171.webp 300w, https:\/\/blake.azuela.info\/wp-content\/uploads\/2024\/11\/p4-2-1024x585.webp 1024w, https:\/\/blake.azuela.info\/wp-content\/uploads\/2024\/11\/p4-2-768x439.webp 768w, https:\/\/blake.azuela.info\/wp-content\/uploads\/2024\/11\/p4-2-600x343.webp 600w\" sizes=\"auto, (max-width: 500px) 100vw, 500px\" \/><\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>g. Start Using Jenkins<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Click &#8220;Start using Jenkins&#8221;<\/strong><br>You\u2019re now ready to explore Jenkins! \ud83c\udf88<br><img loading=\"lazy\" decoding=\"async\" width=\"500\" height=\"301\" class=\"wp-image-1018\" style=\"width: 500px;\" src=\"https:\/\/blake.azuela.info\/wp-content\/uploads\/2024\/11\/p5-1.webp\" alt=\"Jenkins is Ready\" srcset=\"https:\/\/blake.azuela.info\/wp-content\/uploads\/2024\/11\/p5-1.webp 1048w, https:\/\/blake.azuela.info\/wp-content\/uploads\/2024\/11\/p5-1-300x181.webp 300w, https:\/\/blake.azuela.info\/wp-content\/uploads\/2024\/11\/p5-1-1024x617.webp 1024w, https:\/\/blake.azuela.info\/wp-content\/uploads\/2024\/11\/p5-1-768x462.webp 768w, https:\/\/blake.azuela.info\/wp-content\/uploads\/2024\/11\/p5-1-240x145.webp 240w, https:\/\/blake.azuela.info\/wp-content\/uploads\/2024\/11\/p5-1-600x361.webp 600w\" sizes=\"auto, (max-width: 500px) 100vw, 500px\" \/><br><\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\ud83d\udee1\ufe0f <strong>Step 8: Configure Nginx for Secure (HTTPS) Connections<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Now, let&#8217;s secure your Jenkins server by configuring <strong>Nginx<\/strong> as a reverse proxy with <strong>HTTPS<\/strong>. We&#8217;ll use your customized <code>nginx.conf<\/code> and Jenkins site configuration, replacing placeholders appropriately. \ud83d\udee0\ufe0f\ud83d\udd12<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83d\udd0d <strong>Understanding the Configuration Files<\/strong><\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong><code>\/etc\/nginx\/nginx.conf<\/code><\/strong>: The main Nginx configuration file that defines global settings.<\/li>\n\n\n\n<li><strong><code>\/etc\/nginx\/sites-available\/jenkins<\/code><\/strong>: The site-specific configuration for Jenkins.<\/li>\n\n\n\n<li><strong><code>\/etc\/nginx\/sites-enabled\/jenkins<\/code><\/strong>: A symbolic link to the site configuration, enabling it.<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83d\udcc4 <strong>Your Customized Nginx Configuration<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">You&#8217;ve provided your own <code>nginx.conf<\/code> and Jenkins site configuration. Let&#8217;s integrate them into our setup with placeholders for easy customization.<br><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83d\udcdd <strong>a. Update the Main Nginx Configuration (<code>nginx.conf<\/code>)<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Here&#8217;s your current <code>nginx.conf<\/code>. We&#8217;ll keep it mostly unchanged but ensure it includes our custom settings for Jenkins.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>user www-data;<br>worker_processes auto;<br>pid \/run\/nginx.pid;<br>error_log \/var\/log\/nginx\/error.log;<br>include \/etc\/nginx\/modules-enabled\/*.conf;<br><br>events {<br>    worker_connections 768;<br>    # multi_accept on;<br>}<br><br>http {<br>    ##<br>    # Basic Settings<br>    ##<br><br>     # Define Rate Limit Zone for Jenkins<br>    limit_req_zone $binary_remote_addr zone=jenkins_limit:10m rate=10r\/s;<br><br>    sendfile on;<br>    tcp_nopush on;<br>    types_hash_max_size 2048;<br>    server_tokens off;<br><br>    # server_names_hash_bucket_size 64;<br>    # server_name_in_redirect off;<br><br>    include \/etc\/nginx\/mime.types;<br>    default_type application\/octet-stream;<br><br>    ##<br>    # SSL Settings<br>    ##<br><br>    ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # Dropping SSLv3, ref: POODLE<br>    ssl_prefer_server_ciphers on;<br><br>    ##<br>    # Logging Settings<br>    ##<br><br>    access_log \/var\/log\/nginx\/access.log;<br><br>    ##<br>    # Gzip Settings<br>    ##<br><br>    gzip on;<br>    gzip_types text\/plain text\/css application\/json application\/javascript text\/xml application\/xml application\/xml+rss text\/javascript;<br>    gzip_min_length 256;<br>    gzip_vary on;<br>    gzip_proxied any;<br>    gzip_comp_level 5;<br>    # gzip_vary on;<br>    # gzip_proxied any;<br>    # gzip_comp_level 6;<br>    # gzip_buffers 16 8k;<br>    # gzip_http_version 1.1;<br><br>    ##<br>    # Virtual Host Configs<br>    ##<br><br>    include \/etc\/nginx\/conf.d\/*.conf;<br>    include \/etc\/nginx\/sites-enabled\/*;<br>}<br><br>#mail {<br>#    # See sample authentication script at:<br>#    # http:\/\/wiki.nginx.org\/ImapAuthenticateWithApachePhpScript<br>#<br>#    # auth_http localhost\/auth.php;<br>#    # pop3_capabilities \"TOP\" \"USER\";<br>#    # imap_capabilities \"IMAP4rev1\" \"UIDPLUS\";<br>#<br>#    server {<br>#        listen     localhost:110;<br>#        protocol   pop3;<br>#        proxy      on;<br>#    }<br>#<br>#    server {<br>#        listen     localhost:143;<br>#        protocol   imap;<br>#        proxy      on;<br>#    }<br>#}<br><\/code><\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">\ud83d\udd11 <strong>Key Points:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Rate Limiting (<code>limit_req_zone<\/code>)<\/strong>: Protects Jenkins from excessive requests by limiting the rate to 10 requests per second per IP address.<\/li>\n\n\n\n<li><strong>Gzip Compression<\/strong>: Optimizes data transfer by compressing responses, improving load times.<\/li>\n\n\n\n<li>Turn Off Server Tokens: This will hide your nginx version which make security vunerablities more ambiguous. <\/li>\n<\/ul>\n<\/blockquote>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">\ud83d\udccc <strong>Note:<\/strong> Ensure that your <code>jenkins_limit<\/code> zone parameters align with your expected traffic.<br><\/p>\n<\/blockquote>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83d\udcdd <strong>b. Configure the Jenkins Site<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Now, let&#8217;s set up the Nginx server block for Jenkins. This configuration ensures that all traffic to <code>jenkins.your_domain.com<\/code> is securely proxied to your Jenkins server running on <code>localhost:8080<\/code>. Remember to update <code>jenkins.your_domain.com<\/code> with your actual domain address.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>i. Create the Jenkins Server Block<\/strong><\/h4>\n\n\n\n<p class=\"wp-block-paragraph\"><code>sudo nano \/etc\/nginx\/sites-available\/jenkins<br><\/code><\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>ii. Add the Following Configuration:<\/strong><\/h4>\n\n\n\n<p class=\"wp-block-paragraph\"><code>server {<br>    if ($host = jenkins.your_domain.com) {<br>        return 301 https:\/\/$host$request_uri;<br>    } # managed by Certbot<br><br>    listen 80;<br>    server_name jenkins.your_domain.com;<br>    return 404; # managed by Certbot<br>}<br><br>server {<br>    server_name jenkins.your_domain.com;<br><br>    # Enable HTTP\/2<br>    listen 443 ssl http2; # managed by Certbot<br><br>    # SSL Certificates<br>    ssl_certificate \/etc\/letsencrypt\/live\/jenkins.your_domain.com\/fullchain.pem; # managed by Certbot<br>    ssl_certificate_key \/etc\/letsencrypt\/live\/jenkins.your_domain.com\/privkey.pem; # managed by Certbot<br>    include \/etc\/letsencrypt\/options-ssl-nginx.conf; # managed by Certbot<br>    ssl_dhparam \/etc\/letsencrypt\/ssl-dhparams.pem; # managed by Certbot<br><br>    ## Security Headers<br>    add_header X-Frame-Options \"DENY\" always;<br>    add_header X-Content-Type-Options \"nosniff\" always;<br>    add_header X-XSS-Protection \"1; mode=block\" always;<br>    add_header Strict-Transport-Security \"max-age=31536000; includeSubDomains\" always;<br>    add_header Referrer-Policy \"no-referrer\" always;<br>    add_header Content-Security-Policy \"default-src 'self';\" always;<br><br>    ## Access and Error Logs<br>    access_log \/var\/log\/nginx\/jenkins_access.log;<br>    error_log \/var\/log\/nginx\/jenkins_error.log warn;<br><br>    ## Rate Limiting<br>    limit_req zone=jenkins_limit burst=20 nodelay;<br><br>    ## Client Body Size Limit<br>    client_max_body_size 100M;<br><br>    location \/ {<br>        # (Optional) Basic Authentication<br>        # auth_basic \"Restricted Access\";<br>        # auth_basic_user_file \/etc\/nginx\/.htpasswd;<br><br>        proxy_pass http:\/\/localhost:8080;<br><br>        ## Preserve Host and Client Information<br>        proxy_set_header Host $host;<br>        proxy_set_header X-Real-IP $remote_addr;<br>        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;<br>        proxy_set_header X-Forwarded-Proto $scheme;<br><br>        ## WebSocket Support<br>        proxy_http_version 1.1;<br>        proxy_set_header Upgrade $http_upgrade;<br>        proxy_set_header Connection \"upgrade\";<br><br>        ## Proxy Buffering<br>        proxy_buffering off;<br><br>        ## Timeouts<br>        proxy_connect_timeout 60s;<br>        proxy_send_timeout 60s;<br>        proxy_read_timeout 60s;<br>        send_timeout 60s;<br><br>        ## Caching Controls<br>        proxy_cache_bypass $http_upgrade;<br>        proxy_no_cache $http_upgrade;<br><br>        ## Limit Request Methods (Moved Inside Location)<br>        limit_except GET POST HEAD {<br>            deny all;<br>        }<br>    }<br>}<br><\/code><\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">\ud83d\udd04 <strong>What Changed?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Domain Replacement<\/strong>:<br>Changed all instances of <code>jenkins.amelioratesdev.com<\/code> to <code>jenkins.your_domain.com<\/code>.<strong>Remember<\/strong>: Replace <code>jenkins.your_domain.com<\/code> with your actual domain name throughout the configuration.<\/li>\n\n\n\n<li><strong>SSL Certificate Paths<\/strong>:<br>Ensure that the SSL certificate paths match your domain.<\/li>\n\n\n\n<li><strong>Security Enhancements<\/strong>:<br>Added headers and rate limiting for improved security.<\/li>\n<\/ul>\n<\/blockquote>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">\ud83d\udd27 <strong>Explanation of Added Configurations:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Redirect HTTP to HTTPS<\/strong>:<br>The first server block listens on port 80 and redirects all traffic to HTTPS, ensuring encrypted connections.<\/li>\n\n\n\n<li><strong>Security Headers<\/strong>:<br>Added various headers like <code>X-Frame-Options<\/code>, <code>Strict-Transport-Security<\/code>, and <code>Content-Security-Policy<\/code> to enhance security by preventing clickjacking, enforcing HTTPS, and controlling resource loading.<\/li>\n\n\n\n<li><strong>Rate Limiting (<code>limit_req<\/code>)<\/strong>:<br>Limits incoming requests to 10 per second with a burst of 20, protecting against DDoS attacks.<\/li>\n\n\n\n<li><strong>Client Body Size Limit (<code>client_max_body_size<\/code>)<\/strong>:<br>Increases the maximum allowed size of the client request body to 100MB, accommodating larger builds or uploads.<\/li>\n\n\n\n<li><strong>WebSocket Support<\/strong>:<br>Configures Nginx to handle WebSocket connections, which Jenkins uses for real-time updates.<\/li>\n\n\n\n<li><strong>Request Method Restrictions (<code>limit_except<\/code>)<\/strong>:<br>Only allows <code>GET<\/code>, <code>POST<\/code>, and <code>HEAD<\/code> methods, denying all others for added security.<br><\/li>\n<\/ul>\n<\/blockquote>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83d\udd04 <strong>c. Enable the Jenkins Server Block<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Activate the Jenkins configuration by creating a symbolic link:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>sudo ln -s \/etc\/nginx\/sites-available\/jenkins \/etc\/nginx\/sites-enabled\/<br><\/code><\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">\ud83d\udd17 <strong>Note:<\/strong><br>If you encounter an error stating that the file already exists, you can remove the existing symlink and recreate it:<\/p>\n<\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\"><code>sudo rm \/etc\/nginx\/sites-enabled\/jenkins<br>sudo ln -s \/etc\/nginx\/sites-available\/jenkins \/etc\/nginx\/sites-enabled\/<br><\/code><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83e\uddea <strong>d. Test Nginx Configuration<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Before restarting Nginx, it&#8217;s crucial to test the configuration for any syntax errors.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>sudo nginx -t<br><\/code><\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">\u2705 <strong>Expected Output:<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>nginx: the configuration file \/etc\/nginx\/nginx.conf syntax is ok<br>nginx: configuration file \/etc\/nginx\/nginx.conf test is successful<br><\/code><\/p>\n<\/blockquote>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">\u274c <strong>If Errors Appear:<\/strong><br>Review the error messages, fix any issues in the configuration files, and retest.<br><\/p>\n<\/blockquote>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83d\udd04 <strong>e. Restart Nginx to Apply Changes<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><code>sudo systemctl restart nginx<br><\/code><\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">\ud83d\udce2 <strong>Pro Tip:<\/strong><br>Use <code>sudo systemctl reload nginx<\/code> instead of <code>restart<\/code> if you prefer to apply changes without dropping connections.<br><\/p>\n<\/blockquote>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\ud83d\udd12 <strong>Step 9: Secure Jenkins with Certbot (Let&#8217;s Encrypt)<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">With Nginx configured as a reverse proxy, it&#8217;s time to secure your Jenkins server with <strong>HTTPS<\/strong> using <strong>Let&#8217;s Encrypt<\/strong> SSL certificates. <strong>Certbot<\/strong> will help automate the process of obtaining and renewing these certificates.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83d\udee0\ufe0f <strong>a. Install Certbot<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Certbot automates the process of obtaining and renewing SSL certificates from Let&#8217;s Encrypt.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>sudo apt install -y certbot python3-certbot-nginx<\/code><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83d\udd11 <strong>b. Obtain and Install SSL Certificate<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Use Certbot to obtain an SSL certificate for your domain. Replace <code>jenkins.your_domain.com<\/code> with your actual domain name.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>sudo certbot --nginx -d jenkins.your_domain.com<\/code><\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">\ud83d\udcdd <strong>During the Process:<\/strong><\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Enter Email Address:<\/strong><br>Provide an email for urgent renewal and security notices.<\/li>\n\n\n\n<li><strong>Agree to Terms of Service:<\/strong><br>Type <code>Y<\/code> and press Enter.<\/li>\n\n\n\n<li><strong>Share Your Email (Optional):<\/strong><br>Choose whether to share your email with the Electronic Frontier Foundation.<\/li>\n\n\n\n<li><strong>Redirect HTTP to HTTPS:<\/strong><br>Select <code>2<\/code> to redirect all traffic to HTTPS (recommended).<\/li>\n<\/ol>\n<\/blockquote>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">\ud83d\udd04 <strong>What Certbot Does:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Obtains an SSL certificate from Let&#8217;s Encrypt.<\/li>\n\n\n\n<li>Configures Nginx to use the obtained SSL certificates.<\/li>\n\n\n\n<li>Sets up automatic renewal for the certificates.<\/li>\n<\/ul>\n<\/blockquote>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83d\udee0\ufe0f <strong>c. Verify SSL Installation<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">After Certbot finishes, navigate to <code>https:\/\/jenkins.your_domain.com<\/code> in your browser. You should see a secure padlock icon indicating a successful SSL setup.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83d\udd04 <strong>d. Adjust Firewall for HTTPS (If Necessary)<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Ensure that HTTPS traffic is allowed through the firewall.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>sudo ufw allow 'Nginx Full'<br>sudo ufw reload<\/code><\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">\ud83d\udccc <strong>Note:<\/strong><br>The <code>'Nginx Full'<\/code> profile allows both HTTP (port 80) and HTTPS (port 443) traffic. Since we&#8217;ve set up redirection from HTTP to HTTPS, you can optionally remove the HTTP rule to enforce HTTPS-only access.<br><\/p>\n<\/blockquote>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u2705 <strong>Step 10: Final Verification<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">You&#8217;re almost at the finish line! Let&#8217;s ensure everything is working as expected.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83d\udda5\ufe0f <strong>a. Access Jenkins Securely<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>URL:<\/strong> <code>https:\/\/jenkins.your_domain.com<\/code><\/li>\n\n\n\n<li><strong>Check for Secure Connection:<\/strong><br>Look for the padlock icon in your browser&#8217;s address bar, indicating a secure HTTPS connection.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83c\udfc3\u200d\u2642\ufe0f <strong>b. Run Another Sample Job<\/strong><\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Create a New Job:<\/strong>\n<ul class=\"wp-block-list\">\n<li>Click <strong>&#8220;New Item&#8221;<\/strong><\/li>\n\n\n\n<li>Name it <code>Secure-Test-Job<\/code><\/li>\n\n\n\n<li>Select <strong>&#8220;Freestyle project&#8221;<\/strong> and click <strong>&#8220;OK&#8221;<\/strong><\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Configure the Job:<\/strong>\n<ul class=\"wp-block-list\">\n<li>Under <strong>&#8220;Build&#8221;<\/strong>, click <strong>&#8220;Add build step&#8221;<\/strong> &gt; <strong>&#8220;Execute shell&#8221;<\/strong><\/li>\n\n\n\n<li>Enter the command: <code>echo \"Secure Jenkins is up and running! \ud83d\udd12\ud83d\ude80\"<\/code><\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Save and Build:<\/strong>\n<ul class=\"wp-block-list\">\n<li>Click <strong>&#8220;Save&#8221;<\/strong><\/li>\n\n\n\n<li>Click <strong>&#8220;Build Now&#8221;<\/strong><\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Check Build Output:<\/strong><ul><li>Click on the build number (e.g., <code>#1<\/code>)Click <strong>&#8220;Console Output&#8221;<\/strong><\/li><\/ul>\ud83d\udda8\ufe0f <strong>Expected Output:<\/strong> <code>Building in workspace \/var\/lib\/jenkins\/workspace\/Secure-Test-Job [Secure-Test-Job] $ \/bin\/bash -c echo \"Secure Jenkins is up and running! \ud83d\udd12\ud83d\ude80\" Secure Jenkins is up and running! \ud83d\udd12\ud83d\ude80<\/code><\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83d\udee0\ufe0f <strong>c. Monitor Jenkins Service<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Ensure Jenkins is running without issues.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>sudo systemctl status jenkins<br><\/code><\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">\ud83d\udcac <strong>Expected Output:<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">         <code>jenkins.service - Jenkins Continuous Integration Server<br>     Loaded: loaded (\/lib\/systemd\/system\/jenkins.service; enabled; vendor preset: enabled)<br>     Active: active (running) since ...<br><\/code><\/p>\n<\/blockquote>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83d\udd04 <strong>d. Test SSL Certificate Renewal<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Let&#8217;s Encrypt certificates are valid for 90 days. Certbot sets up automatic renewal, but it&#8217;s good to test it.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>sudo certbot renew --dry-run<br><\/code><\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">\u2705 <strong>Expected Output:<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>Congratulations, all renewals succeeded. The following certs have been renewed:<br>  \/etc\/letsencrypt\/live\/jenkins.your_domain.com\/fullchain.pem (success)<br><\/code><\/p>\n<\/blockquote>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\ud83c\udf89 <strong>Conclusion<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\ud83c\udf8a <strong>Congratulations!<\/strong> \ud83c\udf8a You&#8217;ve successfully set up a <strong>Jenkins server<\/strong> on <strong>Ubuntu 24.04<\/strong> using <strong>OpenJDK 21<\/strong>, configured <strong>Nginx<\/strong> as a secure reverse proxy, and protected your setup with <strong>HTTPS<\/strong> using <strong>Let&#8217;s Encrypt<\/strong>. This robust configuration ensures that your CI\/CD pipelines are both efficient and secure. \ud83d\udee1\ufe0f\ud83d\ude80<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83c\udf1f <strong>What&#8217;s Next?<\/strong><\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Explore Jenkins Plugins:<\/strong>\n<ul class=\"wp-block-list\">\n<li>Enhance Jenkins with plugins that cater to your development and deployment needs.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Automate Your CI\/CD Pipelines:<\/strong>\n<ul class=\"wp-block-list\">\n<li>Start creating pipelines to automate builds, tests, and deployments.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Implement Advanced Security:<\/strong>\n<ul class=\"wp-block-list\">\n<li>Consider setting up role-based access controls (RBAC) within Jenkins.<\/li>\n\n\n\n<li>Enable two-factor authentication (2FA) for added security.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Monitor and Optimize:<\/strong>\n<ul class=\"wp-block-list\">\n<li>Integrate monitoring tools to keep an eye on Jenkins&#8217; performance.<\/li>\n\n\n\n<li>Regularly update Jenkins and its plugins to the latest versions.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Backup Configurations:<\/strong>\n<ul class=\"wp-block-list\">\n<li>Set up regular backups for Jenkins configurations and job data to prevent data loss.<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83d\udce3 <strong>Share Your Success!<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Feel free to share your Jenkins setup journey with the community. Your experiences can help others navigate similar setups and overcome challenges. \ud83c\udf10\ud83d\udcac<br><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p class=\"wp-block-paragraph\">\ud83d\udd17 <strong>Useful Links:<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/www.jenkins.io\/doc\/\" rel=\"noopener\" target=\"_new\" title=\"\">Jenkins Official Documentation<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/nginx.org\/en\/docs\/\" target=\"_new\" rel=\"noopener\" title=\"Nginx Official Documentation\">Nginx Official Documentation<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/certbot.eff.org\/\" target=\"_new\" rel=\"noopener\" title=\"Let's Encrypt with Certbot\">Let&#8217;s Encrypt with Certbot<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/openjdk.org\/projects\/jdk\/21\/\" target=\"_new\" rel=\"noopener\" title=\"OpenJDK 21\">OpenJDK 21<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/www.jenkins.io\/doc\/book\/security\/securing-jenkins\/\" target=\"_new\" rel=\"noopener\" title=\"\">Best Practices for Jenkins Security<\/a><br><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p class=\"wp-block-paragraph\"><em>\u26a0\ufe0f <strong>Disclaimer:<\/strong><\/em><br>While this guide provides a comprehensive setup, always tailor configurations to fit your specific environment and security requirements. Regularly review and update your setup to maintain optimal security and performance.*<br><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p class=\"has-text-align-center wp-block-paragraph\">\ud83d\ude4c <strong>Happy Coding!<\/strong> \ud83d\udda5\ufe0f\u2728<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hello, tech enthusiasts! \ud83d\ude80 Whether you&#8217;re a seasoned DevOps guru or just dipping your toes into the world of continuous integration and deployment, this guide is tailored just for you. Today, we&#8217;ll embark on a journey to set up a Jenkins server on an Ubuntu 24.04 system using the latest OpenJDK 21 and secure it &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/blake.azuela.info\/index.php\/2024\/11\/20\/how-to-set-up-jenkins-on-ubuntu-24-04\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;How to Set Up Jenkins on Ubuntu 24.04&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":1020,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_regular_price":[],"currency_symbol":[],"_monsterinsights_skip_tracking":false,"footnotes":""},"categories":[110],"tags":[129,216,222,213,221,220,215,212,211,219,214,217,218,116],"class_list":["post-1014","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-guides","tag-automation","tag-certbot","tag-ci-cd","tag-configuration","tag-continuous-integration","tag-devops","tag-https","tag-installation","tag-jenkins","tag-nginx","tag-openjdk","tag-reverse-proxy","tag-security","tag-ubuntu"],"aioseo_notices":[],"post_slider_layout_featured_media_urls":{"thumbnail":["https:\/\/blake.azuela.info\/wp-content\/uploads\/2024\/11\/Jenkins_Ubuntu-150x150.jpg",150,150,true],"post_slider_layout_landscape_large":["https:\/\/blake.azuela.info\/wp-content\/uploads\/2024\/11\/Jenkins_Ubuntu-1024x800.jpg",1024,800,true],"post_slider_layout_portrait_large":["https:\/\/blake.azuela.info\/wp-content\/uploads\/2024\/11\/Jenkins_Ubuntu.jpg",1024,1024,false],"post_slider_layout_square_large":["https:\/\/blake.azuela.info\/wp-content\/uploads\/2024\/11\/Jenkins_Ubuntu.jpg",1024,1024,false],"post_slider_layout_landscape":["https:\/\/blake.azuela.info\/wp-content\/uploads\/2024\/11\/Jenkins_Ubuntu-600x400.jpg",600,400,true],"post_slider_layout_portrait":["https:\/\/blake.azuela.info\/wp-content\/uploads\/2024\/11\/Jenkins_Ubuntu-600x900.jpg",600,900,true],"post_slider_layout_square":["https:\/\/blake.azuela.info\/wp-content\/uploads\/2024\/11\/Jenkins_Ubuntu-600x600.jpg",600,600,true],"full":["https:\/\/blake.azuela.info\/wp-content\/uploads\/2024\/11\/Jenkins_Ubuntu.jpg",1024,1024,false]},"_links":{"self":[{"href":"https:\/\/blake.azuela.info\/index.php\/wp-json\/wp\/v2\/posts\/1014","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blake.azuela.info\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blake.azuela.info\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blake.azuela.info\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blake.azuela.info\/index.php\/wp-json\/wp\/v2\/comments?post=1014"}],"version-history":[{"count":4,"href":"https:\/\/blake.azuela.info\/index.php\/wp-json\/wp\/v2\/posts\/1014\/revisions"}],"predecessor-version":[{"id":1026,"href":"https:\/\/blake.azuela.info\/index.php\/wp-json\/wp\/v2\/posts\/1014\/revisions\/1026"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blake.azuela.info\/index.php\/wp-json\/wp\/v2\/media\/1020"}],"wp:attachment":[{"href":"https:\/\/blake.azuela.info\/index.php\/wp-json\/wp\/v2\/media?parent=1014"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blake.azuela.info\/index.php\/wp-json\/wp\/v2\/categories?post=1014"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blake.azuela.info\/index.php\/wp-json\/wp\/v2\/tags?post=1014"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}