---
title: "Deploy Apache Cassandra | (Just Updated) Wide-Column Database, Password On From Boot"
description: "Wide-column NoSQL database. Password on from boot, data on a volume."
category: "Storage"
url: https://railway.com/deploy/apache-cassandra-or-just-updated-wide-co
---

# Deploy Apache Cassandra | (Just Updated) Wide-Column Database, Password On From Boot

Wide-column NoSQL database. Password on from boot, data on a volume.

**[Deploy Apache Cassandra | (Just Updated) Wide-Column Database, Password On From Boot on Railway](https://railway.com/template/apache-cassandra-or-just-updated-wide-co)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/apache-cassandra-or-just-updated-wide-co/manifest.json

- **Creator:** SuperSlowSloth
- **Category:** Storage

## Template content

### cassandra

- **Image:** cassandra:5.0@sha256:8870ec4d9608abe9160a7d09b51a0f0c13c6a95ea0610266ea58eb7d30a144de
- **Start command:** `/bin/sh -c 'set -e; export MAX_HEAP_SIZE=1G HEAP_NEWSIZE=256M JVM_EXTRA_OPTS=-XX:ActiveProcessorCount=2; Y=/etc/cassandra/cassandra.yaml; sed -i -E "s/^authenticator:.*/authenticator: PasswordAuthenticator/; s/^authorizer:.*/authorizer: CassandraAuthorizer/" $Y; echo "[railway] cassandra uid=$(id -u) data_owner=$(stat -c %u:%g /var/lib/cassandra) pids.max=$(cat /sys/fs/cgroup/pids.max 2>/dev/null)"; SQ=$(printf "\047"); ( for i in $(seq 1 180); do if cqlsh -u cassandra -p "$CASSANDRA_PASSWORD" -e "SELECT now() FROM system.local" >/dev/null 2>&1; then echo "[railway] password active"; break; fi; if cqlsh -u cassandra -p cassandra -e "ALTER ROLE cassandra WITH PASSWORD = ${SQ}${CASSANDRA_PASSWORD}${SQ}" >/dev/null 2>&1; then echo "[railway] default password replaced"; break; fi; sleep 5; done ) & exec docker-entrypoint.sh cassandra -f'`

## Documentation

# Deploy and Host Apache Cassandra on Railway

Apache Cassandra is a distributed wide-column NoSQL database built for high write throughput and linear scale. It is queried with CQL. This template runs a single Cassandra 5.0 node with a persistent volume, password authentication switched on from the first boot, and a public TCP endpoint for CQL clients.

## About Hosting Apache Cassandra

This template runs the official `cassandra` image (pinned by digest). Data lives on a volume mounted at `/var/lib/cassandra`, so keyspaces survive redeploys. `PasswordAuthenticator` and `CassandraAuthorizer` are enabled at boot, and the default `cassandra/cassandra` login is replaced with the generated `CASSANDRA_PASSWORD` within seconds of the node accepting connections. The JVM is capped to the container (1 GB heap, `ActiveProcessorCount=2`) so it does not size itself from the host's cores. Allow roughly a minute on first boot before CQL answers.

Agent contract:

- CQL host (public): `CASSANDRA_PUBLIC_HOST`, port `CASSANDRA_PUBLIC_PORT` (TCP proxy to 9042)
- CQL host (private network): `CASSANDRA_PRIVATE_HOST`, port `9042`
- Username: `cassandra`
- Password variable: `CASSANDRA_PASSWORD`
- No HTTP health path; check readiness by a CQL login

```bash
docker run --rm --entrypoint cqlsh cassandra:5.0 $CASSANDRA_PUBLIC_HOST $CASSANDRA_PUBLIC_PORT \
  -u cassandra -p "$CASSANDRA_PASSWORD" \
  -e "CREATE KEYSPACE IF NOT EXISTS app WITH replication = {'class':'SimpleStrategy','replication_factor':1}; DESCRIBE KEYSPACES;"
```

## Why Deploy Apache Cassandra on Railway?

Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.

By deploying Apache Cassandra on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.

- **Secure by default** — unauthenticated CQL is rejected and the default password does not work.
- **Data survives redeploys** — the volume is preconfigured and verified with a write, redeploy, read.
- **Zero configuration** — no variables to fill in; the contract above is everything a client needs.
- **Standard drivers work** — any CQL driver connects over the TCP endpoint.

## Common Use Cases

- **Time-series and event logging** — append-heavy workloads keyed by device, user or day.
- **Agent and session state** — wide rows for conversation history and activity feeds.
- **Development and test clusters** — a real Cassandra to run drivers and schemas against.

## Dependencies for Apache Cassandra Hosting

- A volume mounted at `/var/lib/cassandra` (included in this template).

### Deployment Dependencies

- [apache/cassandra](https://github.com/apache/cassandra) — upstream server
- [cassandra on Docker Hub](https://hub.docker.com/_/cassandra) — the pinned image this template deploys


## Similar templates

- [RustFS | (Just Updated) S3 Object Store, Public URL and Keys Set](https://railway.com/deploy/rustfs-or-just-updated-s3-object-store-p) — S3-compatible object store, keys and public URL preset, volume kept
- [TimescaleDB](https://railway.com/deploy/timescaledb-railway-template) — A PostgreSQL-based time-series database for analytics on Railway.
- [Garage S3 Storage](https://railway.com/deploy/garage-s3-storage) — Ultra-light S3 server: fast, open-source, plug-and-play.

Open this page in a browser: https://railway.com/deploy/apache-cassandra-or-just-updated-wide-co
