Announcement

Collapse
No announcement yet.

How to Install Jenkins on Ubuntu 24.04

Collapse
X
Collapse
  •  

  • How to Install Jenkins on Ubuntu 24.04


    Jenkins is an open-source continuous integration tool that automates technical tasks such as software testing, building, and deployment. It is a Java-based tool, and as a DevOP, knowing how to install and use Jenkins will save you time and resources.
    Jenkins supports numerous platforms, and this post focuses on installing it on Ubuntu 24.04. We will guide you through a step-by-step process to ensure you don’t get stuck. Let’s begin!

    Step-By-Step Installation of Jenkins on Ubuntu 24.04

    The Jenkins repository is not included in Ubuntu 24.04. As such, we must fetch it and add it to our system. Again, we’ve mentioned that Jenkins is a Java-based tool. Therefore, you must have Java installed, and in this case, we will work with OpenJDK 11. Once you have the two prerequisites in place, installing Jenkins will be an easy task.

    Proceed with the below steps.

    Step 1: Install Java

    We must have a Java Runtime Environment before we can install and use Jenkins. However, not all Java versions are supported. To be safe, consider installing OpenJDK 8 or 11.

    Verify that you have installed the correct Java version.

    $ java -version




    If not installed, use the following command to install OpenJDK 11.

    $ sudo apt install openjdk-11-jdk




    Step 2: Fetch and Add the Jenkins Repository

    Jenkins is available as a stable or weekly version. This step requires us to download the Jenkins GPG key and then its software repository. After verification, we can then add the repository to our source list.

    First, let’s execute the following command to import the Jenkins GPG key.

    $ sudo wget -O /usr/share/keyrings/jenkins-keyring.asc https://pkg.jenkins.io/debian-stable/jenkins.io-2023.key




    The next task is adding the Jenkins repository by executing the following command.

    $ echo deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc] https://pkg.jenkins.io/debian-stable binary/ | sudo tee /etc/apt/sources.list.d/jenkins.list > /dev/null




    Step 3: Install Jenkins

    After adding the stable Jenkins release to our source list, we can proceed with installing it, but first, let’s update the Ubuntu 24.04 repository to refresh the source list.

    $ sudo apt update




    Next, install Jenkins and ensure the installation completes without interruptions.

    $ sudo apt install jenkins -y




    Once installed, check the version to confirm that we managed to install it successfully.

    $ jenkins --version




    Step 4: Configure the Firewall

    We must modify our Firewall to create a rule allowing Jenkins to communicate via port 8080. First, start the Jenkins service.

    $ sudo systemctl start jenkins

    $ sudo systemctl status jenkins




    Next, add a new UFW rule and check that your firewall is active. If the firewall is inactive, enable it.

    $ sudo ufw allow 8080

    $ sudo ufw status




    Step 5: Configure Jenkins

    We will access Jenkins via a browser to set it up. On your browser tab, access the below URL. Be sure to add the correct IP or domain name of your server and port number 8080.

    http://ip_address:8080


    You will get a window displaying the “Getting Started” information. On the page, find the path to the file containing the administrator password.

    login



    Go back to your terminal and open the file using a text editor or a command such as “cat.”

    $ sudo cat /var/lib/jenkins/secrets/initialAdminPassword




    The administrator password will be displayed on your terminal. Copy the generated password and paste it into your browser in the “Administrator password” input box.

    At the bottom of the window, click on the Continue button.

    A new window will open. Click on the selected option to “Install suggested plugins.”



    Jenkins will initiate the setup.



    Once the process is complete, you will be prompted to create your administrator credentials.



    Type the admin username and password, then click the “Save and Continue” button.

    On the next window, note the Jenkins URL and click the “Save and Finish” button



    That’s it. Jenkins is now installed and configured on your Ubuntu 24.04. Click on the Start using Jenkins button to enjoy using Jenkins.



    You will get a window similar to the one below.



    Conclusion

    Jenkins has numerous applications, especially for developers. If you use Ubuntu Noble Numbat, this post has shared a step-by-step guide on how to install Jenkins. Hopefully, this post will be insightful to you, and you will be able to install Jenkins.





    More...
      Posting comments is disabled.

    Categories

    Collapse

    Article Tags

    Collapse

    There are no tags yet.

    Latest Articles

    Collapse

    • How to Disable UEFI Secure Boot on a Proxmox VE Virtual Machine
      by Kasimba
      For GPU passthrough to work or for installing specific device drivers on a Proxmox VE virtual machine, you may need to disable UEFI Secure Boot on your Proxmox VE virtual machine.

      In this article, I will show you how to disable UEFI secure boot on a Proxmox VE virtual machine.

      The procedures shown in this article will also work on any KVM/QEMU/libvirt virtual machines and virtual machines running on other virtualization platforms based on the KVM/QEMU/libvirt hyperviso...
      05-04-2024, 07:36 AM
    • Simplify Your Life with Taskwarrior's Intuitive Linux Job Scheduling
      by Kasimba



      by George Whittaker


      Introduction

      In the digital age, the ability to effectively manage time and tasks is invaluable, especially for those who work in technology and software development. Linux users, known for their preference for powerful, flexible tools, have various options for task management and scheduling. One of the standout tools in this area is Taskwarrior, a command-line task management utility that...
      05-04-2024, 07:36 AM
    • How to Set and Use Environment Variables In Bash Script
      by Kasimba
      In bash scripting, environment variables are used to save and manage the data to modify the processes in the system. Using the bash scripts, you can use the environment variables to configure the system process. Environment variables also offer security and transmit the information from one script to another.
      Hence, there are multiple uses of environment variables that you can use to enhance the automation in the Linux system. So, if you want to learn the simple ways to set and use environment...
      05-03-2024, 08:50 PM
    • How to Check Bash Version
      by Kasimba
      Checking the bash version helps Linux users in many cases, including troubleshooting and finding the currently available version in the system. If you are a regular bash user, it is good to check the bash version and keep it up to date as per the latest updates available. However, if you are a newbie in bash scripting, then you probably have never encountered a situation where you need to check the bash version.
      So, in this guide, we will explain the simplest way to check the bash version...
      05-03-2024, 08:50 PM
    • What is Shebang: Bash Script Header on First Line?
      by Kasimba
      As Linux enthusiasts, we all come across bash scripting as an essential part of the Linux system. However, many Linux users don’t know why the first line of the bash script contains #!. So this combination of # and ! is called shebang or shebang.
      Although shebang looks like a bash script header, it initially instructs the system about interpreters to execute the script. This concept feels a bit complicated, but that’s not true, as this guide is all about the shebang: bash script header....
      05-02-2024, 07:59 PM
    • Bash Script Loops Examples
      by Kasimba
      A loop in programming is a control structure that allows a specific code to be executed repeatedly until a condition is met. This process is repeated until no further action is required. Loop allows you to repeat the desired set of instructions numerous times to attain the desired outcome. These recursions can be useful for all tasks that require repetitive operations or when working with data collections.
      In this article, we will explore the meaning, types, and examples of loops, further...
      05-02-2024, 07:59 PM
    Working...
    X