How to Install Apache Cassandra on Ubuntu 16.04

Apache Cassandra is a NoSQL database management system which is free and open-source. It allows managing large amounts of data with high availability without compromising the performance. In this tutorial we are going to show you how to install Apache Cassandra on a Linux VPS running Ubuntu 16.04 as an operating system.

Apache Cassandra Prerequisites

Before installing Apache Cassandra on your server make sure that the following prerequisites are met:

– The latest version of Java 8, either the Oracle Java Standard Edition 8 or OpenJDK 8 is installed. If not, you can follow the instructions in this tutorial and we will show you how to install Java 8 on your Ubuntu VPS too. – If you are going to use cqlsh, make sure that the latest version of Python 2.7 is installed on your server.

Updating the Software on Ubuntu 16.04

First of all, connect to your Linux server via SSH, update the package index and upgrade all your installed software to the latest version available. You can do that by using the following commands:

Install Apache Cassandra on Ubuntu 16.04

To install Apache Cassandra on your server, first you need to add the Cassandra repository. At the moment of writing this tutorial, the latest stable release of Cassandra is 3.11.0. Therefore, run the following command to add the Cassandra repository on your server:

Start, Stop and Enable Apache Cassandra on Ubuntu 16.04

To start the Apache Cassandra service on your server, you can use the following command:

sudo systemctl start cassandra.service

To stop the service, you can use the command below:

sudo systemctl stop cassandra.service

If the service is not already enabled on system boot, you can enable it by using the command below:

sudo systemctl enable cassandra.service

What’s Next?

If you are new to Apache Cassandra it is recommended to use the official documentation as a starting point. The documentation is available at http://cassandra.apache.org/doc/latest/ and will help you to learn how to configure and use the service for your projects.