Aug 12, 2024 4 min read

How to Install Jenkins on Ubuntu 24.04

Install Jenkins on Ubuntu 24.04 with our step-by-step tutorial. Jenkins is a free tool for Continuous Integration and Deployment (CI/CD) processes.

Install Jenkins on Ubuntu 24.04
Install Jenkins on Ubuntu 24.04
Table of Contents

Choose a different version or distribution

Introduction

Before we begin talking about how to install Jenkins on Ubuntu 24.04, let's briefly understand – What is Jenkins?

Jenkins is an open-source automation tool used for Continuous Integration and Continuous Deployment (CI/CD) processes. It helps developers quickly detect and solve code integration errors, allowing for faster software delivery. Jenkins automates the steps in building, testing, and deploying applications, enhancing development speed and quality.

This powerful tool improves collaboration among team members by providing real-time feedback on code changes. Ultimately, Jenkins plays a vital role in streamlining software development workflows, making the development process more efficient and productive.

In this tutorial, you will install Jenkins on Ubuntu 24.04. We will also address a few FAQs on how to install Jenkins on Ubuntu 24.04.

Advantages of Jenkins

  1. Automation: Jenkins automates software development processes, saving time and reducing manual errors.
  2. Continuous Integration: Ensures code is integrated and tested frequently, improving code quality.
  3. Enhanced Collaboration: Facilitates team communication and feedback with real-time updates.
  4. Extensibility: Supports a wide range of plugins to customize and extend functionalities.
  5. Cost-Effective: Being open-source, Jenkins is free to use, making it a cost-effective solution for CI/CD automation.

Prerequisites

Before we begin, confirm that you have:

  • A functioning instance of Ubuntu 24.04
  • sudo privileges

Step-by-Step Installation

1. Update the Package List

Update your package list to obtain the latest details on available package versions and their dependencies.

sudo apt update

2. Install Java

Jenkins depends on Java to function. We’ll set up OpenJDK 17, which works with Jenkins.

sudo apt install openjdk-17-jre-headless

Check the Java installation:

java -version

You would see output indicating that Java is installed.

3. Add Jenkins Repository Key

Download and add the Jenkins repository key to your system.

wget -q -O - https://pkg.jenkins.io/debian-stable/jenkins.io.key | sudo gpg --dearmor -o /usr/share/keyrings/jenkins.gpg

4. Add Jenkins Repository

Include the Jenkins repository in your system's package sources list.

sudo echo "deb [signed-by=/usr/share/keyrings/jenkins.gpg] https://pkg.jenkins.io/debian-stable binary/" | sudo tee /etc/apt/sources.list.d/jenkins.list

5. Troubleshooting Key Issues

In case of key problems, input the following command to add the key yourself:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys <KEY>

6. Update the Package List Again

Upload the package list to account for the Jenkins repository.

sudo apt update

7. Install Jenkins

Now, install Jenkins.

sudo apt install jenkins

8. Start Jenkins

Launch the Jenkins service via systemctl.

sudo systemctl start jenkins

9. Verify Jenkins is Running

Check the Jenkins service to verify it's functioning correctly.

sudo systemctl status jenkins

You'll see a message showing Jenkins is running.

10. Access Jenkins

Jenkins is accessible through port 8080. Navigate to the following URL in your browser:

http://your_server_ip:8080

The Jenkins setup wizard will appear. You'll need the initial password, which is located in:

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

Copy the password and paste it into the indicated field on the setup wizard. Follow the on-screen prompts to finish the process.

FAQs to Install Jenkins on Ubuntu 24.04

Is Jenkins free?

Yes, Jenkins is free and open-source.

How do I access the Jenkins web interface on Ubuntu 24.04?

Open a web browser and navigate to:texthttp://<Ubuntu-System-IP>:8080

How do I find the initial admin password on Ubuntu 24.04?

Run the following command to find the initial admin password: sudo cat /var/lib/jenkins/secrets/initialAdminPassword

How do I customize the Jenkins dashboard on Ubuntu 24.04?

Go to "Manage Jenkins" > "Manage Plugins" and install plugins as needed. You can also upload plugins manually.

How do I create a demo job in Jenkins on Ubuntu 24.04?

Create a new job by going to the Jenkins dashboard, clicking "New Item," and following the prompts to define your job.

How do I view the job logs in Jenkins on Ubuntu 24.04?

Go to the job page and click on the "Console Output" link to view the job logs.

How do I configure the Jenkins cron job on Ubuntu 24.04?

Go to "Manage Jenkins" > "Configure System" > "Cron" and configure the cron job settings.

Conclusion

We hope this tutorial helped you understand how to install Jenkins on Ubuntu 24.04.

If you have any queries, please leave a comment below, and we’ll be happy to respond to them for sure.

Great! You’ve successfully signed up.
Welcome back! You've successfully signed in.
You've successfully subscribed to DevOps Tutorials - VegaStack.
Your link has expired.
Success! Check your email for magic link to sign-in.
Success! Your billing info has been updated.
Your billing was not updated.