How To Install Jenkins on Ubuntu 20.04 / Ubuntu 18.04

Jenkins is an open-source automation server that helps to automate the repetitive tasks involved in the software development process, which includes building, testing, and deployments.

Jenkins was forked from the Oracle Hudson project and written in Java.

Here, we will see how to install Jenkins on Ubuntu 20.04 / Ubuntu 18.04.

Install Jenkins On Ubuntu 20.04

Install Java

Since Jenkins is written in Java, it requires Java 8 or Java 11 to run. Here, I will install the OpenJDK 11 for Jenkins installation.

sudo apt update

sudo apt install -y default-jre apt-transport-https wget

If you want to use the Oracle Java in place of OpenJDK, then use any one of the links to install it.

READ: How To Install Oracle Java on Ubuntu 20.04

READ: How To Install Oracle Java on Ubuntu 18.04

Verify the Java version after the installation.

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)

Add Jenkins Repository

Jenkins provides an official repository for its packages. To use the Jenkins repository, first, we will need to add the Jenkins public key to the system.

wget -q -O - | sudo apt-key add -

Then, add the Jenkins repository to your system.

echo "deb binary/" | sudo tee /etc/apt/sources.list.d/jenkins.list

Install Jenkins

Install Jenkins package using the apt command.

sudo apt update

sudo apt install -y jenkins

The Jenkins service should now be up and running. You can check the status of the Jenkins service using the below command.

sudo systemctl status jenkins
Jenkins Service Status On Ubuntu

Setup Jenkins

Open up a web browser and navigate it to the following URL to set up Jenkins.


For security reasons, Jenkins package puts up an initial password in /var/lib/Jenkins/secrets/initialAdminPassword file to prevent unauthorized Jenkins installation.

Use the cat command to see the initial password.

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


Jenkins Administrator Password

Copy and paste the above password on Jenkins setup wizard. Then, click on Continue.

Unlock Jenkins

You can choose to either install suggested plugins or select plugins to install that is most suitable for your needs.

Customize Jenkins Installation

Wait for the Jenkins plugins installation to complete. The installation of plugins may take 5 to 10 minutes to complete.

Installing Jenkins Plugins

Once the installation of the plugins is complete, create the first admin user for Jenkins.

Create Admin User

Set up Jenkins URL, which will provide the root URL for links to various Jenkins resources.

Jenkins URL

Jenkins is now ready for your automation jobs. Click on Start using Jenkins to access Jenkins.

Jenkins is ready

Access Jenkins

Open up a web browser and navigate it to the following URL.


Log in with the Jenkins admin account that you created earlier.

Jenkins Dashboard:

Create Jenkins Job

Let us test the Jenkins automated build by creating a sample build job with a shell command.


That’s All. You have successfully installed Jenkins on Ubuntu 20.04 / Ubuntu 18.04. I recommend you to visit Jenkins’s documentation for more information.

jenkinsubuntu 18.04ubuntu 20.04
Comments (0)
Add Comment