Jenkins : FreeBSD

Installing Jenkins CI on FreeBSDĀ 

Installing Jenkins on FreeBSD is now as simple as running the following commands as root (or prefix the 'sudo' command):

You can install Jenkins LTS with pkg:

# pkg install jenkins-lts

Or if you want to install the latest version of Jenkins:

# pkg install jenkins

Compiling from ports:

# cd /usr/ports/devel/jenkins
# make install clean

This will automatically install Java (by default, OpenJDK)

Manually starting and stopping the Jenkins CI service

You can start, stop, restart, and get the status of Jenkins with the 'service' command run as root, like this:

# service jenkins start
# service jenkins status
# service jenkins restart
# service jenkins stop

Starting Jenkins CI automatically

To have Jenkins start automatically whenever your FreeBSD system starts, add the following line to /etc/rc.conf:


Accessing Jenkins on FreeBSD

It is the default configuration to listen on every address of the host and port 8180:

: ${jenkins_args="--webroot=${jenkins_home}/war --httpPort=8180 --prefix=/jenkins"}

Once you've installed and launched Jenkins, it will be available at the following URI. Note: you may find that the trailing slash is mandatory when using curl to test:


Changing the Jenkins CI listen address, port and prefix

This fine if you only want to access Jenkins directly from external. If you want the Jenkins can be accessed only from system on which it is installed, for example, put Jenkins behind of a reverse proxy which can provide https connection (or you want Jenkins can only be accessed through an SSH tunnel with port forwarding), or you just want to drop "/jenkins" prefix. Set the jenkins_args in the configuration file "/etc/rc.conf" or "/etc/rc.conf.d/jenkins", add the httpListenAddress argument and set its value to, and remove the prefix argument to the . For example:

jenkins_args="--webroot=${jenkins_home}/war --httpListenAddress= --httpPort=8180"

After making these changes, restart Jenkins to apply the change:

# service jenkins restart