Skip to content
Token Controller Docs
Docs / Self-hosting / Run it yourself

Run it yourself

Self-hosted Token Controller is the same product as the hosted Team plan, from the same open code, with every Team plan feature. The hosted service adds only our billing, support and feedback.

What you run

Part What it is
The service One program, written in Rust, in one Docker image. It serves the HTTP API and the web app, receives telemetry over OpenTelemetry (HTTP, as protobuf or JSON), and runs the background jobs, such as bill pulls, the Jira sync, exchange rates and removing received records after 400 days. Sign-in runs inside it too: magic link by email, and OIDC on the Enterprise plan.
Postgres All data lives in one Postgres database. See Postgres.
Email Any SMTP server, for sign-in links, invites and the request to submit.

Getting started

  1. Start Postgres and the service.

    See Docker below.

  2. Set your public URL, email and price table.

    The price table is built in; add your own prices if you have them. See Configuration.

  3. Point the local tools at it.

    tc connect https://tc.example.com, and the telemetry endpoint at https://tc.example.com/api/v1/ingest/otlp.

Docker

# compose.yaml
services:
tokencontroller:
image: ghcr.io/tokencontroller/tokencontroller:1.0
ports: ["8080:8080"]
environment:
DATABASE_URL: postgres://tc:secret@db/tc
TC_PUBLIC_URL: https://tc.example.com
TC_SECRET_KEY: change-me # at least 32 random characters, such as from openssl rand -hex 32
TC_SMTP_URL: smtp://user:pass@mail.example.com:587
depends_on: [db]
db:
image: postgres:17
environment:
POSTGRES_USER: tc
POSTGRES_PASSWORD: secret
volumes: ["pgdata:/var/lib/postgresql/data"]
volumes:
pgdata:
docker compose up -d

The service listens on port 8080; put a reverse proxy with TLS in front of it. The person who signs up creates the organization and becomes its org manager. Every variable is listed under Configuration.

Postgres

Postgres 15 or newer. A managed database from your cloud works as well as your own. Besides the event log, Postgres keeps what each usage endpoint received, for 400 days. Content text such as prompts and transcripts is removed on arrival unless an organization switches keeping it on, so messages and received records stay small, and a 150-member organization may fit in a small database instance.

Upgrades and backups

docker compose pull
docker compose up -d

The service updates the database schema when it starts. Read the changelog before a new major version.

Only the Postgres database holds state, so backing it up backs up everything. The raw export is a second copy of the event log in plain JSON, without the received records.

Support

Community support on GitHub. With a support contract, a self-hosted instance becomes an Enterprise plan instance. The service is AGPL-3.0; see Open source and licenses.

Last updated 27 November 2026 · Edit this page© 2026 Jan Beck · Privacy · Imprint