Back to Templates
SpacetimeDB logo

SpacetimeDB

vv2.6.1

SpacetimeDB is a relational database with a built-in server runtime. Clients connect directly to the database and run server-side logic (modules) inside it, making it ideal for real-time multiplayer games, chat and collaborative applications without a separate backend.

Deploy on Dokploy

Deploy SpacetimeDB on Dokploy

  1. Install Dokploy on your server if you haven't already.
  2. In your Dokploy panel, open a project and click Create Service → Template.
  3. Search for SpacetimeDB and click Create — Dokploy configures domains, environment variables, and volumes for you.

Alternatively, create a Compose service, go to Advanced → Import from Base64, and paste this payload:

base64
ewogICJjb21wb3NlIjogInZlcnNpb246IFwiMy44XCJcbnNlcnZpY2VzOlxuICBzcGFjZXRpbWVkYjpcbiAgICBpbWFnZTogY2xvY2t3b3JrbGFicy9zcGFjZXRpbWU6djIuNi4xXG4gICAgcmVzdGFydDogdW5sZXNzLXN0b3BwZWRcbiAgICBjb21tYW5kOiBzdGFydFxuICAgIHBvcnRzOlxuICAgICAgLSAzMDAwXG4gICAgdm9sdW1lczpcbiAgICAgIC0gc3BhY2V0aW1lZGItZGF0YTovaG9tZS9zcGFjZXRpbWVcblxudm9sdW1lczpcbiAgc3BhY2V0aW1lZGItZGF0YToge30iLAogICJjb25maWciOiAiW3ZhcmlhYmxlc11cbm1haW5fZG9tYWluID0gXCIke2RvbWFpbn1cIlxuXG5bY29uZmlnXVxuW1tjb25maWcuZG9tYWluc11dXG5zZXJ2aWNlTmFtZSA9IFwic3BhY2V0aW1lZGJcIlxucG9ydCA9IDMwMDBcbmhvc3QgPSBcIiR7bWFpbl9kb21haW59XCIiCn0=

Configuration

The exact Docker Compose and template configuration this template deploys.

Instructions

SpacetimeDB

SpacetimeDB is a database and server runtime in one: your clients connect directly to the database and your application logic runs inside it as WebAssembly modules. There is no web UI — the domain assigned to this service exposes the SpacetimeDB HTTP/WebSocket API (so opening / in a browser returns a plain 404; that is expected).

Verify the server is running

bash

A 200 OK response means the server is up.

Connect with the SpacetimeDB CLI

  1. Install the CLI on your local machine:

    bash
  2. Register your Dokploy instance as a server and make it the default:

    bash
  3. Log in (or create an anonymous local identity) and publish a module:

    bash
  4. Check connectivity at any time:

    bash

From your game or app, connect with any SpacetimeDB client SDK (Rust, C#, TypeScript) using https://your-domain.com as the host URI. See the getting started guide for a full walkthrough.

Notes

  • All server state (databases, logs and the JWT signing keys used for identities) is persisted in the spacetimedb-data volume, so identities survive restarts and upgrades.
  • Client connections use WebSockets over the same domain; no extra configuration is needed.

Related Templates

Convex logo

Convex

Version: latest

Convex is an open-source reactive database designed to make life easy for web app developers.

backenddatabaseapi
PocketBase logo

PocketBase

Version: latest

Open Source backend in 1 file

backenddatabaseapi
PowerSync logo

PowerSync

Version: 1.21.0

PowerSync is a sync engine for local-first apps. Syncs PostgreSQL data to mobile devices and browsers with real-time replication.

syncdatabaselocal-first
TrailBase logo

TrailBase

Version: latest

TrailBase is a blazingly fast, open-source application server with type-safe APIs, built-in WebAssembly runtime, realtime, auth, and admin UI built on Rust, SQLite & Wasmtime.

backenddatabaseapi
Appwrite logo

Appwrite

Version: 1.9.5

Appwrite is an end-to-end platform for building Web, Mobile, Native, or Backend apps, packaged as a set of Docker microservices. It includes both a backend server and a fully integrated hosting solution for deploying static and server-side rendered frontends. Appwrite abstracts the complexity and repetitiveness required to build modern apps from scratch and allows you to build secure, full-stack applications faster. Using Appwrite, you can easily integrate your app with user authentication and multiple sign-in methods, a database for storing and querying users and team data, storage and file management, image manipulation, Cloud Functions, messaging, and more services.

databasefirebasemariadb
ArangoDB logo

ArangoDB

Version: latest

ArangoDB is a native multi-model database with flexible data models for documents, graphs, and key-values. Build high performance applications using a convenient SQL-like query language or JavaScript extensions.

databasegraph-databasenosql

Self-host SpacetimeDB in minutes

Dokploy is a free, open source deployment platform. Deploy SpacetimeDB and 499+ other templates on your own infrastructure with a single click.