Requirements and architecture
You can run tmspec for your team on your own Docker server, behind your own reverse proxy. This part is for operators; end users do not need to read it.
What you need to prepare
| Item | Note |
|---|---|
| A Linux server running Docker and Docker Compose | One machine is enough; two releases run side by side on it during an upgrade (Upgrade) |
| A domain, and three DNS names pointing at the reverse proxy | One for the web, one for the API (the CLI uses it), one for the sign-in service. The sign-in service cannot live under a path, so it needs its own name |
| A reverse proxy with TLS | Caddy, nginx or Traefik. The release has tested examples for all three; Caddy is the path supported for automatic switching |
| A TLS certificate that browsers, the CLI and the containers all trust | Let's Encrypt through the proxy is the simple way. A company's private CA works too (Install) |
systemd, gpg | For the daily backup schedule and the encrypted off-machine copy (Backup and restore) |
| (Optional) a key from an LLM provider | Only when you turn on the AI service |
The release ships no reverse proxy; TLS and routing are done by your proxy. How much memory, CPU and disk you need depends on the number of users; there are no official figures yet, so start with a modest machine and watch it.
Components
An installation has two parts, each a group of containers:
reverse proxy (TLS, three DNS names)
↓ ↓
the running color the other color (used during an upgrade)
web · API (specd) · sign-in (auth) · worker · AI (optional)
↓
shared infrastructure: Postgres · Valkey · signing key · autoheal
- Infrastructure runs once and lives through upgrades: the Postgres database (holding specs, accounts and AI data), Valkey (counts the sign-in service's rate limits), the token signing key and
autoheal(restarts a hung container). The data sits in this part's volumes. - A release is a set of services that run together, called a color (
blueorgreen): web, API, the sign-in service, the background worker, and the AI service if turned on. During an upgrade, the new release starts in the empty color next to the running one, then the proxy switches to it; people using it are not signed out.
All services of a release share one version number (for example 0.2.0); no service has its own number.
Three DNS names
Suppose your domain is acme.example:
| Variable | Example | Serves |
|---|---|---|
TMSPEC_WEB_HOST | tmspec.acme.example | The web app, where users open |
TMSPEC_API_HOST | api.tmspec.acme.example | The API, called by the CLI and integrations |
TMSPEC_AUTH_HOST | auth.tmspec.acme.example | The sign-in page and token issuing |
The sign-in service's name is the issuer of every token. Changing it later invalidates every identity already created, so choose the final name from the start (see Backup and restore when moving machines).
What the proxy must do
- Terminate TLS for all three names, and redirect http to https.
- Keep the
Hostheader as it is and setX-Forwarded-Proto: https. - Set
X-Forwarded-Forto the client's real address and drop the value the client sent. The sign-in service counts failed sign-ins per address, and trusts this header only from the addresses inTMSPEC_TRUSTED_PROXIES. - Do not buffer responses: pages that load progressively and server-sent events must arrive on time. Keep the read timeout at a few minutes.
- Accept bodies of at least 1 MiB.
- Answer the containers too: web, API and AI call
https://<sign-in name>themselves, so the proxy must listen on an address the containers can reach and the machine's firewall must let the Docker network in.
The release has a guide with example configurations and a way to check from the server.