Setting Up Jenkins on Ubuntu Server From Scratch

  Java, Jenkins, Maven, Nexus

Introduction

This article describes the necessary steps to install, run and configure Jenkins on an Ubuntu server. The only prerequisites for this installation walkthrough are an Ubuntu server and access to a source code control system  like Subversion. You must also be included in the sudoers group sudo on the Ubuntu server. Everything else needed will be covered in this article.

Jenkins is a CI build system which processes user defined build jobs. These jobs are usually triggered by code changes in a specified SCM project. For example, a java developer commits a code version to the SCM which typically implements a new feature or fixes a bug that was previously described in a ticket (JIRA). Eventually, Jenkins will notice the code change and start the corresponding build job. When the job finishes, the developer and others will receive an email from Jenkins telling them the outcome of the build job, which could be success or fail.

The backbone of Jenkins build jobs is Maven. A Jenkins job not necessarily must compile and test code, although this is the most common job type in Jenkins. Sometimes a Jenkins admin creates simple utility jobs  for just copying files around or resetting workspace states. For a typical java build job, though, Jenkins requires maven running through the build steps and nexus for providing the required build artifacts. Therefore, we need to install the Java 8 JDK first, then Maven, followed by Nexus before we will install and run Jenkins.

For all coming installation tasks, it is necessary that you have access to a terminal of your Ubuntu server. It is most common to use putty / WinSCP for that. For this to work, you must add your username to the group ssh, like

$ adduser myusername ssh

LEAVE A COMMENT