Jenkins Installation

In our last two posts we understand what Continuous Integration is and about an introduction to one of the famous CI tool called “Jenkins”.
Introduction to Jenkins a CI tool


Jenkins is available as open source and can be download from here for almost all major operating systems like Windows, Mac, Linux, CentOS, Ubuntu, etc. And even its available for Azure (Public Cloud) and Docker as well. We also have an option to download the generic web archive or jenkins.war file that we can run in our own web container.

Jenkins installers or binaries are available with two release versions as “LTS (Long Term Support)” which is released after every 12 weeks and “Weekly Release”. The preferable release is always LTS, which is more stable and less prone to bugs. Current LTS version while writing this blog is 2.60.3.

Three different ways of run Jenkins:


  • Running Jenkins using native package installer
  • Running Jenkins in web containers like Tomcat, WebLogic, etc.
  • Running Jenkins as java process

Demonstration of Jenkins Installation on Ubuntu Server:


1.) Below is the Debian package repository of Jenkins to automate installation and upgrade. To use this repository, first add the key to your system.

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

2.) Add the following entry in your /etc/apt/sources.list

deb https://pkg.jenkins.io/debian-stable binary/

3.) Update local packages and install Jenkins.

thinknyx_ubuntu:~#apt-get update
Hit:1 http://ppa.launchpad.net/ansible/ansible/ubuntu xenial InRelease
Get:2 http://security.ubuntu.com/ubuntu xenial-security InRelease [102 kB]
Hit:3 http://nova.clouds.archive.ubuntu.com/ubuntu xenial InRelease
Get:4 http://nova.clouds.archive.ubuntu.com/ubuntu xenial-updates InRelease [102 kB]
Get:5 http://nova.clouds.archive.ubuntu.com/ubuntu xenial-backports InRelease [102 kB]
Ign:6 https://pkg.jenkins.io/debian-stable binary/ InRelease
Get:7 https://pkg.jenkins.io/debian-stable binary/ Release [2,042 B]
Get:8 https://pkg.jenkins.io/debian-stable binary/ Release.gpg [181 B]
Get:9 https://pkg.jenkins.io/debian-stable binary/ Packages [12.4 kB]
Fetched 321 kB in 1s (247 kB/s)
Reading package lists… Done
thinknyx_ubuntu:~#
thinknyx_ubuntu:~#apt-get install jenkins
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following packages were automatically installed and are no longer required:
linux-headers-4.4.0-64 linux-headers-4.4.0-64-generic linux-headers-4.4.0-78 linux-headers-4.4.0-78-generic linux-headers-4.4.0-79
linux-headers-4.4.0-79-generic linux-headers-4.4.0-81 linux-headers-4.4.0-81-generic linux-headers-4.4.0-83
linux-headers-4.4.0-83-generic linux-headers-4.4.0-87 linux-headers-4.4.0-87-generic linux-headers-4.4.0-89
linux-headers-4.4.0-89-generic linux-headers-4.4.0-91 linux-headers-4.4.0-91-generic linux-image-4.4.0-64-generic
linux-image-4.4.0-78-generic linux-image-4.4.0-79-generic linux-image-4.4.0-81-generic linux-image-4.4.0-83-generic
linux-image-4.4.0-87-generic linux-image-4.4.0-89-generic linux-image-4.4.0-91-generic
Use ‘sudo apt autoremove’ to remove them.
The following additional packages will be installed:
ca-certificates-java daemon default-jre-headless fontconfig-config fonts-dejavu-core java-common libavahi-client3
libavahi-common-data libavahi-common3 libcups2 libfontconfig1 libjpeg-turbo8 libjpeg8 liblcms2-2 libnspr4 libnss3 libnss3-nssdb
libpcsclite1 libxi6 libxrender1 libxtst6 openjdk-8-jre-headless x11-common
Suggested packages:
default-jre cups-common liblcms2-utils pcscd openjdk-8-jre-jamvm libnss-mdns fonts-dejavu-extra fonts-ipafont-gothic
fonts-ipafont-mincho fonts-wqy-microhei fonts-wqy-zenhei fonts-indic
The following NEW packages will be installed:
ca-certificates-java daemon default-jre-headless fontconfig-config fonts-dejavu-core java-common jenkins libavahi-client3
libavahi-common-data libavahi-common3 libcups2 libfontconfig1 libjpeg-turbo8 libjpeg8 liblcms2-2 libnspr4 libnss3 libnss3-nssdb
libpcsclite1 libxi6 libxrender1 libxtst6 openjdk-8-jre-headless x11-common
0 upgraded, 24 newly installed, 0 to remove and 82 not upgraded.
Need to get 100 MB of archives.
.
.
.
Setting up jenkins (2.60.3) …
Processing triggers for libc-bin (2.23-0ubuntu9) …
Processing triggers for systemd (229-4ubuntu16) …
Processing triggers for ureadahead (0.100.0-19) …
Processing triggers for ca-certificates (20160104ubuntu1) …
Updating certificates in /etc/ssl/certs…
0 added, 0 removed; done.
Running hooks in /etc/ca-certificates/update.d…

done.
done.
thinknyx_ubuntu:~#
thinknyx_ubuntu:~#apt show jenkins
Package: jenkins
Version: 2.60.3
Priority: extra
Section: devel
Maintainer: Kohsuke Kawaguchi <[email protected]>
Installed-Size: 70.7 MB
Depends: daemon, adduser, procps, psmisc, net-tools, default-jre-headless (>= 2:1.8) | java8-runtime-headless
Conflicts: hudson
Replaces: hudson
Homepage: http://jenkins.io/
Download-Size: 70.2 MB
APT-Manual-Installed: yes
APT-Sources: https://pkg.jenkins.io/debian-stable binary/ Packages
Description: Jenkins is an open source automation server which enables developers around the world to reliably automate  their development lifecycle processes of all kinds, including build, document, test, package, stage, deployment, static analysis and many more.

Jenkins is being widely used in areas of Continuos Integration, Continuous Delivery, DevOps, and other areas. And it is not only about software, the same automation techniques can be applied in other areas like Hardware Engineering, Embedded Systems, BioTech, etc.

For information see https://jenkins.io

4.) By default Jenkins runs on port 8080 and after successful installation can be accessed at http://localhost:8080 or http://servername:8080.

Jenkins Install

5.) The security key available at path /var/lib/jenkins/secrets/initialAdminPassword.

6.) Once password is entered, we will prompt to configure Jenkins with recommended plug-in or we can choose the plug-in we want to install. A last the installer will ask to setup the admin account.. Once done our Jenkins is ready to be used.

There are two other ways to install and setup our jenkins server, but this posted method is most common and easy to use.

In our next post we will bring some of the most commonly used plugin’s with Jenkins.

Leave a Comment

Your email address will not be published.