Blog Detail

Covid-19 Tracker Ask Question

preview image DevOps
by Anurag Srivastava, May 26, 2018, 6:42:02 PM | 3 minutes |

Install Jenkins on Ubuntu

Introduction to Jenkins

Jenkins is an open source DevOps tool which is basically use to automate repetitive tasks like code deployment on server. Main purpose of Jenkins is to do continuous integration and delivery of software.

Continuous Integration is a process where dev team writes their code and integrate it to a central repository like Git or SVN. This process required a continuous build process through which developers can deploy their code and unit test at a regular interval.

We can install Jenkins with basic sets of plug-ins. It can be extended by installing various plug-ins as per our requirement. For example if we want to use Git with Jenkins we can install the git plug-in or if we need SonarQube to test the code quality before the deployment then we can install the plug-in for SonarQube. I will cover the integration with SonarQube in later blogs so stay tuned.


For installing Jenkins on Ubuntu we need following:
1) A machine with Ubuntu 16.04 or higher.
2) A non root user with sudo privilege.
3) At-least 1GB of RAM.

Installation on Ubuntu:

Jenkin is based on JAVA and we can install it in different ways like using the package manager or by downloading the WAR file.

Method 1:

First step is to add the repository key:

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

We will get OK in the response of the above command.

Second step is to appennd this debian package repository to the server's source.list

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

Third step is to update the system repository

sudo apt-get update

Fourth step is to install Jenkins

sudo apt-get install jenkins

Method 2:

Download the debian software package from here.

Check file and if execute permission is not there please give execute permission using following command

sudo chmod +x jenkins_2.124_all.deb

Install Jenkins using following command

sudo dpkg -i jenkins_2.124_all.deb

Start and check the status:

Now start Jenkins and verify the status

sudo systemctl start jenkins
sudo systemctl status jenkins

Access Jenkins:
Now we can open Jenkins through browser by opening following URL:


Configure Jenkins:

For the first time Jenkins will prompt to unlock and will tell us to copy the password from following location:

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

We can copy the password and paste it against Administrator password test box. After that it will ask to choose the plug-in option. We can pick the suggested plug-ins for now, it will install those plug-in and then will ask to create the first admin user. After creating the admin account it will show the message as 'Jenkins is ready !'

If you want to know the Jenkins and SonarQube installation process and configuration then refer to my previous blog:

Why SonarQube is important for IT projects ?  
Configure Jenkins for Automated Code Deployment 
SonarQube installation on Ubuntu 
Configure SonarQube Scanner with Jenkins 
Analyze your project with SonarQube

In this way we can install Jenkins on Ubuntu machine. Please feel free to comment in case you have any queries.

Comments (0)

Leave a comment

Related Blogs

Introduction to Cloud Computing

Sep 23, 2020, 2:38:00 PM | Anurag Srivastava

Monitoring website uptime using Kibana

Sep 6, 2020, 5:20:33 PM | Anurag Srivastava

Monitoring Application using Elastic APM

Jan 16, 2020, 11:43:29 AM | Anurag Srivastava

Configuring Django application with Elastic APM

Jan 14, 2020, 10:22:34 AM | Anurag Srivastava

Introduction to Elastic APM

Jan 7, 2020, 7:15:34 PM | Anurag Srivastava

Why monitoring is important?

Jan 6, 2020, 7:30:13 PM | Anurag Srivastava

Top Blogs

Configure SonarQube Scanner with Jenkins

Jun 21, 2018, 4:58:11 AM | Anurag Srivastava

Execute Commands on Remote Machines using sshpass

Jul 16, 2018, 5:00:02 PM | Anurag Srivastava

Importing MongoDB data into Elasticsearch

Mar 9, 2019, 8:20:38 AM | Anurag Srivastava

Importing MySQL data into Elasticsearch

Feb 9, 2019, 12:06:18 PM | Anurag Srivastava

Configure Jenkins for Automated Code Deployment

Jun 13, 2018, 3:44:01 PM | Anurag Srivastava

Deploying Angular code using Python script

Jun 26, 2018, 4:50:18 PM | Anurag Srivastava