Apache Cassandra is a highly scalable NoSQL database designed to handle large amounts of data across multiple servers without a single point of failure. It is widely used for applications that require high availability, fault tolerance, and fast performance, making it popular among enterprises and developers working with big data systems.
Although Cassandra is primarily optimized for Linux environments, it can still be installed and used on Windows 11 for development, testing, and learning purposes. However, the setup process involves configuring dependencies such as Java and environment variables correctly to ensure the database runs without issues.
In this guide, we’ll walk you through the complete process of installing Cassandra DB on Windows 11, including all required prerequisites and configuration steps.
How to Install Cassandra DB on Windows 11
Before you begin, make sure you have administrative access on your Windows 11 PC and a stable internet connection. Since Cassandra depends on Java, you must install a compatible Java Development Kit before proceeding with the database installation.
1. Install Java Development Kit (JDK)
Cassandra requires Java to run properly on Windows 11.
- Open your browser and visit the official Oracle JDK download page or install OpenJDK.
- Download a compatible JDK version, preferably JDK 8 or JDK 11 depending on your Cassandra release.
- Run the installer and complete the setup process.
- After installation, press Windows + S, search for Environment Variables, and open Edit the system environment variables.
- Click Environment Variables.
- Under System variables, click New.
- Create a variable named:
JAVA_HOME - Set the value to your JDK installation path, such as:
C:\Program Files\Java\jdk-11 - Edit the Path variable and add:
%JAVA_HOME%\bin - Click OK to save the changes.
To verify Java installation, open Command Prompt and run:
java -version
If Java is installed correctly, Windows will display the installed Java version.
2. Download Apache Cassandra
Next, download the latest stable version of Cassandra.
- Visit the official Apache Software Foundation Cassandra download page.
- Download the Windows-compatible binary package in ZIP or TAR format.
- Extract the downloaded archive to a folder such as:
C:\Cassandra
Keeping Cassandra in a simple directory path helps avoid configuration issues later.
3. Install Python (If Required)
Some Cassandra tools and scripts may require Python to function correctly.
- Download Python from the official Python website.
- Run the installer and check Add Python to PATH during installation.
- Complete the setup process.
- Verify installation using:
python --version
This ensures supporting scripts work correctly on Windows 11.
4. Configure Cassandra Environment Variables
Setting environment variables allows Windows to recognize Cassandra commands globally.
- Open Environment Variables again.
- Under System variables, click New.
- Create a variable named:
CASSANDRA_HOME - Set the value to your Cassandra installation folder, for example:
C:\Cassandra - Edit the Path variable and add:
%CASSANDRA_HOME%\bin - Save all changes by clicking OK.
This enables Cassandra commands to run directly from Command Prompt.
5. Start Cassandra Server
After configuration, you can launch the Cassandra database server.
- Open Command Prompt as Administrator.
- Navigate to the Cassandra bin directory:
cd C:\Cassandra\bin - Run the following command:
cassandra
If everything is configured properly, Cassandra will start running in the terminal window.
Keep this terminal open while using the database.
6. Launch Cassandra Query Language Shell (CQLSH)
CQLSH is Cassandra’s command-line interface used to manage databases and queries.
- Open another Command Prompt window.
- Run:
cqlsh
If the connection is successful, you’ll enter the Cassandra shell where you can execute database commands.
For example, you can test it using:
DESCRIBE KEYSPACES;
This command displays available keyspaces in Cassandra.
7. Verify Cassandra Installation
It’s important to confirm that Cassandra is working correctly on your system.
- In the CQL shell, create a test keyspace:
CREATE KEYSPACE testdb WITH replication = {'class':'SimpleStrategy','replication_factor':1}; - Run:
DESCRIBE KEYSPACES;
If the new keyspace appears in the list, Cassandra is installed and functioning properly.
8. Configure Windows Firewall (Optional)
In some cases, Windows Firewall may block Cassandra connections.
- Open Windows Security.
- Go to Firewall & network protection.
- Select Allow an app through firewall.
- Add Java or Cassandra if blocked.
This step is mainly necessary when accessing Cassandra remotely or from other applications.
Conclusion
Installing Apache Cassandra on Windows 11 may require several setup steps, but the process becomes straightforward once Java and environment variables are configured correctly. By following the methods outlined above, you can successfully run Cassandra locally for development, testing, or educational purposes.
Although Cassandra performs best in Linux-based production environments, Windows 11 remains a convenient platform for learning and experimentation. Once installed, you can start creating keyspaces, managing distributed databases, and exploring Cassandra’s powerful NoSQL capabilities.