
Deploy SurrealDB 3 | (Just Updated) Multi-Model Database, Login and Quiet Logs Set
SurrealDB 3. Root login set at deploy, data on a volume, quiet logs
surrealdb
Just deployed
/data
Deploy and Host SurrealDB on Railway
SurrealDB is an open-source multi-model database. One engine serves documents, graphs, relational tables, full-text search and vector search through SurrealQL, over HTTP and WebSocket, with built-in users, scopes and record-level permissions.
This template runs SurrealDB 3.3 from the official image, pinned by digest, as a single service with a public Railway domain and a volume for its data.
About Hosting SurrealDB
- A root login is set from the first request. A password is generated per deploy
(
SURREAL_PASS, userroot). An anonymous query returned403 Anonymous access not allowed; the same query with the generated credentials ran. - Data survives redeploys. SurrealDB's storage engine writes to a volume mounted at
/data. A record created before a redeploy was still there afterwards. - Logs stay readable. The log level is
info. An idle deploy printed about 45 lines in its first minutes and no trace or debug lines, so the Railway log view shows your queries and errors instead of storage-engine noise. - Outbound network calls from queries are off. SurrealDB's defaults are kept, so
http::get()from a query is refused (Access to network target ... is not allowed) and the database cannot be used to reach other services on your private network. - A healthcheck is set on
/health, so a deploy that does not start is reported as failed.
Common Use Cases
- Backend for web and mobile apps that want one database for documents, graphs and tables
- Knowledge graphs and agent memory next to vector search
- Realtime apps using live queries over WebSocket
- Prototypes that start on one node and keep their data on a volume
Dependencies for SurrealDB Hosting
- One volume for the database files (created by the template)
Deployment Dependencies
- SurrealDB documentation: https://surrealdb.com/docs
- Official image: https://hub.docker.com/r/surrealdb/surrealdb
Implementation Details
| Variable | Purpose |
|---|---|
SURREAL_PASS | Password for the root user, generated per deploy. |
SURREAL_HTTP_URL | Public HTTPS address, for /sql, /key and /health. |
SURREAL_WS_URL | Public WebSocket address of the RPC endpoint. |
SURREAL_PRIVATE_URL | Address for other services in the same project. |
Connect with user root and SURREAL_PASS, for example
surreal sql --endpoint "$SURREAL_HTTP_URL" --user root --pass "$SURREAL_PASS". Create a
namespace and database, then add your own users instead of using root from an application.
Why Deploy SurrealDB 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 SurrealDB 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.
Template Content
surrealdb
surrealdb/surrealdb:v3.3.0RAILWAY_RUN_UID