Blog Detail

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.


Prerequisites:

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 - https://pkg.jenkins.io/debian/jenkins-ci.org.key | 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 https://pkg.jenkins.io/debian-stable 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.

https://pkg.jenkins.io/debian/binary/jenkins_2.124_all.deb

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:

http://localhost:8080


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 !'

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

About Author

Anurag Srivastava

Author | Blogger | Tech Lead | Data Scientist | Innovator |

View Profile

Comments (0)

Leave a comment

Related Blogs

Load csv Data into Elasticsearch

Oct 15, 2018, 6:25:43 PM | Anurag Srivastava

htop: An Interactive Process Viewer

Oct 13, 2018, 8:49:59 PM | Anurag Srivastava

Configure Logstash to push MySQL data into Elasticsearch

Jul 7, 2018, 8:51:30 AM | Anurag Srivastava

Execute Commands on Remote Machines using sshpass

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

Configure Jenkins for Automated Code Deployment

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

Configure SonarQube Scanner with Jenkins

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

Build and deploy Angular code using Python

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

Why SonarQube is important for IT projects ?

Apr 24, 2018, 2:52:28 PM | Anurag Srivastava

SonarQube installation on Ubuntu

May 12, 2018, 4:47:07 PM | Anurag Srivastava

Install Kafka on Ubuntu

Jul 12, 2018, 7:40:51 PM | Anurag Srivastava

Top Blogs

Build and deploy Angular code using Python

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

Configure SonarQube Scanner with Jenkins

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

Configure Logstash to push MySQL data into Elasticsearch

Jul 7, 2018, 8:51:30 AM | Anurag Srivastava

Configure Jenkins for Automated Code Deployment

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

SonarQube installation on Ubuntu

May 12, 2018, 4:47:07 PM | Anurag Srivastava

Execute Commands on Remote Machines using sshpass

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

Why SonarQube is important for IT projects ?

Apr 24, 2018, 2:52:28 PM | Anurag Srivastava

Install Jenkins on Ubuntu

May 26, 2018, 6:42:02 PM | Anurag Srivastava

Analyze your project with SonarQube

Jun 2, 2018, 10:49:54 AM | Anurag Srivastava

Install Kafka on Ubuntu

Jul 12, 2018, 7:40:51 PM | Anurag Srivastava