How to Install Jenkins on Ubuntu 16.04

How to Install Jenkins on Ubuntu 16.04, in few simple steps. Jenkins is a simple, free and open-source Continuous Integration tool (CI), which is is one of the most popular application development practices in recent times. Jenkins is widely used for building, deploying and automating any project, providing hundreds of different plugins. It supports version control tools, including AccuRev, Subversion, Git, CVS, Perforce, ClearCase, Mercurial, and RTC, and can execute Apache Ant, Apache Maven and sbt based projects as well as arbitrary shell scripts. Installing Jenkins on an Ubuntu 16.04, is an easy task if you carefully follow the steps bellow

Table of Contents

  • 1. Jenkings Features:
  • 2. Update the system
  • 3. Install Jenkins on Ubuntu 16.04
  • 4. Start Jenkins on Ubuntu 16.04
  • 5. Login to Jenkins

1. Jenkings Features:

Jenkins comes with the following features out of the box, and many more can be easily added through plugins:

  • Easy and fast installation
  • Easy configuration
  • Continuous Integration and Continuous Delivery
  • Rich plugin ecosystem
  • Extensibility
  • Plugins
  • Distributed builds

In this tutorial we will guide you through the process of installing Jenkins on Ubuntu 16.04.

ban3

2. Update the system

Login to your Ubuntu 16.04 via SSH as user root

ssh root@IP_Address -p Port_number

It is highly recommended to regularly update your server. Run the below given command to update all installed packages

apt-get upgrade && apt-get upgrade

3. Install Jenkins on Ubuntu 16.04

Run the following command to add Jenkins key to the server

wget -q -O - https://pkg.jenkins.io/debian/jenkins-ci.org.key | sudo apt-key add -
OK

Once you add the key, add the Jenkins repository too

echo 'deb https://pkg.jenkins.io/debian-stable binary/' | tee -a /etc/apt/sources.list

Update the repositories

apt-get update

On Debian based distros such as Ubuntu, Jenkins can be installed through the ‘apt-get’ package manager. It will install Jenkins, Java version 8 and all necessary dependencies.

apt-get install jenkins

4. Start Jenkins on Ubuntu 16.04

Once Jenkins is installed, start Jenkins

systemctl start jenkins

And check its status by running the following command

systemctl status jenkins

If everything is OK, you should receive an output similar to the following

● jenkins.service - LSB: Start Jenkins at boot time
   Loaded: loaded (/etc/init.d/jenkins; bad; vendor preset: enabled)
   Active: active (exited) since Wed 2017-09-13 10:35:57 CDT; 15s ago
     Docs: man:systemd-sysv-generator(8)
ban1

5. Login to Jenkins

Copy the password, enter it in the browser and click ‘Continue’. In the next steps you can install the plugins recommended by Jenkins or select just the plugins you need, create your first admin user, and that’s all. You can start using Jenkins for your projects.

In case you are curious to know more about Jenkins, its installation, configuration and usage, please check their official documentation.

Leave a Reply

Your email address will not be published. Required fields are marked *