How to Install and Configure Jenkins 2.0 – Getting Started

Installing and configuring Jenkins 2.0

Jenkins 2.0 has lots of great functionalities that will make the CI pipeline really smooth. One of such example is the DSL based build pipeline. In this guide, i will walk you through the steps for installing and configuring a Jenkins 2 server on a ubuntu 14.04 box.

Install and Configure Jenkins 2.0

Follow the steps given below to install and configure Jenkins 2 on a ubuntu server.

Note: We are doing this installation on a Vagrant Ubuntu 14.04 box.

Note: Centos/Rehat users follow this tutorial Install jenkins 2 on centos/Redhat

1. Log in to the server and update it.

sudo apt-get -y update

2. Install java

sudo apt-get install -y default-jdk

3. Head over to http://pkg.jenkins-ci.org/debian/ and get the download link for Jenkins 2 Ubuntu version and download it using wget command.

wget http://pkg.jenkins-ci.org/debian-rc/binary/jenkins_2.0_all.deb

4. Install the package

sudo dpkg -i jenkins*

If you face any dependency error while installing the package, you need to execute the following command to rectify it.

sudo apt-get -f install

5. To add Jenkins to the boot menu, open /etc/rc.local file and add the following to the file.

/etc/init.d/jenkins start

Now you will be able to access the Jenkins server on port 8080 from localhost or using the IP address as shown below.

Install and Configure Jenkins 2.0

6. As you can see the above image, you need to provide the administrative password. You can get the password using the following command.

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

Copy the password and click continue.

7. Next, you will be asked to configure plugins as shown below. Select “Install Suggested Plugins” option. This will install all the required plugins for building your projects. It will take few minutes to install the plugins.

READ  List of DevOps Blogs and Resources for Learning

Jenkins 2.0 plugin configuration

8. Once installed, You need to create a user with password and click “save and finish”

Jenkins 2.0 user configuration

9. Click “Start Using Jenkins” and it will take you to the Jenkins Dashboard. Log in using the username and password that you have given in step 8.

10. If you want to build java maven project, you need to install maven using the following command.

sudo apt-get install -y maven2

That’s it! Now you have a fully functional Jenkins 2.0 server up and running. Next, would be the configuration of distributed setup wherein you will have a active master and slaves for building the projects.

If you are a docker user, you can Configure Jenkins 2.0 using the following commands.

docker run -p 8080:8080 -p 50000:50000 --name jenkins jenkinsci/jenkins:2.0-rc-1

Free DevOps Resources

Get DevOps news, tutorials and resources in your inbox. A perfect way If you want to get started with devops. Like you, we dont like spam.

10 comments

  1. Sammi Reply

    Hi,

    I tried to set up this way and I’m able to get to the “Getting Started” page, but when I’m giving the password it’s not moving forward. It’s not throwing any error.

    Any idea, why this is happening?

    Regards
    Sammi

      • Sammi Reply

        Looks like the problem is with the latest versions 2.7 and 2.8. I install 2.0 and this problem was not there.

        Regards
        Sammi

        • Devopscube Reply

          Hi Andrew, we tried with 2.9 and everything is working fine. Also we have updated the article. Thanks for comment!

      • Harpreet Reply

        Run this command to know the password.
        $docker exec jenkins-master cat /var/jenkins_home/secrets/initialAdminPassword

  2. Oksana Reply

    Hello! I have problem with step 5. if I understand clearly I have to open file etc/rc.local and then print the line above exit 0 : /etc/init.d/jenkins start. but it says that etc/rc.local is for read only.

  3. dilshani kumarapeli Reply

    This is not directly regarding this article.but I found it difficult to install maven in Jenkins 2.7.2 . Previously I used auto installer. but I haven’t found that option in this version.

Leave a Reply

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