In this tutorial, we are going to look at how to install Jenkins on Ubuntu 24.04|22.04. First, let us learn what Jenkins is and what it is used for. So What is Jenkins?
Ever heard of build management systems? These are automation servers used by developers to build test and deploy their software in order to ensure continuous integration and continuous delivery. Jenkins is one of those servers and it is purely open source. When several developers are working on a software, the codes could first be pushed to a version control system such as Github and then passed to a build management system such as Jenkins where the codes are build to an application, tested and released or made available for users to download and use. Note that Docker is supported by majority of build management systems including Jenkins.
You will mostly hear Jenkins being used by DevOps Engineers together with other terms such as CI (Continuous Integration) and CD (Continuous Delivery/ Deployment). Jenkins is built with plugins that ensure continuous integration processes. It helps developers to automate the process of building and testing codes, enabling them to easily make or incorporate changes where needed thus also ensuring continuous delivery of the end product to the end user. Having understood what Jenkins is and what it is used for, let us now proceed to look at how to install Jenkins Server on Ubuntu.
Install Jenkins Server on Ubuntu 24.04|22.04
The following steps describe how to install and configure Jenkins on Ubuntu 24.04|22.04.
Step 1: Install Java
Jenkins is a Java application and we need to ensure that the latest version of Java is installed in our systems. Java 8 or later is required.
You can check the Java version installed by running the below command:
$ java –version
Command 'java' not found, but can be installed with:
sudo apt install default-jre # version 2:1.17-75, or
sudo apt install openjdk-17-jre-headless # version 17.0.14+7-1~24.04
sudo apt install openjdk-21-jre-headless # version 21.0.6+7-1~24.04.1
sudo apt install openjdk-19-jre-headless # version 19.0.2+7-4
sudo apt install openjdk-20-jre-headless # version 20.0.2+9-1
sudo apt install openjdk-22-jre-headless # version 22~22ea-1
sudo apt install openjdk-11-jre-headless # version 11.0.26+4-1ubuntu1~24.04
sudo apt install openjdk-8-jre-headless # version 8u442-b06~us1-0ubuntu1~24.04
As you can see, I do not have Java installed and I am going to install with the below command:
sudo apt update
sudo apt install default-jdk
Once installed, confirm the version
$ java --version
openjdk 21.0.6 2025-01-21
OpenJDK Runtime Environment (build 21.0.6+7-Ubuntu-124.04.1)
OpenJDK 64-Bit Server VM (build 21.0.6+7-Ubuntu-124.04.1, mixed mode, sharing)
Step 2: Install Jenkins Server on Ubuntu 24.04|22.04
We are going to be installing Jenkins from its official repository. First import Jenkins GPG key
#Download the GPG key
sudo wget -O /usr/share/keyrings/jenkins-keyring.asc \
https://pkg.jenkins.io/debian-stable/jenkins.io-2023.key
#Add the repository
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
#Install jenkins
sudo apt update
sudo apt install jenkins
Jenkins is set to start automatically after installation. When the installation process is complete, confirm Jenkins status
$ sudo systemctl status jenkins
● jenkins.service - Jenkins Continuous Integration Server
Loaded: loaded (/usr/lib/systemd/system/jenkins.service; enabled; preset: enabled)
Active: active (running) since Tue 2025-04-01 15:09:41 EAT; 15min ago
Main PID: 3947 (java)
Tasks: 45 (limit: 9440)
Memory: 841.5M (peak: 856.4M)
CPU: 20.433s
CGroup: /system.slice/jenkins.service
└─3947 /usr/bin/java -Djava.awt.headless=true -jar /usr/share/java/jenkins.war --webroot=/var/cache/jenkins/war --httpPort=8080
Apr 01 15:09:36 elearning jenkins[3947]: b9a3dc6f15b64caeadda44b913719d77
Apr 01 15:09:36 elearning jenkins[3947]: This may also be found at: /var/lib/jenkins/secrets/initialAdminPassword
Apr 01 15:09:36 elearning jenkins[3947]: *************************************************************
Apr 01 15:09:36 elearning jenkins[3947]: *************************************************************
Apr 01 15:09:36 elearning jenkins[3947]: *************************************************************
Apr 01 15:09:41 elearning jenkins[3947]: 2025-04-01 12:09:41.658+0000 [id=40] INFO jenkins.InitReactorRunner$1#onAttained: Completed initialization
Apr 01 15:09:41 elearning jenkins[3947]: 2025-04-01 12:09:41.676+0000 [id=33] INFO hudson.lifecycle.Lifecycle#onReady: Jenkins is fully up and running
Apr 01 15:09:41 elearning systemd[1]: Started jenkins.service - Jenkins Continuous Integration Server.
Step 3: Configure firewall
If you are running an active firewall, you need to open port 8080 which Jenkins natively run on
sudo ufw allow 8080/tcp
sudo ufw reload
Step 4: Configure Jenkins Server from the browser
Open Jenkins web interface using your server IP address and port 8080. i.e http:SERVER_IP:8080

Get the password from the provided file. In this case, /var/lib/jenkins/secrets/initialAdminPassword
. You can easily retrieve the password by running the below command on the Jenkins server terminal:
sudo cat /var/lib/jenkins/secrets/initialAdminPassword
Paste the password and click ‘Continue’. You get a page similar to the below. Here, select suggested plugins if you are new to Jenkins for simplicity purposes.

This will begin installation of the necessary plugins as below:

Once plugins installations are done,you will be prompted to create an admin user:

Enter the details required and at the bottom right of the page, click ‘save and Continue’. The next page shows the default url for your Jenkins installation. You don’t have to do anything here. Simply click ‘Save and Finish’ at the bottom right of the page.

Your Jenkins is ready. Click on ‘Start Using Jenkins’

Below is Jenkins dashboard:

If you are aspiring to become a DevOps Engineer, Jenkins is one the tools you definitely need to learn about. Continuous integration makes delivery fast and easy to reduces the back and forth between the developers, operators and the clients and therefore ensures a happy client.
We hope the guide has been useful in installing Jenkins on Ubuntu 24.04|22.04. Do not forget to check out more of our interesting Linux guides below: