Deploy RavenDB | (Just Updated) NoSQL Document Database, REST API, Basic Auth On, Data Survives Redeploys

RavenDB NoSQL document database with REST API and Studio, basic auth on

Deploy RavenDB | (Just Updated) NoSQL Document Database, REST API, Basic Auth On, Data Survives Redeploys

Just deployed

Just deployed

/var/lib/ravendb

Deploy and Host RavenDB on Railway

Built for an LLM agent to deploy and use. There is no setup wizard and nothing to fill in: a 32-character password is generated at deploy time, a database named main already exists, and every call to the public URL must present the password. A stock RavenDB image opens a browser setup wizard and waits for a human, and its unsecured mode answers anyone; this template does neither. The contract below lists every URL, variable name and the one script that proves it works.

RavenDB is an open-source NoSQL document database with ACID transactions, a SQL-like query language (RQL), full-text search, indexes, time series and a REST API. This template runs the free Community edition of a single node, behind an authenticating gateway.

About Hosting RavenDB

This template runs two services. ravendb is the official RavenDB 7.2.7 image (ravendb/ravendb, pinned by digest) with its data on a volume at /var/lib/ravendb. It has no public domain on purpose: RavenDB's own security is TLS plus a client certificate on every request, and Railway's edge ends TLS and cannot forward client certificates, so the server runs unsecured on the project's private network only. gateway is Caddy and is the only public door: it requires HTTP basic auth (user admin, password RAVEN_PASSWORD) for everything except a version-only health check, then proxies to the server, including Studio and its websockets. The boot script accepts the Community licence terms (deploying this template means you accept them), skips the setup wizard, and creates the database main on first boot. Data survives redeploys. The server advertises its private domain as its own URL, which is what lets a single node create databases while bound to both IPv4 and IPv6.

Agent contract

  • Public URL: https:// plus the RAILWAY_PUBLIC_DOMAIN of the gateway service, as RAVENDB_PUBLIC_URL. It serves the REST API under /databases/ and /admin/, and Studio at /studio/index.html.
  • Private URL: http://ravendb.railway.internal:8080 (HTTP, no authentication, for services in the same project only). The cluster TCP port is 38888.
  • Credentials: user admin, password in RAVEN_PASSWORD (on the gateway service).
  • Auth: HTTP basic auth on every public request (curl -u admin:PASSWORD). Without it the gateway answers 401. Only /railway_health is open.
  • Health: GET /railway_health returns 200 with the server version, and fails when the database server is down.
# run with RAVENDB_PUBLIC_URL and RAVEN_PASSWORD set; needs curl
U="admin:$RAVEN_PASSWORD"
curl -s -o /dev/null -w 'health %{http_code}\n' "$RAVENDB_PUBLIC_URL/railway_health"
curl -s -o /dev/null -w 'anonymous %{http_code}\n' "$RAVENDB_PUBLIC_URL/databases/main/stats"
curl -fsS -u "$U" -X PUT "$RAVENDB_PUBLIC_URL/databases/main/docs?id=users/1" -H 'Content-Type: application/json' -d '{"Name":"Ada"}'; echo
curl -fsS -u "$U" "$RAVENDB_PUBLIC_URL/databases/main/docs?id=users/1" | grep -o '"Name":"Ada"'
curl -fsS -u "$U" -X POST "$RAVENDB_PUBLIC_URL/databases/main/queries" -H 'Content-Type: application/json' -d '{"Query":"from @all_docs where Name = $n","QueryParameters":{"n":"Ada"}}' | grep -o '"TotalResults":[0-9]*'

A fresh deploy prints health 200, anonymous 401, the stored document id, "Name":"Ada" and "TotalResults":1. Official RavenDB client libraries (.NET, Java, Python, Node.js, Go) connect to an unsecured URL, so use them from services in the same project with http://ravendb.railway.internal:8080 and database main; from outside Railway use the REST API through the public URL with basic auth.

Why Deploy RavenDB 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 RavenDB 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.

  • Agent-ready - generated password, contract block and one working script; no wizard, no certificate setup.
  • Closed by default - the server is private-network only and the public door requires a password.
  • A database is already there - main exists on first boot.
  • State survives redeploys - documents, indexes and cluster state live on a volume.
  • Pinned image - the RavenDB version is pinned, so a redeploy never changes the server underneath you.

Common Use Cases

  • Application database for AI agents - store JSON documents with transactions and query them with RQL.
  • Full-text and vector-style search backends - indexes and search over document fields.
  • Replacing a hand-run MongoDB or CouchDB - ACID document storage with a REST API and a web Studio.

Dependencies for RavenDB Hosting

  • None. RavenDB stores its own data on the volume at /var/lib/ravendb.

Deployment Dependencies


Template Content

More templates in this category

View Template
RustFS | (Just Updated) S3 Object Store, Public URL and Keys Set
S3-compatible object store, keys and public URL preset, volume kept

SuperSlowSloth
0
View Template
TimescaleDB
A PostgreSQL-based time-series database for analytics on Railway.

Rakit
1
View Template
Garage S3 Storage
Ultra-light S3 server: fast, open-source, plug-and-play.

PROJETOS
8