Self-host Apache Cassandra with Levelrail

A single node Apache Cassandra wide-column database on the official image, with a persistent volume. It is not published on the host and starts without authentication, so reach it only from other services in this project at cassandra:9042. A node needs about 2 GB of memory.

  • Authorapache
  • LicenceApache-2.0
  • Memory2 GiB
  • Services1

How to self-host Apache Cassandra

  1. Pull the images

    One image is pulled on your server.

    Show images
    • cassandra:5.0.9
  2. Create the app

    One service starts in a single Compose app, with 1 named volume mount for your data, on port 9042.

  3. Fill in the secrets

    3 settings are preset, you do not have to fill in anything.

  4. Open it

    Without a domain the app gets an sslip.io address; add --domain SERVICE=HOST to use your own.

After the first start

  • The first start takes a few minutes. Connect from a service in the same project at cassandra:9042 with the CQL native protocol.

Apache Cassandra requirements

Memory
About 2 GiB
Architectures
amd64 unknown, arm64 unknown
Ports
9042
Domain
Optional, an sslip.io address is used without one
Settings
none to fill in
License
Apache-2.0, permissive license
  • Listed. It is in the catalog but not verified. Back up the data volume before changing an image tag.

Install Levelrail first

On a server with Levelrail running, run the command above, or open the dashboard: Apps, New app, Browse templates, then Apache Cassandra. New to Levelrail? Install it on a fresh VPS first.

docker pull ghcr.io/glincker/levelrail:latest

Then levelrail-cli login --device. See Getting started and the Apache Cassandra docs page.

Deploy Apache Cassandra your way

Every format below deploys the same pinned images. Pick the one that fits how you work.

Deploy Apache Cassandra from the CLI

Add --domain SERVICE=HOST to serve a service on your own domain, for example --domain cassandra=app.example.com.

levelrail-cli templates install cassandra --name my-cassandra

Deploy Apache Cassandra with the API

Create a token in the dashboard first. Name, env and domains are the request fields.

curl -X POST -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
  https://levelrail.example.com/api/v1/service-templates/cassandra/install \
  -d '{
    "name": "my-cassandra"
  }'

Apache Cassandra configuration

Apache Cassandra services

ServiceImagePortsVolumes
cassandra cassandra:5.0.9 9042 cassandra_data -> /var/lib/cassandra

Apache Cassandra environment variables

VariableServiceValue
CASSANDRA_CLUSTER_NAME cassandra Preset by the template
HEAP_NEWSIZE cassandra Preset by the template
MAX_HEAP_SIZE cassandra Preset by the template

Ports and volumes

Ports
9042
Volumes
1 named mount: cassandra_data -> /var/lib/cassandra

Apache Cassandra FAQ

How much memory does Apache Cassandra need?

The catalog lists about 2 GiB of memory for Apache Cassandra.

Does Apache Cassandra run on arm64?

For Apache Cassandra, arm64 support is not confirmed; amd64 is unknown.

What licence is Apache Cassandra under?

Apache Cassandra is licensed under Apache-2.0, which is permissive, with few conditions on reuse.

Does Apache Cassandra need configuration before it starts?

No. The template fills in its own defaults.

Which ports does Apache Cassandra use?

Apache Cassandra listens on port 9042 inside the stack.

Where does Apache Cassandra keep its data?

In a named volume: cassandra_data mounted at /var/lib/cassandra.

Can I deploy Apache Cassandra on Dokploy or Dokku?

The services and pinned images on this page can be run on any Docker host. The public Dokploy templates list we compared does not have an entry with the same id for Apache Cassandra, so on Dokploy you would use a Docker Compose application with the file from this page. Dokku deploys container images with its own commands, so the pinned image cassandra:5.0.9 is what you deploy there.

levelrail-cli templates install cassandra --name my-cassandra