How to Setup Jenkins On Ubuntu 20.04 LTS

Jenkins is an free & open source continuous integration/continuous delivery and deployment (CI/CD) automation software written in the Java programming language. It is used to implement CI/CD workflows, called pipelines.

It provides continuous integration and continuous delivery in software projects by automating parts related to build, test, and deployment.

Install Jenkins on Ubuntu.

Update the System.

apt-get update

Install Java.

apt install default-jre

Check Java version.

java -version

Add the repository key.

wget -q -O - https://pkg.jenkins.io/debian-stable/jenkins.io.key | sudo apt-key add -

Add package repository address to the server’s sources.list.

sudo sh -c 'echo deb http://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list'

Update the System.

apt-get update

Install Jenkins.

apt-get install jenkins

Start Jenkins Service.

systemctl start jenkins

Here is the command output.

● jenkins.service - LSB: Start Jenkins at boot time
     Loaded: loaded (/etc/init.d/jenkins; generated)
     Active: active (exited); 4s ago
       Docs: man:systemd-sysv-generator(8)
    Process: 5415 ExecStart=/etc/init.d/jenkins start (code=exited, status=0/SUCCESS)

Allow port Number 8080 on ufw firewall.

ufw allow 8080

Allow Openssh & Enable ufw.

ufw allow OpenSSH
&
ufw enable

Press y.

Check ufw status.

ufw status

Here is the command output.

Status: active

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

Access Jenkins.

Test the Jenkins.

 

http://server_ip:8080

To get the initial password from /var/lib/jenkins/secrets/initialAdminPassword.Pass the administrator password & Click on Continue.

Fig 1

 

 

There are Two option to install jenkins plugins: suggested or select the plugins.

 

Fig 2

 

Click on Select Plugins option and select plugins as per the requirement & Click on Install.

 

Fig. 3

 

 Click on Install suggested Plugins which will immediately begin the installation process.

 

Fig. 4

 

Provide the Jenkins User credentials & Click on Save & Continue.

 

Fig. 5

 

Check Jenkins URL & Click on Save & Continue.

 

Fig. 6

 

Now Jenkins is ready to use, Click on Start using Jenkins.

 

Fig. 7

 

Now we can configure Jenkins as per requirement.

 

Fig. 8

 

Leave a Reply