Quick guide for .rpm and .deb packages to install CloudBees Jenkins Enterprise on a new instance

Article ID:216301647
2 minute readKnowledge base

Issue

Quick guide for .rpm and .deb packages to install CloudBees Jenkins Enterprise on a new instance.

Environment

Resolution

Download/Installation of the official CJOC/CJE releases

All the CJE releases can be found on the link below.

CloudBees creates different packages for each platform:

  • Debian

  • OpenSuse

  • OSX

  • rpm

  • war

  • Windows

Inside each section it is explained how to proceed with the installation.

Operative System configuration: Dedicated users for running the Jenkins process

By default, after installing a .rpm or a .deb package the jenkins:jenkins (user:group) is created. You can verify the ids created with the commands below:

id ­-u jenkins
id -g jenkins

Considerations:

  • If a shared folder is used as a location of the JENKINS_HOME the same user:group jenkins:jenkins needs to exist on this machine. You can add do this on the way below:

Create the “jenkins” user:

sudo useradd jenkins
sudo usermod ­u [jenkins’ UID goes here] jenkins

Create the “jenkins” group:

sudo groupadd jenkins
sudo groupmod ­g (jenkins’ GID goes here] jenkins
  • In case you have changed the default jenkins:jenkins, you will need to chown the following paths: /var/log/jenkins, /var/run/jenkins, /var/cache/jenkins and $JENKINS_HOME. Some OS admins doesn’t allow by default that a different user than root can access to those paths, so you might need to change the permissions on those paths.

  • It is always a bad practice to use the root user as owner of the jenkins process.

Initial configuration of Jenkins

The Jenkins configuration file is used for doing some Jenkins configurations like modifying the JENKINS_HOME or adding some JAVA_ARGS to customize Jenkins.

The Jenkins configuration file

The location of the Jenkins configuration file for a .rmp and a.deb installation can be found in:

  • /etc/default/jenkins: location for most of the Linux distributions.

  • /etc/sysconfig/jenkins: location for RedHat/CentOS distribution.

Initial memory configuration

The initial setup of Jenkins is not configured in terms of Xmx. The initial recommended configuration is -Xmx2048m. Notice that from these values you should monitor the heap memory used by Jenkins keeping in mind that that when Jenkins is busy the heap memory should represent an usage between 60-80%. If it is bigger than 80%, you should increase the heap memory on the instance unless you are suffering a memory leak.

In case of a RedHat/CentOS installation you will need to customize this in the jenkins.conf under the section JENKINS_JAVA_OPTIONS. For other distributions the section is called JAVA_ARGS instead.

  • RedHat/CentOS: JENKINS_JAVA_OPTIONS="-Xmx2048m -Djava.awt.headless=true"

  • Others: JAVA_ARGS="-Xmx2048m -Djava.awt.headless=true"

More information about how to add Java arguments to Jenkins can be found on this KB article

Start the Jenkins service

You just need to go to run sudo service jenkins start. CJE should be accessible on https://localhost:8080/ by default.

You can verify on /var/log/jenkins that the instance is up and running looking for the stacktrace below

INFO: Jenkins is fully up and running
Additional documentation

For deeper documentation, please visit our official documentation site.