3 Steps to set up a temporary Jenkins server



Step 1

Step 2

Create a file called “Vagrantfile” and copy the code below into it.

# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant.configure(2) do |config|
# boxes at https://atlas.hashicorp.com/search.
config.vm.box = "ubuntu/trusty64"

config.vm.network "forwarded_port", guest: 8080, host: 8080
config.vm.network "forwarded_port", guest: 80, host: 80

# Provider-specific configuration so you can fine-tune various
# Example for VirtualBox:
config.vm.provider "virtualbox" do |vb|
# Customize the amount of memory on the VM:
vb.memory = "1024"

# Enable provisioning with a shell script. Additional provisioners such as
# documentation for more information about their specific syntax and use.
config.vm.provision "Provision Jenkins", type: "shell" do |s|
s.inline = "wget -q -O - https://jenkins-ci.org/debian/jenkins-ci.org.key | sudo apt-key add - n"
s.inline += "sudo sh -c 'echo deb http://pkg.jenkins-ci.org/debian binary/ > /etc/apt/sources.list.d/jenkins.list' n"
s.inline += "sudo apt-get update n"
s.inline += "sudo apt-get install -y jenkins n"
s.inline += "sudo service jenkins start n"
s.inline += "echo Jenkins provisioning done!"

You can download the code from https://github.com/limsim/vagrant-jenkins

Step 3

From the command line run

vagrant up

And then the magic starts! Vagrant will create a virtual machine using VirtualBox that will be installed with Ubuntu and Jenkins. You can access Jenkins by going to in your browser

When you’re done using Jenkins you can either shut down the virtual machine by running the command below from the command line

vagrant halt

Or run the below command to delete the virtual machine completely

vagrant destroy

Leave a Reply


WordPress.com Logo


Google photo


Twitter picture


Facebook photo


Connecting to %s