Setting up Cassandra on Digital Ocean

These steps closely follow How To Install Cassandra and Run a Single-Node Cluster on Ubuntu 14.04


As of now, Jun 5 2016, there are issues using Ubuntu 16 and Cassandra. Specifically, Ubuntu 16 comes with Python 3, and in order to run cqlsh Python 2 is required. It is recommended that Ubuntu 14 is used instead.

Install Java

In order to install Cassandra, first install Java:

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-set-default

To verify that the installation is successful, check the version:

java -version

The output will be something like:

java version "1.8.0_91"
Java(TM) SE Runtime Environment (build 1.8.0_91-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.91-b14, mixed mode)

Install Cassandra

Add the Cassandra repository

echo "deb 35x main" | sudo tee -a /etc/apt/sources.list.d/cassandra.sources.list
echo "deb-src 35x main" | sudo tee -a /etc/apt/sources.list.d/cassandra.sources.list

Add three public keys from the Apache Software Foundation associated with the package repositories:

gpg --keyserver --recv-keys F758CE318D77295D
gpg --export --armor F758CE318D77295D | sudo apt-key add -
gpg --keyserver --recv-keys 2B5C1B00
gpg --export --armor 2B5C1B00 | sudo apt-key add -
gpg --keyserver --recv-keys 0353B12C
gpg --export --armor 0353B12C | sudo apt-key add -

Update the package database once again:

sudo apt-get update

Then install Cassandra:

sudo apt-get install cassandra


In order to troubleshoot Cassandra issues check Troubleshooting Cassandra.