About spacetimedb-deploy
A deployment, operations, and production diagnostics guide for developers using SpacetimeDB, covering Maincloud, local standalone, and self-hosted environments. It also outlines considerations for logs, key rotation, reverse proxies, and PGWire.
Key features
- 01Publish to Maincloud
- 02Guide self-hosted production setup
- 03Inspect service logs
- 04Explain key rotation risks
- 05Configure WebSocket reverse proxies
- 06Protect PGWire auth tokens
Use cases
- 01Deploy a SpacetimeDB database
- 02Prepare a self-hosted production environment
- 03Diagnose logging and authentication issues
- 04Configure PGWire or a WebSocket proxy
Install
Copy the command and run it in a terminal.
$
npx skills add https:/ / github.com/ danmossa/ spacetimedb-skills --skill spacetimedb-deployAfter installing, type/spacetimedb-deployin Claude Code to confirm it loaded.
Bundled files
References and scripts installed along with SKILL.md.
references/how-to-deploy-maincloud.mdhow-to-deploy-self-hosting.mdhow-to-logging.mdhow-to-pg-wire.mdhow-to-self-hosted-key-rotation.mdDetails
From the project READMEUse this skill for deployment, operations, and production diagnostics.
Core deployment patterns
- Maincloud publish:
spacetime publish my-database --server maincloud
- Maincloud clients use
https://maincloud.spacetimedb.comas the URI and the database name or identity aswithDatabaseName/WithDatabaseName. - Updating an existing database hot-swaps the module and runs migration checks; load database migration guidance before schema-changing deploys.
- Self-hosted production should run SpacetimeDB as a dedicated user behind a reverse proxy. Keep publish/admin routes restricted unless the host is intentionally open.
- Standalone mode is suitable for local development; SSL is not supported directly in standalone.
- Logs can be viewed with
spacetime logs <database> --follow --level infoor via the HTTP logs endpoint for owners. - PGWire uses the SpacetimeDB auth token as the PostgreSQL password; treat it as a secret and avoid logging it.
Production cautions
- Key rotation can invalidate tokens or cause 401/403 behavior if identity continuity is not planned.
- Do not expose broad Nginx proxy rules for
/unless public database creation and management are intended. - For self-hosted WebSockets, the reverse proxy must support
UpgradeandConnection: Upgradeheaders for/v1/database/<db>/subscribe.
Reference map
| Need | Open |
|---|---|
| Maincloud deployment | references/how-to-deploy-maincloud.md |
| Self-hosting | references/how-to-deploy-self-hosting.md |
| Key rotation | references/how-to-self-hosted-key-rotation.md |
| Logging | references/how-to-logging.md |
| PGWire | references/how-to-pg-wire.md |
Guidance
- Be explicit about whether the target is Maincloud, local standalone, or self-hosted production.
- Avoid mixing CLI publishing instructions with server installation steps unless the user needs both.
- Treat key rotation and auth material as sensitive; prefer describing required configuration over exposing values.
Comments
Markdown supported