How to Install Jenkins on Ubuntu 24.04

Jenkins is software widely used for automating tasks such as building, testing, and deploying applications. It can efficiently manage your software projects. With a variety of plugins, you can customize Jenkins based on your project’s needs and requirements.

Additionally, you can integrate Jenkins with Git version control to track your project versioning. This feature allows you to pull code from a Git repository to your Jenkins project.

The main purpose of this post is to present the complete process of installing Jenkins on an Ubuntu 24.04 system.

How to Install Jenkins on Ubuntu 24.04?

Step 1: Update and Upgrade Ubuntu’s Packages

To ensure that your Ubuntu 24.04 system runs smoothly, keep your system up to date by running:

Update and Upgrade Ubuntu’s Packages

This command ensures that your system packages are up to date.

How to Install the Required Software for Jenkins on Ubuntu 24.04?

These below steps are needed to install the required software packages to run the Jenkins instance smoothly on your Ubuntu 24.04.

Step 1: Check Available OpenJDK Packages

If you want to know the available OpenJDK packages, this command will print a list of available OpenJDK packages on your screen:

Update and Upgrade Ubuntu’s Packages

This command displays the available compatible versions of OpenJDK, that can be installed from the APT repository.

Note: Before selecting the right version of OpenJDK, consider the official documentation of Jenkins.

Step 2: Install OpenJDK 21 for Jenkins

To ensure compatibility with Jenkins on your Ubuntu 24.04, install OpenJDK 21 by running the command:

Install OpenJDK 21 for Jenkins
Install OpenJDK 21 for Jenkins

In addition, the “fontconfig” package is included to ensure that Jenkins can correctly display fonts.

Step 3: Verify OpenJDK Installation

The installation of OpenJDK-21 can be verified through the below mentioned command:

Install OpenJDK 21 for Jenkins

If the command displays the installed version of OpenJDK, such as 21.0.3, it verifies that OpenJDK is correctly set up on your system.

How to Install Jenkins Package on Ubuntu 24.04?

The following steps-wise guide will set up and integrate the Jenkins package on your Ubuntu 24.04.

Step 1: Download Jenkins’ Keyring via “wget”

To install the newest, stable, and secure version of the Jenkins package, download the keyring using the “wget” command. Copy and execute the following command:

Download Jenkins’ Keyring via “wget”

If the command returns an empty output, it shows that the Jenkins keyring has been downloaded to your local system.

Step 2: Add Jenkins to Source List

Upon downloading the Jenkins keyrings, now operate the below code to add the Jenkins repository to your Ubuntu’s source list:

[signed-by=/usr/share/keyrings/jenkins-keyring.asc]

Download Jenkins’ Keyring via “wget”

This command allows you to easily install and upgrade the Jenkins package from its official source.

Step 3: Refresh Ubuntu’s Cache

To integrate the Jenkins repository, run the command to refresh your Ubuntu 24.04 cache:

Download Jenkins’ Keyring via “wget”

You can find in the above output that the Jenken respiratory has been integrated into your system list.

Step 4: Install Jenkins Package via APT

Once your Ubuntu machine is ready, you can now install the Jenkins package through the APT package manager:

Instal Jenkins Package via APT
Instal Jenkins Package via APT

The output printed above shows that the command executed and installed the updated version of Jenkins on your system. 

How to Start Jenkins on Ubuntu 24.04?

You can easily operate the Jenkins instance on your Ubuntu 24.04 with these steps.

Step 1: Enable and Start Jenkins Service

To avoid manually enabling Jenkins each time and ensure that Jenkins starts automatically at boot operate this command:

Enable and Start Jenkins Service

With this command, you don’t need to manually enable and start the Jenkins service every time before use.

Step 2: Confirm Jenkins Service Status

After starting the Jenkins services, verify if it is active on your Ubuntu 24.04 system:

Enable and Start Jenkins Service

As presented above, the Jenkins service is perfectly running on your Ubuntu 24.40 machine.

Step 3: Print Jenkins Admin Password

To set up and access Jenkins for the first time on your system, you will need the Jenkins admin password. This command will display the initial admin password:

Enable and Start Jenkins Service

This process is essential to unlock the web interface and proceed with further configuration of Jenkins on your Ubuntu 24.04 system.

Step 4: Check Jenkins’ Default Port

To check the default port used by Jenkins to access the web interface on local machine, use the command:

Enable and Start Jenkins Service

As shown, the Jenkins web interface can be accessed on port 8080.

How to Configure Jenkins on Ubuntu 24.04 Localhost?

The below are the necessary steps to configure the Jenkins Instance on your Ubuntu 24.04 localhost.

Step 1: Access Jenkins Instance

Open this URL on your web browser to access the Jenkins web interface on your localhost:

Access Jenkins Instance

Enter the initial admin password to start further configuration of Jenkins on your system.

Step 2: Install Jenkins Plugins

Choose one of the following two options based on your requirements to install Jenkins plugins on your system:

Access Jenkins Instance

While you can customize the Jenkins plugin installation, it is recommended to install the suggested plugins.

Step 3: Create Jenkins Admin User

Next, specify the user information to create the first Jenkins admin user:

Access Jenkins Instance

Remember your credentials to use them for accessing Jenkins Instance.

Step 4: Save and Finish the Jenkins Configuration

At the end, click “Save and Finish” to complete the Jenkins configuration process:

Access Jenkins Instance

Finally, your Jenkins instance is ready to use. Click “Start using Jenkins” to access the Jenkins Dashboard:

Access Jenkins Instance

After successfully accessing the Jenkins instance, you will see the below greeting message “Welcome to Jenkins!” on your web screen:

Access Jenkins Instance

Enjoy using Jenkins to manage and handle your software projects.

How to Remove Jenkins Package from Ubuntu 24.04?

Perform the below commands to uninstall the Jenkins package and remove the configuration data from the Ubuntu 24.04 system.

Step 1: Stop and Disable Jenkins Service

If you want to completely remove the Jenkins services, first stop and disable the Jenkins services with this command:

Stop and Disable Jenkins Service

Make sure that the Jenkins services have been disabled on your Ubuntu 24.04 system.

Step 2: Remove Jenkins Package

Next, utilize the “–purge” option to remove the Jenkins package along with dependencies and associated data:

Stop and Disable Jenkins Service

As mentioned in the above output, the Jenkins date has been completely removed from your Ubuntu 24.04 system.

Step 3: Verify Jenkins Removal

The Jenkins removal can be verified through the following command:

Stop and Disable Jenkins Service

If Jenkins has been successfully removed from your Ubuntu 24.04, you will be returned that Jenkins is not found.

FAQs

What packages must I install before installing the Jenkins package on Ubuntu 24.04?

Before starting the installation of Jenkins, you have to install OpenJDK and fontconfig packages via the command: “sudo apt install openjdk-21-jdk fontconfig”.

How do I easily install the Jenkins instance on my Ubuntu 24.04 system?

First, download and integrate the Jenkins repository to your source list. Then, install Jenkins using command “sudo apt install jenkins -y”.

What is the default port to access the Jenkins instance on localhost on Ubuntu 24.04?

The default port to access Jenkins on localhost is 8080. You can also check the Jenkins port from terminal: “cat /etc/default/jenkins | grep HTTP_PORT”.

Conclusion

The updated Jenkins can be set up and configured using a few commands. To smoothly run the Jenkins instance on your Ubuntu 24.04, install the OpenJDK with “sudo apt install openjdk-21-jdk fontconfig”. Then, operate the command “sudo apt install jenkins” to configure it on your Ubuntu 24.04 machine.

Scroll to Top