Jenkins is an automation server and a continuous integration tool. It provides several plugins for building deployments and automation for your applications. You can use Jenkins as a simple CI (Continuous Integration) server or configure this for the CD (Continuous Delivery) hub. With Jenkin’s help, you can efficiently distribute work across multiple machines, helping drive builds, tests, and deployments across multiple platforms faster.

This guide will help you to install Jenkins on Ubuntu 20.04 LTS system. Let’s go through the tutorial to install Jenkins on an Ubuntu system.

Step 1 – Installing Java

Jenkins required Java to run on any operating systems. The latest versions of Jenkins is test with Java 8 & 11 versions. To fulfill the requirements, you can install OpenJDK on your system.

To install OpenJDK Java on your Ubuntu system, type:

sudo apt update 
sudo apt install default-jdk 

Once the installation finished, check the Java version by typing the below command:

java -version 

openjdk version "11.0.8" 2020-07-14
OpenJDK Runtime Environment (build 11.0.8 10-post-Ubuntu-0ubuntu120.04)
OpenJDK 64-Bit Server VM (build 11.0.8 10-post-Ubuntu-0ubuntu120.04, mixed mode, sharing)

Step 2 – Enable Jenkins PPA

Jenkins team provides official repositories for package management for the popular operating system for installing Jenkins on a Linux VPS. Use the below commands to enable Jenkins PPA on your Ubuntu system. This repository contains required packages to install Jenkins on Ubuntu Linux.

wget -q -O - https://pkg.jenkins.io/debian/jenkins.io.key | sudo apt-key add - 
sudo sh -c 'echo deb http://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list'  

Step 3 – Install Jenkins on Ubuntu 20.04

Update the apt-get cache before installing Jenkins on Ubuntu. After that, you can install Jenkins on an Ubuntu system by running the below commands.

sudo apt update 
sudo apt install jenkins 

Once the installation complected, Jenkins service run on port 8080. If the same port is occupied by any other service on your system, You can edit /etc/default/jenkins file and change its port by setting HTTP_PORT value.

 HTTP_PORT=8080

and restarted Jenkins service after making changes

sudo systemctl restart jenkins 

Step 4 – Access Jenkins Web Interface

Access your server on port 8080 (Or updated port) in your favorite web browser. The default installation password can be found at /var/lib/jenkins/secrets/initialAdminPassword as showing in the below image.

How To Install Jenkins on Ubuntu 20.04 Applications CI Jenkins

Now select the appropriate option to install the plugin. You can choose to install suggested plugins or select the required plugins options.

How To Install Jenkins on Ubuntu 20.04 Applications CI Jenkins

Next, create an admin account for your Jenkins setup. Which is required to log in to Jenkins.

How To Install Jenkins on Ubuntu 20.04 Applications CI Jenkins

After the successful completion of the Jenkins setup wizard, You will be redirected to Jenkins dashboard.

How To Install Jenkins on Ubuntu 20.04 Applications CI Jenkins

Step 5 – Install Required Jenkins Plugin

Login to Jenkins dashboard and navigate to Manage Jenkins >> Manage Plugins >> Available Tab and select the plugins to install.

How To Install Jenkins on Ubuntu 20.04 Applications CI Jenkins

To update existing installed plugins in Jenkins Manage Jenkins >> Manage Plugins >> Update Tab

Step 6 – Add More Accounts

To create more accounts, login to the Jenkins admin panel and then navigate to Manage Jenkins >> Manage Users >> Create User . Enter the required details and click Create User.

How To Install Jenkins on Ubuntu 20.04 Applications CI Jenkins

Conclusion

This tutorial helps you to install Jenkins on your Ubuntu 20.04 Linux system. You can now configure your application with CI/CD architecture.