Railway

Deploy SurrealDB 3.x

A scalable, distributed, collaborative, document-graph database

Deploy SurrealDB 3.x

SurrealDB 3.x (Latest)

surrealdb/surrealdb:v3

Just deployed

/data

SurrealDB Logo

SurrealDB — The multi-model database for AI agents

Develop easier.   Build faster.   Scale quicker.

What is SurrealDB?

SurrealDB is an end-to-end cloud-native database designed for modern applications, including web, mobile, serverless, Jamstack, backend, and traditional applications. With SurrealDB, you can simplify your database and API infrastructure, reduce development time, and build secure, performant apps quickly and cost-effectively.

Key features of SurrealDB include:

  • Reduces development time: SurrealDB simplifies your database and API stack by removing the need for most server-side components, allowing you to build secure, performant apps faster and cheaper.
  • Real-time collaborative API backend service: SurrealDB functions as both a database and an API backend service, enabling real-time collaboration.
  • Support for multiple querying languages: SurrealDB supports SQL querying from client devices, GraphQL, ACID transactions, WebSocket connections, structured and unstructured data, graph querying, full-text indexing, and geospatial querying.
  • Granular access control: SurrealDB provides row-level permissions-based access control, giving you the ability to manage data access with precision.

Features

  • Database server, or embedded library
  • Multi-row, multi-table ACID transactions
  • Single-node, or highly-scalable distributed mode
  • Record links and directed typed graph connections
  • Store structured and unstructured data
  • Incrementally computed views for pre-computed advanced analytics
  • Realtime-api layer, and security permissions built in
  • Store and model data in any way with tables, documents, and graph
  • Simple schema definition for frontend and backend development
  • Connect and query directly from web-browsers and client devices
  • Use embedded JavaScript functions for custom advanced functionality

Documentation

For guidance on development, and administration, see Their documentation.


Deploy and Host

About Hosting

SurrealDB 3.x can be hosted in several ways depending on your application's scale and infrastructure requirements. As the multi-model database for AI agents, it is designed to run anywhere — from embedded edge devices and browsers through to fully managed cloud deployments. It supports single-node operation for development and small workloads, and scales to distributed cluster mode for high-availability production environments.

SurrealDB 3.x supports TiKV as a distributed storage backend for clustered deployments, and RocksDB or in-memory storage for single-node use. It exposes a stateless HTTP and WebSocket API, making it straightforward to place behind a reverse proxy (Nginx, Caddy) or load balancer, and it integrates natively with SurrealDB Cloud for fully managed, serverless hosting.

Why Deploy

Deploying SurrealDB to a hosted environment moves your database out of local development and into a reliable, accessible, and scalable runtime. Hosting enables your application to serve real users, maintain persistent data across sessions, and take full advantage of SurrealDB's real-time collaboration, live queries, and multi-client connectivity — none of which are meaningful without a running, reachable server.

Deployment also unlocks proper access controls, TLS encryption, backup strategies, monitoring, and compliance features that are critical for any production or agentic AI workload.

Common Use Cases

  • AI agents and generative AI apps — Provide unified context, memory, vector search, and relational data in a single layer for multi-step agentic workflows.
  • Knowledge graphs — Model complex entity relationships and dependencies to power intelligent recommendations, contextual reasoning, and graph traversal at scale.
  • Real-time applications — Power live dashboards, collaborative tools, multiplayer experiences, and event-driven systems using SurrealDB's built-in live query and change-feed support.
  • Embedded and edge deployments — Run data, logic, and AI directly on edge devices or in browsers via WebAssembly for low-latency, offline-ready workloads.
  • Multi-tenant SaaS platforms — Row-level permissions and namespace/database isolation make SurrealDB well-suited for SaaS products serving multiple independent customers.
  • Jamstack and serverless architectures — Connect directly from edge functions or static frontends using SurrealDB's HTTP or WebSocket API without a dedicated middleware layer.

Dependencies for

Deployment Dependencies

The following dependencies are required to deploy and run SurrealDB 3.x in a production or staging environment:

DependencyPurposeNotes
SurrealDB 3.x binaryCore database serverAvailable via surreal CLI, Docker image (surrealdb/surrealdb:3), or compiled from source
TiKV (distributed mode only)Distributed storage backendRequired for multi-node clustered deployments; not needed for single-node
RocksDB (single-node persistent)Embedded persistent storageBundled with the SurrealDB binary; no separate install needed
Docker / Podman (containerised deployments)Container runtimeOptional but recommended for reproducible, isolated deployments
Nginx / Caddy (recommended)Reverse proxy and TLS terminationHandles HTTPS, load balancing, and WebSocket proxying in front of SurrealDB
TLS certificateEncrypted client connectionsCan be managed via Let's Encrypt/Certbot or your cloud provider's certificate manager
systemd or equivalent (bare metal / VM)Process supervision and auto-restartEnsures SurrealDB restarts on failure; alternatives include Supervisor or Docker's restart policies

Minimum runtime environment:

  • Linux (x86_64 or ARM64), macOS, or Windows Server
  • 512 MB RAM minimum; 2 GB+ recommended for production workloads
  • Network port 8000 open (default SurrealDB port; configurable via --bind)

Template Content

SurrealDB 3.x (Latest)

surrealdb/surrealdb:v3

More templates in this category

View Template
Foundry Virtual Tabletop
A Self-Hosted & Modern Roleplaying Platform

Lucas
View Template
(v1) Simple Medusa Backend
Deploy an ecommerce backend and admin using Medusa

Shahed Nasser
View Template
peppermint
Docker-compose port for peppermint.sh

HamiltonAI