DropVPS Team
Writer: John hens
how to install cassandra on debian 12.11

Table of Contents
What you will read?
Apache Cassandra is a highly scalable, open-source NoSQL database designed for handling large datasets across multiple servers. Installing Cassandra on Debian 12.11 helps you build powerful and reliable applications with excellent performance and fault tolerance.
Step 1: Update the System
Before installing Cassandra, update your Debian system to ensure all packages are current.
sudo apt update && sudo apt upgrade -y
Step 2: Install Java
Apache Cassandra requires Java to run. Install OpenJDK 17, which is recommended for Debian 12.11.
sudo apt install openjdk-17-jdk -y
Verify the installation:
java -version
Step 3: Add Apache Cassandra Repository
To get the latest stable version, you need to add the official Apache Cassandra repository to your Debian system.
echo "deb https://debian.cassandra.apache.org 311x main" | sudo tee /etc/apt/sources.list.d/cassandra.list
curl https://downloads.apache.org/cassandra/KEYS | sudo apt-key add -
sudo apt update
Step 4: Install Apache Cassandra
Now install Cassandra using the package manager to get the latest version directly from the repository.
sudo apt install cassandra -y
After installation, start and enable the Cassandra service.
sudo systemctl enable cassandra
sudo systemctl start cassandra
Step 5: Verify Cassandra Installation
It’s important to make sure Cassandra is running correctly and responding to client connections.
sudo systemctl status cassandra
You can also test the connection using the CQL shell:
cqlsh
Step 6: Basic Cassandra Commands
Once Cassandra is running, you can use basic commands to create keyspaces, tables, and insert data.
CREATE KEYSPACE testdb WITH replication = {'class':'SimpleStrategy', 'replication_factor' : 1};
USE testdb;
CREATE TABLE users (id UUID PRIMARY KEY, name text, email text);
INSERT INTO users (id, name, email) VALUES (uuid(), 'Alice', '[email protected]');
SELECT * FROM users;