Vagrant templates for local development and learning DataStax Enterprise and the Cassandra database system
Ruby Shell
Switch branches/tags
Nothing to show
Clone or download
bcantoni Update for latest Apache Cassandra 2.1.x and OpsCenter 5.2.x
Confirmed these changes work correctly for Apache Cassandra 2.1.20 and
OpsCenter Community Edition 5.2.5. Now that DataStax no longer publishes
the 'community' edition of Cassandra, point everything to come directly
from Apache Cassandra.
Latest commit 58e0f14 Feb 27, 2018

Vagrant Cassandra

This project contains templates for learning how to install and configure Apache Cassandra or DataStax Enterprise (DSE) on a local dev machine. It uses Vagrant to configure and run virtual machines (VMs) running in VirtualBox. Vagrant enables quickly building environments in a way that is repeatable and isolated from your host system. This makes it perfect for experimenting with different configurations of Cassandra and DSE.

Why create yet another Cassandra on Vagrant system? Many scripts and Vagrant projects are already fully assembled and configured. Instead, I like to learn from the ground up so I can better understand each step. In the templates below I've also tried to minimize external dependencies, and the number of tools which need to be installed. (For example, I don't use Chef or Puppet here.)

Related Projects

Here are a few related projects I learned from while assembling my Vagrant setup:

You may also find bcantoni/vagrant-deb-proxy helpful for speeding up Ubuntu package installs. See Package Caching below for details.

Posts from my blog related to this project:


Here are some quick screencasts which walk through the three different templates in this project:

1. Base

Vagrant Cassandra Single Node Screencast

2. MultiNode

Vagrant Cassandra Multi Node Screencast

3. MultiDC

Vagrant Cassandra Multi Datacenter Screencast


Note: These scripts were created on a Mac OS X 10.9/10.10/10.11 host with Vagrant v1.6/1.7 and VirtualBox v4.3/5.0. Everything should work for Linux or Windows hosts as well, but I have not tested those platforms. Shell scripts which are meant to run on the host (like or would need to have Windows equivalents created.

  1. Edit your local Hosts file to include the private network addresses (this makes it much easier to refer to the VMs by hostname):

     # vagrant-cassandra private network hosts    cassandra     dse0     dse1     dse2     dse3     dse4     dse10     dse11     dse12     dse13     dse14   node0   node1   node2   node3   node10   node11   node12   node13   node14   node15   node16

    Alternatively, try the vagrant-hostsupdater plugin which should do the same thing automatically. (I have not tried it.)

  2. Install VirtualBox

  3. Install Vagrant

  4. Check that both are installed and reachable from a command line:

     $ vagrant --version
     Vagrant 1.7.4
     $ VBoxManage --version
  5. Clone this repository

     $ git clone
     $ cd vagrant-cassandra
  6. Try each of the templates listed below, for example:

     $ cd 1.Base
     $ vagrant up
     $ vagrant ssh

Package Caching

These Vagrant files are configured to use a Debian/Ubuntu APT cache if configured. This can make the provisioning step faster and less susceptible to Ubuntu repository connection speeds.

If you want to run your own locally (through Vagrant), take a look at bcantoni/vagrant-deb-proxy.

To enable package caching, set the DEB_CACHE_HOST environment variable before creating the Vagrant VMs, for example:

$ export DEB_CACHE_HOST=""
$ vagrant up

Using Vagrant

The Vagrant documentation is very good and I recommend going through the Getting Started section.

These are the most common commands you'll need with this project:

  • vagrant up - Create and configure VM
  • vagrant ssh - SSH into the VM
  • vagrant halt - Halt the VM (power off)
  • vagrant suspend - Suspend the VM (save state)
  • vagrant provision - Run (or re-run) the provisioner script
  • vagrant destroy - Destroy the VM


These are the starting templates which go through increasing levels of complexity for a Cassandra installation. Each of these is located in its own subdirectory with its own Vagrantfile (the definition file used by Vagrant) and a README with instructions and more details.

1. Base

This is a base template with only Java pre-installed. It's a good getting started point to explore installing Cassandra and DataStax packages.

1. Base CentOS

Same as above, but using CentOS instead of Ubuntu.

2. MultiNode

This template creates 4 VMs: one for OpsCenter and 3 for Cassandra nodes. OpsCenter is preinstalled, and you can use that to finish building the cluster.

3. MultiDC

This template builds and configures a multi-datacenter cluster (one OpsCenter VM and 6 Cassandra nodes in 2 logical datacenters).

4. DSE

This template focuses on DataStax Enterprise (DSE) and can build a variable number of nodes in a cluster.

5. Installer

This template is structurally the same as 4.DSE, but instead uses the Standalone Installer which first came out with DSE 4.5.


  • Most templates are currently based off the ubuntu/trusty64 box which is running 64-bit Ubuntu 14.04 LTS. You can change the value if you want to try different guest operating systems.


Copyright 2014-17 Brian Cantoni

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.