The installation instructions may become out of date at any time due to updates to Jenkins. Feel free to "Google it" as a supplement to this guide.

1. Setup Debian antlet

Login to antMan and spin up an Debian LXC antlet.

If you are going to run your builds on this Jenkins antlet, which we will be in this tutorial, be sure to allocate the appropriate amount of RAM and vCPUs for your build.

SSH into your Antsle then your Debain antlet

ssh <username>@<hostname>.local
ssh root@10.1.1.<antlet-ip>

The default root password is antsle

Make sure you are on the latest version:

apt update
apt upgrade

At the time of this writing the latest stable Debian is 9.8

2. Install Jenkins

First, we need to install java on the antlet ad Jenkins is a Java application.

apt install openjdk-8-jdk

Import the GPG keys of the Jenkins repository

wget -q -O - | apt-key add -

When your key is imported, we want to add the Jenkins repository to the antlet

sh -c 'echo deb binary/ > /etc/apt/sources.list.d/jenkins.list'

Now lets update the package list and install the latest version of Jenkins

apt update
apt install jenkins

Start the Jenkins service and systemctl enable jenkins

systemctl start jenkins

We also want to have it automatically start on boot

systemctl enable jenkins

3. Make Jenkins Accessible

1. Accessing by Domain Name

If you want to access your Jenkins on a specific url (which is recommended) have a look at our accessing antlets by domain name page.

2. Accessing by Private IP

We could also add a vNIC to the antlet in antMan so that the antlet can acquire a IP from our local network.

In antMan, click on the antlet, Go to “Virtual Network”, and click on “New virtual NIC”. Choose which physical interface you want it to route to, this will be br0 by default.

Now stop the antlet, and start again.

Now ssh back into the antlet. Check the name of the new interface that we have assigned, its most likely eth1.

ifconfig -a

And use your favourite editor to edit the interfaces file.

nano /etc/network/interfaces

You might want to set it to a static IP, but thats particular to your network so we will just set it to dhcp here. Your file should now look like this:

auto lo
iface lo inet loopback

auto eth1
iface eth1 inet dhcp

auto eth0
iface eth0 inet dhcp

Restart the network.

service networking restart

Run the following command and Note the new local network IP that is assigned to to our new nic.

ip -4 -o addr show eth1 | awk '{print $4}' | cut -d "/" -f 1

You can now access Jenkins in your web browser with that IP on port 8080. For example:

3. Configure Jenkins

It will then prompt you for the password initialAdminPassword which you can with the following command:

cat /var/lib/jenkins/secrets/initialAdminPassword

You can then go through the options of installing selected plugins, set up new accounts, etc.

Once you get to the "Instance Configuration" page you can put it in your domain if you it set up a domain above. If you are accessing it with the private IP, then just set that pre-populated IP.

Congratulations! You now have Jenkins running on your own Private Cloud.

To change the admin password, click on the "admin" dropdown on the top right. Then hit "Configure" on the left, and scroll down to change the password.

Happy Building!

Last updated