How to Install Apache Cassandra 5.x on Debian 11 & 12 (Updated 2026 Guide)

Apache Cassandra

IIntroduction

Apache Cassandra is a highly scalable, distributed NoSQL database designed to handle large amounts of data across many commodity servers without a single point of failure.

In this updated 2026 guide, you will learn how to install Apache Cassandra on Debian 11 and Debian 12 using the latest official repository method. This tutorial also includes configuration steps, verification, and troubleshooting tips to ensure your setup runs smoothly.

Here are some key features of Apache Cassandra:

  • Distributed architecture: Cassandra is designed to run on a cluster of commodity hardware, providing high availability and fault tolerance. Data is replicated across multiple nodes, ensuring that it is always available, even if some nodes fail.
  • High scalability: Cassandra can scale horizontally by adding more nodes to the cluster. This allows it to handle large amounts of data and high traffic loads with ease.
  • Flexible data model: Cassandra’s column-family data model allows for a flexible schema that can handle a wide range of data types, including structured, semi-structured, and unstructured data.
  • High performance: Cassandra is designed to provide high throughput and low latency, making it ideal for use cases that require fast data access and real-time analytics.
  • Tunable consistency: Cassandra allows you to configure the level of consistency you need for your application, from eventual consistency to strong consistency.
  • Open-source and community-driven: Cassandra is an open-source project with a large and active community of developers and users.

To use Apache Cassandra, we will need to install it on our system or use a cloud-based service that provides Cassandra hosting. The installation process will vary depending on our operating system and the version of Cassandra you want to install.

Apache Cassandra Installation

Prerequisites

In this tutorial we will use Apache Casandra 5.x, before we proceed to the Apache Cassandra installation process, there are several prerequisites that must be met, namely :

  • A Debian 11 or 12 operating system.
  • Java installed on the system.
  • It’s recommended that you use a fresh OS install to prevent any potential issues.
  • A root user access or normal user with administrative privileges.

As mentioned above, Apache Cassandra requires Java installed on the system, then we need to verify it first. To verify Java installed on the system, we will submit following command line :

$ java -version

Output :

ramansah@otodiginet:~$ java -version
openjdk version "11.0.12" 2021-07-20
OpenJDK Runtime Environment (build 11.0.12+7-post-Debian-2)
OpenJDK 64-Bit Server VM (build 11.0.12+7-post-Debian-2, mixed mode, sharing)

If our system has no Java installed on the system, then we will install it first. For Installing OpenJDK 11 on Debian 11 BullsEye can be found at How To Install OpenJDK 11 On Debian 11 article.

The Apache Cassandra installation will be consist of several steps, as mentioned below :

  1. Update Debian 11 Local Repository
  2. Adding Apache Cassandra Repository
  3. Installing Apache Cassandra
  4. Verify Cassandra Installation

1. Step 1: Update System Packages

Before installing Apache Cassandra on Debian 11 Bullseye, we have to prepare the environment first. We will update our system to ensure that we have the latest security patches and updates. We can do this by running the appropriate command Debian 11 system.

$ sudo apt update && sudo apt upgrade -y

2.Β  Add Apache Cassandra Repository (Updated Method)

⚠️ The old apt-key method is deprecated. Use the modern keyring approach below.

Create keyring directory:

sudo mkdir -p /etc/apt/keyrings

Download and add repository key:

curl https://downloads.apache.org/cassandra/KEYS | sudo gpg --dearmor -o /etc/apt/keyrings/cassandra.gpg

Add Cassandra repository:

echo "deb [signed-by=/etc/apt/keyrings/cassandra.gpg] https://debian.cassandra.apache.org 50x main" | sudo tee /etc/apt/sources.list.d/cassandra.list

Update package list:

sudo apt update

3. Install Apache Cassandra

In this step, we will install Apache Cassandra on Debian 11 operating system. We will do following commands line:

sudo apt install cassandra -y

Output :

ramansah@otodiginet:~$ sudo apt install cassandra -y
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Suggested packages:
cassandra-tools
The following NEW packages will be installed:
cassandra
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 47.3 MB of archives.
After this operation, 58.5 MB of additional disk space will be used.
Get:1 https://downloads.apache.org/cassandra/debian 40x/main amd64 cassandra all 4.0.1 [47.3 MB]
Fetched 47.3 MB in 1min 51s (425 kB/s)
Selecting previously unselected package cassandra.
(Reading database ... 136457 files and directories currently installed.)
Preparing to unpack .../cassandra_4.0.1_all.deb ...
Unpacking cassandra (4.0.1) ...
Setting up cassandra (4.0.1) ...
Adding group `cassandra' (GID 123) ...
Done.
vm.max_map_count = 1048575
net.ipv4.tcp_keepalive_time = 300
update-rc.d: warning: start and stop actions are no longer supported; falling back to defaults

By default Apache Cassandra will be started after installation was completed. Then we will check its service by submitting command line :

$ sudo systemctl status cassandra

Output :

ramansah@otodiginet:~$ sudo systemctl status cassandra
● cassandra.service - LSB: distributed storage system for structured data
Loaded: loaded (/etc/init.d/cassandra; generated)
Active: active (running) since Fri 2021-09-24 12:37:11 EDT; 1min 5s ago
Docs: man:systemd-sysv-generator(8)
Process: 7487 ExecStart=/etc/init.d/cassandra start (code=exited, status=0/SUCCESS)
Tasks: 58 (limit: 4623)
Memory: 1.4G
CPU: 15.289s
CGroup: /system.slice/cassandra.service
└─7595 /usr/bin/java -ea -da:net.openhft... -XX:+UseThreadPriorities -XX:+HeapDumpOnOut>

Sep 24 12:37:11 otodiginet systemd[1]: Starting LSB: distributed storage system for structured data.>
Sep 24 12:37:11 otodiginet systemd[1]: Started LSB: distributed storage system for structured data.
Apache Cassandra Service

4. Start and Enable Cassandra Service

Start Cassandra:

sudo systemctl start cassandra

Enable Cassandra to start on boot:

sudo systemctl enable cassandra

5. Verify Apache Cassandra Installation

When Apache Cassandra installation was competed done, then we will verify if Apache Cassandra was installed on the system. For this purpose, we will use a command line to check the node status.

$ sudo nodetool status

Output :

ramansah@otodiginet:~$ sudo nodetool status
Datacenter: datacenter1
=======================
Status=Up/Down
|/ State=Normal/Leaving/Joining/Moving
-- Address Load Tokens Owns (effective) Host ID Rack
UN 127.0.0.1 69.04 KiB 16 100.0% e014e9c1-7c2c-4c4f-9c76-f8981a0c5b75 rack1

6. Basic Configuration (Optional)

Main configuration file:

/etc/cassandra/cassandra.yaml

Common configurations:

Change Cluster Name

cluster_name: 'MyCluster'

Listen Address

listen_address: your_server_ip

RPC Address

rpc_address: 0.0.0.0

After making changes, restart Cassandra:

sudo systemctl restart cassandra

5. CQLSH (Cassandra Query Language Shell)

CQLSH (Cassandra Query Language Shell) is a command-line tool that allows you to interact with Apache Cassandra using the Cassandra Query Language (CQL). CQL is a SQL-like language that is used to interact with Cassandra’s column-family data model.

To use CQLSH, you will need to have Apache Cassandra installed on your system. Once Cassandra is installed, you can start CQLSH by opening a terminal or command prompt and entering the following command:

$ cqlsh

Output :

ramansah@otodiginet:~$ cqlsh
Connected to Test Cluster at 127.0.0.1:9042

[cqlsh 6.0.0 | Cassandra 4.0.1 | CQL spec 3.4.5 | Native protocol v5]

Use HELP for help. cqlsh>

Example of using CQLSH

1. Create a keyspace:

CREATE KEYSPACE mykeyspace
WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 3};

2. Create a table

CREATE TABLE mytable (
id int PRIMARY KEY,
name text,
age int
);

 

3. Insert data into a table:

INSERT INTO mytable (id, name, age) VALUES (1, 'John', 30);

4. Query data in a table:

SELECT * FROM mytable WHERE age > 25;

5. Update data in a table :

UPDATE mytable SET age = 35 WHERE id = 1;

6. Delete data from a table:

DELETE FROM mytable WHERE id = 1;

Β Common Errors and Fixes

1. Cassandra Fails to Start

Check logs:

sudo journalctl -u cassandra

Common causes:

  • Not enough memory
  • Incorrect configuration

2. Java Version Issue

Ensure Java is installed correctly:

java -version

Use OpenJDK 11 or higher.

3. Port Already in Use

Default Cassandra port: 9042

Check:

sudo netstat -tulnp | grep 9042

4. Node Not Joining Cluster

  • Check IP configuration
  • Verify seed nodes in cassandra.yaml

Useful Commands

Start Cassandra CLI:

cqlsh

Check node info:

nodetool info

Check cluster health:

nodetool status

Conclusion

In this short article, we have installed Apache Cassandra 4.0 on Debian 11 (Bulls Eye) operating system successfully. I hope this article will be helpful.

(Visited 228 times, 1 visits today)

You may also like