Install Cassandra on Windows
Complete step-by-step guide for development and testing on Windows!
⚠️ Important: Windows Installation Notice
❌ Not Recommended for Production
Windows is NOT recommended for Cassandra in production!
- 💥 Poor performance: 30-50% slower than Linux
- 💥 Limited community support: Most users run Linux
- 💥 Fewer tools: Monitoring and management tools built for Linux
- 💥 File system issues: Windows file locks cause problems
- 💥 Memory management: JVM works better on Linux
✅ When Windows Installation is OK
- ✅ Learning Cassandra: Testing queries and concepts
- ✅ Local development: Building applications
- ✅ Proof of concept: Quick demos
- ✅ CQL practice: Writing and testing queries
💡 Better Alternatives
For Windows users, consider:
- 🐳 Docker: Run Cassandra in Linux container (recommended!)
- 🖥️ WSL2: Windows Subsystem for Linux
- ☁️ Cloud VM: Free tier on AWS/Azure/GCP
- 📦 VirtualBox: Linux VM on Windows
⚠️ If you still want to proceed with Windows installation, continue below...
📋 Prerequisites
What you need before starting the installation.
Required Software
- Windows Version: Windows 10 or Windows Server 2016+ (64-bit)
- Administrator Access: Required for installation
- Java 11 or 17: OpenJDK or Oracle JDK
- Python 2.7+ or 3.x: For cqlsh (CQL shell)
- Disk Space: At least 5GB free for Cassandra
- RAM: Minimum 4GB (8GB+ recommended)
Before You Start
- ⚠️ Disable antivirus temporarily: May block Cassandra processes
- ⚠️ Close other applications: Free up memory
- ⚠️ Check firewall settings: May need to allow ports 7000, 9042
- ⚠️ Have patience: First startup can take 1-2 minutes
☕ Step 1: Install Java
Cassandra requires Java 11 or Java 17. We'll use OpenJDK 11 (free and open source).
Download OpenJDK 11
Visit the Adoptium (formerly AdoptOpenJDK) website:
- Select Windows x64
- Choose JDK 11 (LTS)
- Download the .msi installer
Run the Installer
- Double-click the downloaded
.msifile - Click Next through the wizard
- ✅ IMPORTANT: Check "Set JAVA_HOME variable"
- ✅ IMPORTANT: Check "Add to PATH"
- Click Install
Verify Java Installation
Open Command Prompt (cmd) and run:
Troubleshooting Java
If "java" is not recognized:
- Open System Properties → Environment Variables
- Under System Variables, click New
- Variable name:
JAVA_HOME - Variable value:
C:\Program Files\Eclipse Adoptium\jdk-11.0.x-hotspot - Find Path variable → Click Edit
- Add new entry:
%JAVA_HOME%\bin - Click OK and restart Command Prompt
🐍 Step 2: Install Python (for cqlsh)
Cassandra's CQL shell (cqlsh) requires Python. Let's install Python 3.
Download Python
Visit Python's official website:
- Download Python 3.11.x (latest stable)
- Choose Windows installer (64-bit)
Install Python
- Run the installer
- ✅ IMPORTANT: Check "Add python.exe to PATH"
- Click Install Now
- Wait for installation to complete
Verify Python Installation
⬇️ Step 3: Download Cassandra
Download the latest stable version of Apache Cassandra.
Download from Apache
Visit Apache Cassandra downloads:
- Download apache-cassandra-4.1.x-bin.tar.gz
- Note: This is a
.tar.gzfile (Unix format) - You'll need 7-Zip or WinRAR to extract it
Extract Cassandra
- Install 7-Zip if you don't have it
- Right-click the downloaded file → 7-Zip → Extract Here
- You may need to extract twice (first
.tar.gz, then.tar) - Move extracted folder to:
C:\cassandra\
Path Recommendation
Use simple paths without spaces:
- ✅ Good:
C:\cassandra\ - ✅ Good:
C:\apache-cassandra\ - ❌ Bad:
C:\Program Files\Cassandra\(has spaces!) - ❌ Bad:
C:\My Documents\Cassandra\(has spaces!)
Spaces in paths can cause issues with scripts!
⚙️ Step 4: Configure Cassandra
Modify configuration files for Windows environment.
Set Environment Variables
Open Command Prompt as Administrator and run:
Edit cassandra.yaml
Open C:\cassandra\apache-cassandra-4.1.x\conf\cassandra.yaml in Notepad++
Find and modify these settings:
Create Data Directories
Configure JVM Heap (Optional but Recommended)
Edit conf\jvm-server.options (or jvm11-server.options for Java 11):
🚀 Step 5: Start Cassandra
Start Cassandra server for the first time!
Start Cassandra Server
Open Command Prompt as Administrator and navigate to Cassandra:
What you'll see:
- Lots of log messages (this is normal!)
- Warnings about performance (expected on Windows)
- Eventually: "Starting listening for CQL clients..."
First Startup is SLOW
Be patient! First startup can take 1-2 minutes:
- ⏱️ Cassandra creates system tables
- ⏱️ JVM warms up
- ⏱️ Schema initialization
- ⏱️ Network ports binding
Don't close the window! Keep it running. Cassandra logs appear here.
Check if Cassandra is Running
Look for these messages in the output:
✅ If you see "Starting listening for CQL clients" → Success!
✅ Step 6: Verify Installation
Test that Cassandra is working correctly!
Connect with nodetool
Open a NEW Command Prompt (keep the first one running Cassandra) and run:
Connect with cqlsh
In the same Command Prompt, start the CQL shell:
Run Test Queries
Try some basic CQL commands:
Installation Successful!
If all commands worked, congratulations! 🎉
You now have Cassandra running on Windows!
- ✅ Cassandra server running on port 9042
- ✅ cqlsh working
- ✅ Can create keyspaces and tables
- ✅ Ready to learn CQL!
🔧 Common Issues & Solutions
Fix common Windows installation problems!
❌ "java is not recognized"
Problem: Java not in PATH
Solution:
- Verify Java installed: Check
C:\Program Files\Eclipse Adoptium\ - Add to PATH manually (see Step 1.3 troubleshooting)
- Restart Command Prompt
- Try
java -versionagain
❌ "Cannot find conf\cassandra.yaml"
Problem: Wrong directory or path with spaces
Solution:
- Make sure you're in
C:\cassandra\apache-cassandra-4.1.x\ - Run:
dir conf\cassandra.yamlto verify file exists - Move Cassandra to path without spaces if needed
❌ "Address already in use (port 7000 or 9042)"
Problem: Another Cassandra instance running
Solution:
❌ "python is not recognized"
Problem: Python not installed or not in PATH
Solution:
- Reinstall Python (check "Add to PATH")
- Or manually add:
C:\Users\YourName\AppData\Local\Programs\Python\Python311\to PATH - Restart Command Prompt
❌ Cassandra starts then crashes immediately
Possible causes:
- Not enough RAM: Need at least 4GB, close other apps
- Antivirus blocking: Disable temporarily
- Disk space: Need at least 5GB free
- Wrong Java version: Must be Java 11 or 17
Check logs:
❌ "cqlsh: command not found"
Problem: Wrong syntax or path
Solution:
Still Having Problems?
Try these steps:
- Check logs:
C:\cassandra\logs\system.log - Restart computer: Clean slate
- Reinstall Java: Make sure Java 11 is installed correctly
- Try Docker instead: Much easier on Windows! → Docker Guide
- Ask for help: Apache Cassandra mailing list or Stack Overflow
🎉 What's Next?
Congratulations! You've successfully installed Cassandra on Windows!
🚀 Continue Your Learning:
- 📖 Learn CQL: Start with CQL Introduction
- 🔑 Create keyspaces: Keyspaces Guide
- 📊 Design tables: Data Modeling
- ⚡ Query data: SELECT Guide
💡 Important Reminders:
- ⚠️ Development only: Don't use Windows for production!
- 🐳 Consider Docker: Easier and more reliable for learning
- 🐧 Production = Linux: Plan to use Linux for real deployments
- 💾 Backup your data:
C:\cassandra\data\directory
🎓 Ready to learn CQL and build applications!
Responsive Ad