How to Install Jenkins on Ubuntu 24.04, 22.04 or 20.04 Linux

Learn the steps and commands to install Jenkins software on Ubuntu 24.04 Noble, 22.04 LTS Jammy JellyFish, or 20.04 Focal Fossa Linux.

Jenkins is a software standard in the field of professional software development. When more than one developer is working on a software project, it becomes confusing when all their changes are combined. To solve this, Jenkins comes into the picture. Jenkins is a continuous integration system (CI system) programmed in Java and used in agile software development. It ensures that small code changes are immediately tested and imported into the software. Jenkins was first known as Hudson, but after some dispute, all developers involved in this (open source) project decided to rename it Jenkins.

Hence, in a few words, Jenkins is an open-source project that helps developers automate various aspects of software app coding, such as building, testing, and deploying.

Jenkins also supports Docker and Kubernetes, which are technologies that run microservices. Running Jenkin 4GB of RAM and 50 GB of hard disk would suit small teams. In terms of software, it needs Java to run. While doing this article, I found that the supported versions of Java were Java 8  and 11.

Steps to install Jenkins on Ubuntu 24.04 or 22.04

1. Update Ubuntu 24.04 or 22.04

The first step is to refresh the APT package repository and install any available updates for the system. For all this, you need to run the given command:

sudo apt update && sudo apt upgrade

 

2. Install OpenJDK

Although the user can choose Oracle Java, we opt for open-source Java supported by Oracle and its community. The default OpenJDK version available to install is Java 11.

sudo apt install default-jdk

 

3. Add Jenkins GPG key on Ubuntu 22.04 or 20.04

The packages to install are not available in Ubuntu’s default repository; hence, to add its repository, first add the GPG key used to sign its packages.

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

 

4. Enable Jenkins repository on Bullseye

After successfully adding the GPG key, integrate the Jenkins official repository using the command below.

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

 

5. Run system update

Once more, run the system update command using the APT package manager to refresh the cache and inform the system about the newly added repository.

sudo apt update

 

6. Install Jenkins on Ubuntu 24.04 | 22.04

Finally, we have configured everything we initially needed to set up Jenkins on our Linux operating system. Like other packages, we can now install it using the APT package manager.

sudo apt install jenkins

 

7. Check the Service status

To confirm the Jenkins is working fine without throwing any error, check its service using the given command:

systemctl status jenkins --no-pager -l

If the service is not running or active, then you can use this one:

sudo systemctl enable --now jenkins
Check Jenkins service Ubuntu 22.04

 

8. Find the Jenkins Administrator password

By default, the setup will assign an Admin password to login to the Jenkins Dashboard for the initial setup, which will not be required later once we create a new admin user. But initially, we need to find the same using the given command:

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

Copy the string of numbers in the output.

 

9. Access Web Interface

Open the browser of your local or remote system to access the domain or IP address of the server where you installed Jenkins.

http://server-ip:8080

Note: Don’t forget to open port 8080 in the firewall if you are on the remote server. In your terminal, use:

sudo ufw allow 8080

Those on a Cloud hosting server must whitelist the port in their service provider’s firewall.

On the Web interface, enter the password you received in the previous step to start the setup process securely.

Access Web Interface Jenkins

 

10. Install Plugins

On the next screen, the setup will ask you to install plugins. You can install all the suggested plugins or select only those you want.

Install Plugins on Jenkins

 

11. Setup User for administration

Once you have installed the plugin, you will create your first admin user to log in and use Jenkins in the future.

Setup User for administration Ubuntu 22.04 LTS

 

12. Jenkins Dashboard on Ubuntu 24.04 or 22.04

Finally, after following the other few steps, you will have your Dashboard, which you can use to start creating projects for testing and development with your developer’s Team.

Install Jenkins on Ubuntu 22.04 or 20.04 Linux

 

Jenkins works on two architectures. Controller-Agent architecture / controller-controller architecture

The agents can be set up on the “Nodes” page. Enter the nodes’ names, define their properties, assign agents to the controller, and then start the agent nodes. For more information, refer to the official documentation. 

New Node in Jenkins Ubuntu 22.04

 

Other Articles:

How to install Oracle Java 8 64-bit Ubuntu 24.04| 22.04 | 20.04 LTS
How to install Apache Tomcat 10 on Ubuntu 24.04 | 22.04
Increase Swap Space in Ubuntu 24.04 | 22.04…
How to install Opera Browser on Ubuntu 24.04 | 22.04 | 20.04

 

 

 

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.