Your personal kitty, or “How to install Tomcat using Vagrant & Chef”


In a previous post I wrote about how to create new local environments very easy, and for that example I was using a LAMP environment, however sometimes you have to work with Java, so, for those cases you can use the same tools: Vagrant, Virtualbox, Puppet or Chef.

For this example we are going to install a new Tomcat 8 RC2 server, using Java 7, very easily using Chef.

If you are not yet using DevEnv, create your project and download it.

$ mkdir project_one
$ cd project_one

$ git clone
$ cd devenv

$ git submodule init
$ git submodule update
$ cd ../

Create your Vagrantfile

$ vi Vagrantfile

Use this configuration for your Vagrantfile (change the IP address if you need to) do |config|
 config.vm.define :tomcat do |tom| = "centos64"
  tom.vm.box_url = "" :hostonly, ""
  tom.vm.provision :chef_solo do |chef|
   chef.cookbooks_path = "devenv/chef/cookbooks"
   chef.run_list = [ "recipe[tomcat::default]" ]

Start your vagrant

$ vagrant up tomcat

And that’s it, now you can access your new Tomcat server using

$ vagrant ssh tomcat

And access it via web using (or the IP address previously chosen)

Now you have a functional Tomcat to deploy your projects without affecting your local environment. Enjoy!

Basilio Briceño

DevOps evangelist, SoftwareLibre activist, sometimes speaker & eclectic metalhead.


  1. Sandeep Rai   •  

    Hi Bailio,
    I am trying to checkout the project above but run into an error when trying to update
    Looks like something from submodule has not been committed that is referenced by parent project.
    Below is the output

    $ git submodule update
    fatal: reference is not a tree: a77285ea955929ce06a2d60ebfa32de07f36c5f0
    Unable to checkout ‘a77285ea955929ce06a2d60ebfa32de07f36c5f0′ in submodule path

  2. Vinicius Santana   •  

    Thank you!! This works fine for me. It was a great first step for this long jorny

  3. Manuel Loayza   •  

    Cloning into ‘puppet/modules/apt’…
    Username for ‘':
    Password for ‘':
    remote: Repository not found.
    fatal: repository ‘’ not found
    Clone of ‘git://’ into submodule path ‘puppet/modules/apt’ failed

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>