Self-hosting

What you run when you self-host GetPaidHQ.

GetPaidHQ is self-hostable billing infrastructure. You run the API, databases, workflow engine, pub/sub, cache, and any payment-provider credentials inside your own environment.

What you host

ComponentRequiredNotes
API serverYesGo HTTP service. REST API is mounted under /api.
PostgresYesOperational database.
Workflow engineYesHatchet by default; Temporal can be selected.
RedisRecommendedCache and cluster-wide rate limits.
NATSRecommendedPub/sub. Required for JetStream usage ingestion.
Usage storeOptionalSame Postgres, separate Postgres DB, or ClickHouse.

Local self-hosting

From the server repository:

cp .env.example .env
make up
make db-migrate-all
make run

make up starts the local backing services:

ServiceLocal port
Postgres10432
Redis10379
NATS10422
NATS monitoring10822
Hatchet UI/API10888
Hatchet gRPC10707

Minimum production shape

Run at least:

  1. One or more API server instances.
  2. A managed or self-hosted Postgres database.
  3. A workflow engine reachable from the API workers.
  4. Redis if more than one API instance is running.
  5. NATS if using pub/sub-backed workflows or JetStream usage ingestion.

For low usage volume, USAGE_DATABASE_URL can be empty and usage events will use the operational Postgres database. For heavier usage, use a separate usage database or ClickHouse.

Required configuration

Set these before serving production traffic:

  • DATABASE_URL
  • API_KEY_PEPPER
  • SECRETS_ENCRYPTION_KEY
  • ALLOWED_ORIGINS
  • WORKFLOW_ENGINE
  • workflow-engine credentials, such as HATCHET_CLIENT_TOKEN
  • payment gateway credentials for the processors you enable

Recommended:

  • REDIS_HOST
  • NATS_URL
  • USAGE_DATABASE_URL for separate usage-event storage
  • USAGE_INGEST_MODE=jetstream only when NATS JetStream is available

Data ownership

Self-hosting keeps customer, subscription, payment, dunning, and usage data in your infrastructure. Payment credentials should still be encrypted and scoped to the gateway adapters you use.

Next