• Categories
    Category
    {{ postCtrl.tags }}
    • {{ category.tag_type }}

      • {{tag.tag_name}}
      • View more
  • Categories
    Category
    {{ postCtrl.tags }}
    • {{ category.tag_type }}

      • {{tag.tag_name}}
      • View more
  • News
  • Tutorials
  • Forums
  • Tags
  • Users
Tutorial News Comments FAQ Related Articles

How to install Jenkins on Ubuntu 22.04

  • 00:45 lsb_release -a
  • 00:59 wget -O /usr/share/keyrings/jenkins-keyring.asc https://pkg.jenkins.io/debian-stable/jenkins.io-2023.key
  • 01:09 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/nul
  • 01:21 apt update
  • 02:14 apt install fontconfig openjdk-11-jre
  • 03:19 apt install jenkins -y
  • 04:05 systemctl start jenkins
  • 04:14 systemctl status jenkins
  • 04:30 ufw allow 8080
  • 04:50 ufw allow OpenSSH
  • 04:59 ufw enable
  • 05:10 ufw status
{{postValue.id}}

To Install Jenkins On Ubuntu 22.04

Introduction:

Jenkins is a continuous integration (CI) server that supports a wide range of tools and technologies. Adopting a CI process ensures that all developers' working copies of code are regularly merged into a shared trunk. Once a change is committed to the repository, the product is automatically rebuilt and tested.

Procedure:

Step – 1 : At first, Check the OS version

root@linuxhelp:~# lsb_release -a
No LSB modules are available.
Distributor ID:    Ubuntu
Description:    Ubuntu 22.04.3 LTS
Release:    22.04
Codename:    jammy

Step – 2 : Now download package repository of Jenkins to automate installation by using the wget command

root@linuxhelp:~# wget -O /usr/share/keyrings/jenkins-keyring.asc https://pkg.jenkins.io/debian-stable/jenkins.io-2023.key
--2023-10-26 14:50:50--  https://pkg.jenkins.io/debian-stable/jenkins.io-2023.key
Resolving pkg.jenkins.io (pkg.jenkins.io)... 151.101.2.133, 151.101.66.133, 151.101.130.133, ...
Connecting to pkg.jenkins.io (pkg.jenkins.io)|151.101.2.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 3175 (3.1K) [application/pgp-keys]
Saving to: ‘/usr/share/keyrings/jenkins-keyring.asc’

/usr/share/keyrings/jenkins-keyr 100%[==========================================================>]   3.10K  --.-KB/s    in 0s      

2023-10-26 14:50:51 (21.4 MB/s) - ‘/usr/share/keyrings/jenkins-keyring.asc’ saved [3175/3175]

Step – 3 : Add a Jenkins apt repository entry by using the following command

root@linuxhelp:~# 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/nul

Step – 4 : Update the repository by using the following command

root@linuxhelp:~# apt update
Ign:1 https://pkg.jenkins.io/debian-stable binary/ InRelease        
Get:2 https://pkg.jenkins.io/debian-stable binary/ Release [2,044 B]
Hit:3 http://in.archive.ubuntu.com/ubuntu jammy InRelease                      
Get:4 https://pkg.jenkins.io/debian-stable binary/ Release.gpg [833 B]
Get:5 http://in.archive.ubuntu.com/ubuntu jammy-updates InRelease [119 kB]
Get:6 https://pkg.jenkins.io/debian-stable binary/ Packages [25.8 kB]
Get:7 http://in.archive.ubuntu.com/ubuntu jammy-backports InRelease [109 kB]              
Get:8 http://in.archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages [1,103 kB]
Get:9 http://in.archive.ubuntu.com/ubuntu jammy-updates/main i386 Packages [515 kB]
Get:10 http://in.archive.ubuntu.com/ubuntu jammy-updates/main Translation-en [239 kB]
Get:11 http://in.archive.ubuntu.com/ubuntu jammy-updates/main amd64 DEP-11 Metadata [101 kB]
Get:12 http://in.archive.ubuntu.com/ubuntu jammy-updates/main amd64 c-n-f Metadata [16.0 kB]
Get:13 http://in.archive.ubuntu.com/ubuntu jammy-updates/restricted i386 Packages [32.4 kB]
Get:14 http://in.archive.ubuntu.com/ubuntu jammy-updates/restricted amd64 Packages [1,036 kB]      
Fetched 11.0 MB in 10s (1,137 kB/s)                                                                                                
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
99 packages can be upgraded. Run 'apt list --upgradable' to see them.

Step – 5 : Now install the Jenkins dependencies by using the following command

root@linuxhelp:~# apt install fontconfig openjdk-11-jre
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
fontconfig is already the newest version (2.13.1-4.2ubuntu5).
fontconfig set to manually installed.
The following packages were automatically installed and are no longer required:
  libflashrom1 libftdi1-2 libllvm13
Use 'apt autoremove' to remove them.
The following additional packages will be installed:
  ca-certificates-java fonts-dejavu-extra java-common libatk-wrapper-java libatk-wrapper-java-jni openjdk-11-jre-headless
Suggested packages:
  default-jre fonts-ipafont-gothic fonts-ipafont-mincho fonts-wqy-microhei | fonts-wqy-zenhei
The following NEW packages will be installed:
  ca-certificates-java fonts-dejavu-extra java-common libatk-wrapper-java libatk-wrapper-java-jni openjdk-11-jre
  openjdk-11-jre-headless
0 upgraded, 7 newly installed, 0 to remove and 99 not upgraded.
Need to get 44.9 MB of archives.
After this operation, 184 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://in.archive.ubuntu.com/ubuntu jammy/main amd64 java-common all 0.72build2 [6,782 B]
Get:2 http://in.archive.ubuntu.com/ubuntu jammy-updates/main amd64 openjdk-11-jre-headless amd64 11.0.20.1+1-0ubuntu1~22.04 [42.5 MB]
Get:3 http://in.archive.ubuntu.com/ubuntu jammy-updates/main amd64 ca-certificates-java all 20190909ubuntu1.2 [12.1 kB]            
Updating certificates in /etc/ssl/certs...
0 added, 0 removed; done.
Running hooks in /etc/ca-certificates/update.d...

done.
done.

Step – 6 : Install the Jenkins by using the apt command with –y option

root@linuxhelp:~# apt install jenkins -y
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libflashrom1 libftdi1-2 libllvm13
Use 'apt autoremove' to remove them.
The following additional packages will be installed:
  net-tools
The following NEW packages will be installed:
  jenkins net-tools
0 upgraded, 2 newly installed, 0 to remove and 99 not upgraded.
Need to get 89.1 MB of archives.
After this operation, 90.4 MB of additional disk space will be used.
Get:2 http://in.archive.ubuntu.com/ubuntu jammy/main amd64 net-tools amd64 1.60+git20181103.0eebece-1ubuntu5 [204 kB]
Get:1 https://pkg.jenkins.io/debian-stable binary/ jenkins 2.414.3 [88.9 MB]       
Fetched 89.1 MB in 16s (5,709 kB/s)                                                                                                
Selecting previously unselected package net-tools.
(Reading database ... 202547 files and directories currently installed.)
Preparing to unpack .../net-tools_1.60+git20181103.0eebece-1ubuntu5_amd64.deb ...
Unpacking net-tools (1.60+git20181103.0eebece-1ubuntu5) ...
Selecting previously unselected package jenkins.
Preparing to unpack .../jenkins_2.414.3_all.deb ...
Unpacking jenkins (2.414.3) ...
Setting up net-tools (1.60+git20181103.0eebece-1ubuntu5) ...
Setting up jenkins (2.414.3) ...
Created symlink /etc/systemd/system/multi-user.target.wants/jenkins.service → /lib/systemd/system/jenkins.service.
Processing triggers for man-db (2.10.2-1) ...

Step – 7 : After the installation start the Jenkins service by using the following command

root@linuxhelp:~# systemctl start jenkins

Step – 8 : Check the status of the Jenkins service by using the following command

root@linuxhelp:~# systemctl status jenkins
● jenkins.service - Jenkins Continuous Integration Server
     Loaded: loaded (/lib/systemd/system/jenkins.service; enabled; vendor preset: enabled)
     Active: active (running) since Thu 2023-10-26 14:56:48 IST; 1min 37s ago
   Main PID: 8874 (java)
      Tasks: 47 (limit: 4556)
     Memory: 1.1G
        CPU: 2min 3.384s
     CGroup: /system.slice/jenkins.service
             └─8874 /usr/bin/java -Djava.awt.headless=true -jar /usr/share/java/jenkins.war --webroot=/var/cache/jenkins/war --http>

Oct 26 14:56:13 linuxhelp jenkins[8874]: c06931140838478aaaac944cd55bb49d
Oct 26 14:56:13 linuxhelp jenkins[8874]: This may also be found at: /var/lib/jenkins/secrets/initialAdminPassword
Oct 26 14:56:13 linuxhelp jenkins[8874]: *************************************************************
Oct 26 14:56:13 linuxhelp jenkins[8874]: *************************************************************
Oct 26 14:56:13 linuxhelp jenkins[8874]: *************************************************************
Oct 26 14:56:48 linuxhelp jenkins[8874]: 2023-10-26 09:26:48.754+0000 [id=36]        INFO        jenkins.InitReactorRunner$1#onAtta>
Oct 26 14:56:48 linuxhelp jenkins[8874]: 2023-10-26 09:26:48.790+0000 [id=23]        INFO        hudson.lifecycle.Lifecycle#onReady>
Oct 26 14:56:48 linuxhelp systemd[1]: Started Jenkins Continuous Integration Server.
Oct 26 14:56:49 linuxhelp jenkins[8874]: 2023-10-26 09:26:49.805+0000 [id=51]        INFO        h.m.DownloadService$Downloadable#l>
Oct 26 14:56:49 linuxhelp jenkins[8874]: 2023-10-26 09:26:49.810+0000 [id=51]        INFO        hudson.util.Retrier#start: Perform>

Step – 9 : Now allow the default Jenkins port 8080 in Ubuntu default firewall

root@linuxhelp:~# ufw allow 8080
Rules updated
Rules updated (v6)

Step – 10 : Also allow the OpenSSH in Ubuntu default firewall

root@linuxhelp:~# ufw allow OpenSSH
Rules updated
Rules updated (v6)

Step – 11 : Now enable the Ubuntu default firewall by using the following command

root@linuxhelp:~# ufw enable
Firewall is active and enabled on system startup

Step – 12 : Now check the status of the firewall by using the following command

root@linuxhelp:~# ufw status
Status: active

To                         Action      From
--                         ------      ----
8080                       ALLOW       Anywhere                  
OpenSSH                    ALLOW       Anywhere                  
8080 (v6)                  ALLOW       Anywhere (v6)             
OpenSSH (v6)               ALLOW       Anywhere (v6)

Now go to the browser and search with you ip or domain along with port number SNAP 1 You will see the above page Get the password from the following file

root@linuxhelp:~# cat /var/lib/jenkins/secrets/initialAdminPassword
c06931140838478aaaac944cd55bb49d

Enter the password and click continue button SNAP 2 Now click the Install suggested plugins SNAP 3 After the installation completed create a admin user click save and continue button SNAP 4 Now enter the Jenkins url here SNAP 5 After that click Start using Jenkins button to completed SNAP 6 Finally you will see the welcome page of the Jenkins SNAP 7

Conclusion:

We have reached the end of this article. In this guide, we have walked you through the steps required to install Jenkins on Ubuntu 22.04. Your feedback is much welcome.

Tags:
michael
Author: 

Comments ( 0 )

No comments available

Add a comment
{{postCtrl.cmtErrMsg}}

Frequently asked questions ( 5 )

Q

What is Jenkins?

A

Jenkins is an open-source tool with a plugin built for continuous integration purposes.

Q

What is the requirement for using Jenkins?

A

A source code repository which is accessible, for instance, a Git repository
A working build script, e.g., a Maven script, checked into the repository

Q

What is CI and CD in Jenkins?

A

Jenkins is used to implementing Continuous Integration (CI) and Continuous Delivery (CD) for any development project. CI/CD, a key component of a DevOps strategy, allows you to shorten the development lifecycle while maintaining quality by automating tasks like testing.

Q

Why use the Jenkins pipeline?

A

Jenkins pipeline allows us to define a complete list of events that happen in the code lifecycle.

Q

What is the default port of Jenkins?

A

The default port of Jenkins port 8080

Back To Top!
Rank
User
Points

Top Contributers

userNamenaveelansari
135850

Top Contributers

userNameayanbhatti
92510

Top Contributers

userNamehamzaahmed
32150

Top Contributers

1
userNamelinuxhelp
31040

Top Contributers

userNamemuhammadali
24500
Can you help David Lopez Guillen ?
Ayuda urgente instale SSL para servidor Opensuse y ahora no funciona tengo servicio web

hola segui este tutorial para tener un certificado ssl y ahora no se ve mi app en la red, espero alguien pueda ayudarme, tengo M9oodle en3.5 en un servidor open suse y ahora no funciona por favor ayuda.

https://www.linuxhelp.com/how-to-create-ssl-certificate-in-opensuse

Networking
  • Routing
  • trunk
  • Netmask
  • Packet Capture
  • domain
  • HTTP Proxy
Server Setup
  • NFS
  • KVM
  • Memory
  • Sendmail
  • WebDAV
  • LXC
Shell Commands
  • Cloud commander
  • Command line archive tools
  • last command
  • Shell
  • terminal
  • Throttle
Desktop Application
  • Linux app
  • Pithos
  • Retrospect
  • Scribe
  • TortoiseHg
  • 4Images
Monitoring Tool
  • Monit
  • Apache Server Monitoring
  • EtherApe 
  • Arpwatch Tool
  • Auditd
  • Barman
Web Application
  • Nutch
  • Amazon VPC
  • FarmWarDeployer
  • Rukovoditel
  • Mirror site
  • Chef
Contact Us | Terms of Use| Privacy Policy| Disclaimer
© 2025 LinuxHelp.com All rights reserved. Linux™ is the registered trademark of Linus Torvalds. This site is not affiliated with linus torvalds in any way.