Install Jenkins LTS in Ubuntu 24.04

In this article, we cover how to install Jenkins in Ubuntu 24.04 release. Jenkins is an open-source automation server. It plays an important role when it comes to Continuous Integration and Continuous Delivery. Besides, it helps us to automate tasks when it comes to software management and this includes building the software to deploying it.

Jenkins requires Java to run. If you don’t have it installed then, do check the Additional Info section.

Note: The following operations require Administrative rights. If you lack the necessary rights to make changes to your system then, contact your System Administrator for assistance.

Install Jenkins LTS in Ubuntu 24.04

The following instructions help you install the Long-term support release.

Step 1. Get the required repository key

Use wget to get the Jenkins repository key & save it to the directory: /usr/share/keyrings

wget -c 'https://pkg.jenkins.io/debian-stable/jenkins.io-2023.key'

and, move it to the above-mentioned directory:

sudo mv jenkins.io-2023.key /usr/share/keyrings/jenkins-keyring.asc

Step 2. Create jenkins.list file in /etc/apt/sources.list.d/ directory

Use nano text editor:

sudo nano /etc/apt/sources.list.d/jenkins.list

And, append the file with the following data:

deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc] https://pkg.jenkins.io/debian-stable binary/

Step 3. Update repository

sudo apt update

Step 4. Install Jenkins

sudo apt install jenkins

Install Jenkins Weekly release in Ubuntu 24.04

For weekly release, we need to replace “debian-stable” with “debian”. Rest of the code stay as it is.

Step 1. Get the repository key

wget -c 'https://pkg.jenkins.io/debian/jenkins.io-2023.key'

Step 2. Move it /usr/share/keyrings directory

sudo mv jenkins.io-2023.key /usr/share/keyrings/jenkins-keyring.asc

Step 3. Create a new file jenkins.list using nano text editor

sudo nano /etc/apt/sources.list.d/jenkins.list

Step 4. Append jenkins.list with the following entry

deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc] https://pkg.jenkins.io/debian binary/

Step 5. Update repository and install Jenkins

sudo apt update
sudo apt install jenkins

Post-installation

Check if the service is running or not:

systemctl status jenkins.service

If it is not, then:

sudo systemctl start jenkins.service
sudo systemctl enable jenkins.service

Open a web browser, and enter the following in the address bar:

http://localhost:8080

You can replace localhost with your server IP.

Thereafter, it would prompt us for the password. We can get it from:

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

In conclusion, we have covered here how to install Jenkins in the Ubuntu 24.04 release.

Additional Info:

If you don’t have Java installed, then install it through the following commands:

sudo apt update
sudo apt install openjdk-17-jre

Similar Posts