
Deploy SpacetimeDB | (Just Updated) Realtime Database, Logins Survive Redeploys
SpacetimeDB realtime database. Logins and data survive redeploys
spacetimedb
Just deployed
/data
Deploy and Host SpacetimeDB on Railway
SpacetimeDB is a relational database with a built-in server runtime. Clients connect straight to the database, and your server-side logic (modules written in Rust, C# or TypeScript) runs inside it, so a real-time game, chat or collaborative app needs no separate backend.
This template runs SpacetimeDB 2.10 as a single service from a digest-pinned official image, with the HTTP and WebSocket API on your Railway domain and a Railway volume holding both the database and the server's login-signing keys.
About Hosting SpacetimeDB
- Logins survive a redeploy. The stock image keeps the key that signs identity tokens in the
container's home directory, outside any volume. After every redeploy the server generates a new
key, and every token it issued before answers
Invalid token: InvalidSignature. This template moves the keys and the database onto the volume, so identities, tokens and published modules carry across redeploys. - Reachable over HTTPS and WebSocket on the generated Railway domain, with a health check on
/v1/ping. - Pinned to a release. The image is pinned by digest, so a redeploy never changes the server version underneath your modules.
- Open by default. Any client that can reach the URL can create an identity and publish a module. Keep the domain private if the database should not be public, or put your own authentication in front of it.
Common Use Cases
- Real-time multiplayer game backends
- Chat and presence services
- Collaborative apps that share live state between clients
- Prototyping a database-plus-server app without a separate backend
Dependencies for SpacetimeDB Hosting
- One Railway volume for the database and keys (created by the template)
Deployment Dependencies
- SpacetimeDB documentation: https://spacetimedb.com/docs
- Official image: https://hub.docker.com/r/clockworklabs/spacetime
Implementation Details
Point the SpacetimeDB CLI at your deployment and publish a module:
spacetime server add --url https:// railway --default
spacetime publish --server railway my-database
The start command logs the data directory, key directory and whether the volume is writable on every boot.
Why Deploy SpacetimeDB 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 SpacetimeDB 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
spacetimedb
clockworklabs/spacetime:v2.10.2RAILWAY_RUN_UID