How To

Install Apache Cassandra on Ubuntu: Complete Setup Guide

Apache Cassandra is a powerful open-source NoSQL database designed for high availability, fault tolerance, and massive scalability. Organizations handling large volumes of data often rely on Cassandra because it eliminates single points of failure while maintaining excellent performance across distributed environments.

If you want to Install Apache Cassandra on Ubuntu, the process is straightforward. With the right dependencies in place, you can quickly deploy a reliable database platform capable of supporting modern applications and large-scale workloads.

Why Install Apache Cassandra?

Before you Install Apache Cassandra, it’s worth understanding why this database is widely adopted across the industry.

Cassandra is built for environments where uptime and scalability are critical. Unlike traditional relational databases, it distributes data across multiple nodes, ensuring continuous availability even if individual servers fail.

Key advantages include:

  • High availability and fault tolerance
  • Horizontal scalability
  • Distributed architecture
  • Fast write performance
  • No single point of failure
  • Support for large datasets

These capabilities make Cassandra a popular choice for data-intensive applications.

Install Apache Cassandra Prerequisites

Apache Cassandra requires Java to run properly. Ubuntu systems should have a compatible OpenJDK version installed before proceeding with the database setup.

First, update your package index:

sudo apt update

Then install OpenJDK:

sudo apt install openjdk-8-jdk

To confirm Java is available, check the installed version:

java -version

A successful output indicates that your environment is ready for Cassandra installation.

Install Apache Cassandra Repository and Packages

The next step is adding the official Cassandra repository to your Ubuntu system.

Install HTTPS transport support:

sudo apt install apt-transport-https

Import the repository signing key and configure the repository source:

wget -q -O - https://www.apache.org/dist/cassandra/KEYS | sudo apt-key add -

After enabling the repository, update package information and install Cassandra:

sudo apt update
sudo apt install cassandra

Once installation finishes, the Cassandra service typically starts automatically.

Verify that the node is running correctly:

nodetool status

If the node status appears as “UN” (Up and Normal), Cassandra is functioning properly.

Configure Apache Cassandra Settings

After you Install Apache Cassandra, configuration files are located in the /etc/cassandra directory, while database data is stored under /var/lib/cassandra.

By default, Cassandra listens on localhost. This configuration works well for local development environments. If you plan to connect from remote systems, additional network configuration may be required.

To access Cassandra’s command-line interface, run:

cqlsh

This utility allows you to execute CQL (Cassandra Query Language) commands and manage databases directly from the terminal.

Rename Your Cassandra Cluster

A default Cassandra deployment uses a generic cluster name. For production environments, assigning a custom cluster name is recommended.

Open the Cassandra shell:

cqlsh

Update the cluster name:

UPDATE system.local
SET cluster_name = 'Production Cluster'
WHERE KEY = 'local';

Next, update the same cluster name inside the Cassandra configuration file and restart the service to apply changes.

Conclusion

Learning how to Install Apache Cassandra on Ubuntu gives you access to one of the most scalable and resilient NoSQL database platforms available today. With Java installed, repositories configured, and cluster settings customized, your Cassandra environment is ready to support high-performance applications and growing datasets. Whether you’re building distributed systems or managing large-scale analytics workloads, Cassandra provides a reliable foundation for modern data infrastructure.

Cyber Defence

Recent Posts

Nginx Commands in Linux: Start, Stop, Reload, Test, and Log

Nginx is a high-performance web server and reverse proxy trusted by some of the largest…

1 day ago

ufw Command in Linux: Manage Firewall Rules with Examples

ufw (Uncomplicated Firewall) sits on top of iptables (or nftables on newer systems) and replaces…

1 day ago

who Command in Linux: Show All Logged-In Users and Sessions

When you share a server with a team or investigate unexpected activity, the first question…

1 day ago

file Command in Linux: Identify File Types Without Extensions

The file command inspects the actual contents of a file and reports its type — regardless of…

2 days ago

chattr Command in Linux: Set File Attributes with lsattr

chattr sets and removes special file attributes that operate at the filesystem level, separate from standard…

2 days ago

env Command in Linux: Show and Set Environment Variables

env prints the current environment, sets or removes variables for a single command, and can start…

2 days ago