Deploy SpacetimeDB
Railway

Deploy SpacetimeDB

A template to deploy SpacetimeDB standalone

Deploy SpacetimeDB

clockworklabs/spacetime

clockworklabs/spacetime

Just deployed

/stdb

Deploy and Host SpacetimeDB on Railway

SpacetimeDB is a realtime ultra-fast backend framework and database for apps and games. Server logic can be written in TypeScript, C#, C++, or Rust with automatic client synchronization. Table schema and application logic is defined in the same project and uploaded to SpacetimeDB as a single Wasm binary or JavaScript bundle.

About Hosting SpacetimeDB

Hosting SpacetimeDB requires running the first-party docker image clockworklabs/spacetime and exposing port 3000. Additionally to ensure persistence a volume is required on the path /stdb.

At this point SpacetimeDB is ready to run multiple databases that can be published using the spacetime publish cli command.

Common Use Cases

Typical use cases for SpacetimeDB as a backend framework are:

  • Running the backend to handle state synchronization for a realtime web application like figma.
  • Handling state persistence and synchronization for a realtime multiplayer game. For example the MMORPG BitCraft Online runs entirely on SpacetimeDB.
  • Synchronizing state between running agents that publish updates and subscribe to a shared state.

Implementation Details

A SpacetimeDB project can be initialized by installing the spacetime cli and running spacetime init.

To publish a new database to a particular deployment on Railway you need to first add to the list of servers by running spacetime server add --url railway.

You can then run spacetime publish -s railway to deploy your database to your railway app.

Dependencies for SpacetimeDB Hosting

SpacetimeDB has no hosting dependencies.

Deployment Dependencies

SpacetimeDB has no deployment dependencies.

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

clockworklabs/spacetime

clockworklabs/spacetime

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