Jenkins installation

You can install Jenkins in 2 different manners:

  • As a Linux package (apt-get ...)
  • As a standalone WAR package

Installation (Ubuntu)

The following instructions are for Ubuntu 14.04 LTS.

You can find all these instructions and more on the official wiki page:

!! NOTE: Jenkins updates are not always very good. Be careful when you run apt-get upgrade !!

Get package

cd /tmp
wget -q -O - | sudo apt-key add -
sudo sh -c 'echo deb binary/ > /etc/apt/sources.list.d/jenkins.list'
sudo apt-get update
sudo apt-get install jenkins

Service configuration

To adjust root path and port you just need to edit the service launcher.

vim /etc/default/jenkins

Adjust the default values:

# port for HTTP connector (default 8080; disable with -1)

# port for AJP connector (disabled by default)

# servlet context, important if you want to use apache proxying

JENKINS_ARGS="--webroot=/var/cache/jenkins/war --httpPort=$HTTP_PORT --ajp13Port=$AJP_PORT --prefix=/jenkins-guillaume"

Restart the service

sudo service jenkins restart

Test it! Go to http://localhost:8080/jenkins-guillaume


Edit your firewall script and add:

IPTABLES=`which iptables`

$IPTABLES -A INPUT -p tcp --dport 8080 -j ACCEPT                # Web container
$IPTABLES -A OUTPUT -p tcp --dport 8080 -j ACCEPT               # TomCat (Java Web Server)

Of course, if you already have a Tomcat server you need to adjust these ports.

Adjust jobs directory

Jenkins requires a lot of space to keep builds, versions and so on... By default everything goes into /var/lib/jenkins

To use another directory, such as /home/jenkins:

1. Create jobs directory

mkdir /home/jenkins
chmod -R 777 /home/jenkins
chown -R jenkins:jenkins /home/jenkins

2. Edit configuration file

vim /etc/default/jenkins

Set the JENKINS_HOME variable


Restart service

service jenkins restart

Installation (war)

Just download the latest WAR and deploy it on your Tomcat.

Jenkins CI: