Install Cassandra on Windows 10/11 With WSL2

Updated

Apache Cassandra database illustration

Apache Cassandra does not run on Windows. Not “runs badly” — it ships no Windows launcher at all, and hasn’t since 4.0. The project’s own NEWS.txt, still shipped inside the 5.0.9 tarball, says it plainly:

“Due to the lack of maintenance and testing, Windows support is removed from this version onward. The developers who use Windows 10 still can run Apache Cassandra locally using WSL2 (Windows Subsystem for Linux version 2), Docker for Windows, or virtualization platform like Hyper-V and VirtualBox.”

That is not a documentation footnote. It is a change in what is in the box. I downloaded both tarballs from archive.apache.org and counted:

$ tar tzf apache-cassandra-3.11.17-bin.tar.gz | grep -icE '\.(bat|ps1)$'
24
$ tar tzf apache-cassandra-5.0.9-bin.tar.gz   | grep -icE '\.(bat|ps1)$'
0

3.11 shipped cassandra.bat, cqlsh.bat, nodetool.bat, cassandra-env.ps1 and twenty others. 5.0.9 ships none. The removals are CASSANDRA-16171 (“Remove Windows scripts”) and CASSANDRA-16956 (“Remove support for Windows”), both listed in CHANGES.txt. The word “Windows” appears zero times on the current Apache download page. The WSL and systemd steps need a Windows host and show as SKIP in install-apache-cassandra-windows.sh, which repeats the tarball counts, the NEWS.txt and CHANGES.txt quotes, the download-page search and the apt checks, and installs nothing.

The downloads.apache.org apt repository is dead

Adding https://downloads.apache.org/cassandra/debian 50x main as an apt source no longer works. That URL now 404s, so the result is nothing but an apt error:

$ curl -sL -o /dev/null -w '%{http_code}\n' https://downloads.apache.org/cassandra/debian/
404

Apache moved the package repositories. The download page carries a banner — “Debian and RedHat package repositories have moved!” — and the host is now debian.cassandra.apache.org. The 5.0 series is there, even though the page’s own prose only lists 41x and older:

$ curl -sL https://debian.cassandra.apache.org/dists/50x/Release | head -3
Origin: Apache Cassandra Packages
Label: Apache Cassandra Packages
Codename: 50x

Two other things matter. The key import writes to /etc/apt/keyrings, which needs root — sudo curl -o …, not bare curl. And the deb line must carry [signed-by=…]; without it apt has no path from the repo to the key you just downloaded, which is exactly what produces the NO_PUBKEY error. The working pair, inside WSL2:

sudo curl -o /etc/apt/keyrings/apache-cassandra.asc https://downloads.apache.org/cassandra/KEYS
echo "deb [signed-by=/etc/apt/keyrings/apache-cassandra.asc] https://debian.cassandra.apache.org 50x main" \
  | sudo tee /etc/apt/sources.list.d/cassandra.sources.list
sudo apt-get update && sudo apt-get install cassandra

You do not need a JDK, and 17 is not the only option

Apache’s own package metadata shows both:

$ curl -sL https://debian.cassandra.apache.org/dists/50x/main/binary-amd64/Packages \
    | grep -m1 -A2 '^Package: cassandra$'
Package: cassandra
Version: 5.0.9
Depends: openjdk-17-jre-headless | openjdk-11-jre-headless | java17-runtime | java11-runtime, …

A headless JRE satisfies it, and Java 11 is accepted alongside 17.

systemd is the step that actually bites in WSL

WSL used to boot without systemd, so sudo systemctl start cassandra failed outright. Microsoft’s WSL systemd documentation says it “is now the default for the current version of Ubuntu that will be installed using the wsl --install command,” but for any other distribution you need WSL 0.67.6 or newer and this in /etc/wsl.conf:

[boot]
systemd=true

Then wsl.exe --shutdown from PowerShell. I could not test this: there is no Windows machine here, and that whole paragraph is Microsoft’s documentation rather than my screen.

What a working node actually prints

What I could test is Cassandra 5.0.9 itself. I ran the same 5.0.9 release the apt package installs, on OpenJDK 17.0.20, as a single node with CQL moved to port 19042 so it would not collide with anything (JMX stays on nodetool’s default 7199):

$ 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  114.77 KiB  16      100.0%            f9358983-5ce0-4d6f-aaa5-76d406c6e5a1  rack1

$ cqlsh 127.0.0.1 19042 -e "SELECT release_version, cql_version FROM system.local;"

 release_version | cql_version
-----------------+-------------
           5.0.9 |       3.4.7

(1 rows)

UN — up, normal — is the string to look for, not systemd’s green “active (running)”. A node can be active (running) under systemd and still be DN or joining. Use nodetool status as the readiness check, and cqlsh as the proof the native transport is actually accepting connections. The first table you create on it is where Cassandra stops resembling a SQL database: the partition key decides which node stores the row, not merely how it is found.

If WSL2 is not an option — no virtualization, a locked-down corporate build, a Windows Server host — the honest alternatives are the ones Apache names itself: a Linux VM, a container, or a managed service. There is no supported path that puts the daemon on Windows directly, and any guide that shows you a cassandra.bat is describing 3.11, which reached end of life years ago.

Photo of author
Sudhir P. founded HeatWare.com in 1999 and has built and operated it full-stack ever since; it is now used by more than 88,000 people. He writes here about the PostgreSQL, MySQL, Linux and DevOps work that keeps it running. Articles are rewritten only after the commands in them have actually been run, and the verification scripts are published alongside them so anyone can check the claims. Reach him at blog@heatware.net.