selfhost.directory

The index of self-hostable projects — ranked, categorized and served with live updates.
Own your data and stop giving it to big tech.

SpacetimeDB logo

Self-host SpacetimeDB

v2.15.0

Relational database you deploy your app logic into

ReleaseSource AvailableOther
docker run --rm --pull always -p 3000:3000 clockworklabs/spacetime start
Updated2 hours ago
LanguageRust
Setup difficultyModerate
Stars
25 539
Port
3000 (Standalone server: HTTP endpoints and the real-time subscribe websocket)
Docker
clockworklabs/spacetime

What is SpacetimeDB?

SpacetimeDB alternatives

All self-hosted alternatives to Firebase → All self-hosted alternatives to Convex → All self-hosted alternatives to Photon →

Should you self-host SpacetimeDB?

SpacetimeDB scores 75/100 on selfhost.directory (how scoring works) and ranks #7 of 38 in Databases. It has 25 539 GitHub stars, +217 in the last 30 days.

It shipped 10 stable releases in the past year. The latest, v2.15.0, came out on 6 November 2026. New versions land roughly every 7 days.

Setup is moderate: expect some configuration beyond a single command. An official Docker image is available. It is Other-licensed and written mostly in Rust.

Its closest alternative on selfhost.directory is supabase (90/100, 114 754 stars). It scores higher overall, so compare the two before you pick. See SpacetimeDB vs supabase side by side.

Features

  • ACID Transactions
  • Automatic schema migrations
  • Confirmed reads
  • Embedded application logic
  • Generated type-safe client bindings
  • In-memory engine with commit-log recovery
  • Module logging
  • Multi-language server modules
  • PostgreSQL wire protocolOff by default; enabled with the --pg-port startup option.
  • Procedures with outbound HTTP
  • Real-time data sync
  • SQL queries over HTTP
  • Subscribable views
  • Watch-mode development workflow

SpacetimeDB README

How to install SpacetimeDB

Install SpacetimeDB with Docker

docker run --rm --pull always -p 3000:3000 clockworklabs/spacetime start

Runs a standalone instance; port 3000 mapped in the documented command.

How to configure SpacetimeDB

  • --listen-addrAddress the standalone server binds to

    values: e.g. '127.0.0.1:3000'

  • --pg-portStarts the PostgreSQL-wire-protocol listener; without it such connections are not enabled

    values: e.g. 5432

  • --root-dirDirectory holding this SpacetimeDB installation; must be passed whenever the CLI is invoked for it
  • SPACETIMEDB_DB_NAMEEnvironment variable used as the database name when no database argument is given
  • listen_addrPersistent default listen address set in cli.toml; used unless --listen-addr is passed explicitly

    values: e.g. "0.0.0.0:4000"

SpacetimeDB releases & version history

@ Every self-hosted release, weekly

One Monday email with the week's stable releases across the directory.

FAQ

How does real-time sync work?

Clients declare subscriptions with the typed query builder (raw SQL subscriptions also exist), and the engine pushes incremental changes into a local client cache you query without round trips.

How does data persistence work?

Everything is written to a commit log comparable to a write-ahead log, and on restart that log is replayed so the database returns to its exact prior state.

What are procedures?

Procedures extend reducers with manual transaction control and outbound HTTP calls to other services, and clients may invoke them over HTTP.

What are views?

Views are read-only functions computing derived data from tables; clients can subscribe to them and they refresh automatically as underlying rows change.

What are reducers?

Reducers change database state inside a transaction, so either every change commits or none does; think of them as transactional RPC endpoints.

What are tables?

Tables are the primary storage, defined through your language's types, with support for primary keys, unique constraints and indexes, and clients can subscribe to them.

What is a "module"?

A module is your server-side code compiled to WebAssembly (or bundled JavaScript for TypeScript), defining tables, reducers, views and procedures, and uploaded with the publish command.

How is SpacetimeDB different from a regular database (PostgreSQL, MySQL)?

It keeps data in memory, runs your logic inside the engine as WebAssembly and pushes updates to clients, and is aimed at real-time work rather than batch processing or analytics.

How is SpacetimeDB different from Firebase / Supabase?

Those platforms keep your logic elsewhere (cloud or edge functions) on top of a database, while here the full application is a module in a real language running inside the database.

How is SpacetimeDB different from Mirror / Netcode / Photon / other networking libraries?

Networking libraries only move messages and leave you to write the server, state and persistence; here the product takes over the whole server side.

Can I self-host SpacetimeDB?

Yes, run it on your own infrastructure with the start command or with the published Docker image, or use the hosted Maincloud platform instead.

Is SpacetimeDB open source?

Not in the OSI sense: it is source-available under BSL 1.1 and later converts to AGPL v3 with a linking exception, so your own app code need not be released.

Is SpacetimeDB only for games?

No, it is meant for any low-latency real-time application, including chat, collaboration tools, dashboards and IoT; games are simply the most demanding showcase.

How is SpacetimeDB different from a traditional backend?

You skip the web server, endpoint layer, connection pooling and caching plumbing: your published module is the backend, and clients call reducers and subscribe to live data.

What is SpacetimeDB?

It is a relational database you also deploy your server code into, so clients talk straight to the database rather than to an API tier you build and operate.

More in Databases

Rate this project

Click to rate — no account needed.

0 comments

Posting as guest
Loading comments…