Skip to content
Follow
Ubuntu Linux

How to Install Apache Cassandra on Ubuntu Linux

Richard
Written by
Richard
Jul 26, 2020 Updated Jul 14, 2026 3 min read
How to Change Default Apps in Ubuntu
How to Change Default Apps in Ubuntu

Apache Cassandra lets you install a powerful NoSQL database on Ubuntu Linux.

Apache Cassandra is a free, open-source database that’s great for storing huge amounts of information. It’s built to stay online and handle massive data growth, meaning your applications can always access what they need, even with a lot of users.

This guide shows you how to install Cassandra on Ubuntu versions 20.04 or 18.04.

Many big companies trust Cassandra for its strong performance and because it doesn’t require costly licenses. You’ll set up a reliable and secure database on your Ubuntu system.

⚡ Quick Answer

First, install OpenJDK 8 with `sudo apt update` and `sudo apt install openjdk-8-jdk`. Then, add the Cassandra repository and key, followed by `sudo apt update` and `sudo apt install cassandra`. Verify the installation with `nodetool status`.

Install JAVA

Apache Cassandra requires Java to run; you must install Java on your Ubuntu system before installing Cassandra. OpenJDK 8, a free version of Java, works well with Cassandra and is convenient to set up, preparing your Ubuntu system for the next step.

OpenJDK 8, an open-source version of Oracle Java, works well with Apache Cassandra, which is why this tutorial uses OpenJDK 8.

To install OpenJDK 8, run the commands below:

🐧Bash / Shell
sudo apt update
sudo apt install openjdk-8-jdk

To verify if OpenJDK is installed and running, run the commands below:

💻Code
java -version

It should print out the lines similar to the ones below:

💻Code
openjdk version "1.8.0_191"
OpenJDK Runtime Environment (build 1.8.0_191-8u191-b12-2ubuntu0.18.04.1-b12)
OpenJDK 64-Bit Server VM (build 25.191-b12, mixed mode)

With Java successfully installed, we can now proceed to install Apache Cassandra.

Installing Apache Cassandra

Apache Cassandra installation on Ubuntu Linux requires Java. Adding Apache Cassandra’s official package source is the most convenient way to install and update the database. This official package source simplifies Cassandra installation and updates, a more convenient alternative to manually installing with a .DEB file.

If you prefer not to install Cassandra from its .DEB file manually, then add Cassandra’s official package repository to make installing and updating it more convenient.

The Apache Cassandra repository and its key install by running commands. The first command imports the repository’s GPG key. The second command adds the Apache Cassandra repository to a new file named cassandra.sources.list, which is a file that lists software sources for your system.

🐧Bash / Shell
wget -q -O - https://www.apache.org/dist/cassandra/KEYS | sudo apt-key add -
sudo sh -c 'echo "deb http://www.apache.org/dist/cassandra/debian 311x main" > /etc/apt/sources.list.d/cassandra.sources.list'

After the steps above, run the commands below to install them.

🐧Bash / Shell
sudo apt update
sudo apt install cassandra

That should do it!

To verify if Cassandra is correctly installed, run the commands below:

💻Code
nodetool status

You should see a similar screen print as the one below:

💻Code
Status=Up/Down
|/ State=Normal/Leaving/Joining/Moving
--  Address    Load       Tokens       Owns (effective)  Host ID                               Rack
UN  127.0.0.1  103.68 KiB  256          100.0%            bbdd9509-523a-45ac-a03f-64c478515de9  rack1

That’s how you know Cassandra is installed and running.

📝Good to Know
To interact with Cassandra through CQL (the Cassandra Query Language), you can use a command line utility named cqlsh
💻Code
cqlsh

You should log on to the CQL terminal screen.

💻Code
Connected to Test Cluster at 127.0.0.1:9042.

Use HELP for help. cqlsh>

Conclusion:

  • Apache Cassandra offers a powerful, scalable NoSQL database solution suitable for handling vast amounts of data.
  • The installation process on Ubuntu 20.04 or 18.04 is straightforward, requiring only a few command-line entries.
  • By utilizing OpenJDK 8, you can effectively support Cassandra’s operations with minimal setup hassle.
  • Once installed, Apache Cassandra provides high availability and eliminates single points of failure.
  • Users can easily manage and interact with the database using CQL through the cqlsh utility.
  • As a free and open-source system, Apache Cassandra is a cost-effective choice for businesses looking to implement a robust database without incurring licensing fees.
  • For further exploration and resources, the Apache Cassandra homepage is a valuable reference.

Was this guide helpful?

Was this helpful?
Richard

About the Author

Richard

Tech Writer, IT Professional

Richard, a writer for Geek Rewind, is a tech enthusiast who loves breaking down complex IT topics into simple, easy-to-understand ideas. With years of hands-on experience in system administration and enterprise IT operations, he’s developed a knack for offering practical tips and solutions. Richard aims to make technology more accessible and actionable. He's deeply committed to the Geek Rewind community, always ready to answer questions and engage in discussions.

📚 Related Tutorials

How to Install Ubuntu Linux
Ubuntu Linux How to Install Ubuntu Linux
How to Install Apache on Ubuntu Linux
Ubuntu Linux How to Install Apache on Ubuntu Linux
How to Install GNOME Desktop on Ubuntu 24.04
Ubuntu Linux How to Install GNOME Desktop on Ubuntu 24.04
How to Install KDE Desktop on Ubuntu 24.04
Ubuntu Linux How to Install KDE Desktop on Ubuntu 24.04

No comments yet — be the first to share your thoughts!

Leave a Comment

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