Skip to main content

Installing Jenkins

Hands-On Lab

 

Photo of Will Boyd

Will Boyd

DevOps Team Lead in Content

Length

00:45:00

Difficulty

Beginner

The first step in using Jenkins as part of a continuous integration pipeline is to install it. This activity will guide you through the steps required to install Jenkins in a Linux environment. After completing this exercise, you will know how to install Jenkins and be ready to begin using it for continuous integration.

What are Hands-On Labs?

Hands-On Labs are scenario-based learning environments where learners can practice without consequences. Don't compromise a system or waste money on expensive downloads. Practice real-world skills without the real-world risk, no assembly required.

Installing Jenkins

Introduction

You have been asked to install and configure a Jenkins server so that your team can use it in order to do continuous integration.

In order to accomplish this, you will need to:

  • Install Java JDK 8 or later
  • Configure the Jenkins YUM repository
  • Install Jenkins from the YUM repository
  • Enable and start the Jenkins service
  • Get the temporary admin password and use it to log in to Jenkins
  • Install the default plugins
  • Create a permanent administrator account

Some useful links:

Solution

  1. Begin by logging in to the lab server using the credentials provided on the hands-on lab page:

    ssh cloud_user@PUBLIC_IP_ADDRESS

Install and Run Jenkins

  1. Install Java and the epel-release package.

    sudo yum -y install java-1.8.0-openjdk epel-release
  2. Configure the Jenkins YUM repository

    sudo wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat-stable/jenkins.repo
  3. Install the Jenkins key.

    sudo rpm --import https://jenkins-ci.org/redhat/jenkins-ci.org.key
  4. Install Jenkins.

    sudo yum -y install jenkins-2.121.1
  5. Enable Jenkins.

    sudo systemctl enable jenkins
  6. Start Jenkins.

    sudo systemctl start jenkins

Create an Administrator Account

  1. In a browser, navigate to the Jenkins IP address.

    JENKINS_PUBLIC_IP:8080
  2. On the server, find the temporary password.

    sudo cat /var/lib/jenkins/secrets/initialAdminPassword
  3. Copy the temporary password.

  4. In the browser, paste in the temporary admin password into the box provided.

  5. Click Install suggested plugins.

  6. Enter details for an "admin" user.

  7. Click Save and Finish.

  8. Click Start using Jenkins.

Conclusion

Congratulations — you've completed this hands-on lab!