Skip to main content
This guide is for platform engineers and developers running a custom, self-hosted instance of toorow.
Self-hosted instances operate in complete isolation. By default, toorow sends no telemetry, phone-home data, or analytics to the maintainers. See Security Constraints for details.

1. Account & Infrastructure Setup

To deploy a functional self-hosted instance, provision the following services:
  1. Platform Database (PostgreSQL 15+): Create a PostgreSQL instance (e.g., Supabase project or Cloud SQL). Apply platform migrations located in infra/nango/migrations/ (migrations 001 to 029).
  2. Google Cloud Project (Analytics Warehouse & Google OAuth):
    • Enable BigQuery, Cloud Run, and Google APIs (Analytics Data, Search Console, Google Ads, Sheets).
    • Provision BigQuery datasets (raw_*, marts_*) and a Service Account with roles/bigquery.dataEditor and roles/bigquery.jobUser. Use the Terraform scripts in infra/terraform/ (terraform plan/apply).
    • Create a Web OAuth 2.0 Client ID for Google connectors.
  3. Nango Broker (Non-Google OAuth):
    • Deploy Nango OSS using infra/nango/docker-compose.yml or create a Nango Cloud account.
    • Register provider apps (Meta Ads, TikTok, LinkedIn, Shopify, Stripe, Klaviyo) in Nango.

2. Environment Variable Reference (.env)

Copy .env.example to .env in your deployment environment and configure the required parameters.

Server & Network Security

Authentication Mode (TOOROW_AUTH_MODE)

Platform Database & Key Governance

OAuth Brokers & Providers

Background Queue & Scheduler

If your host suspends the container between requests, QUEUE_BACKEND=local will not run your scheduled work.The local backend relies on three in-process daemon threads (queue worker, nightly scheduler, health poller). On a platform that allocates CPU only during request handling — Google Cloud Run with --min-instances=0 is the reference case — those threads only advance while a request happens to be in flight, so nightly retrieval may never fire and nothing records that it did not.Choose one:
  • cloud_tasks with Cloud Scheduler driving /internal/scheduler/* (see Cloud Hosting);
  • or local on a host that keeps the process running continuously (a VM, a container with always-allocated CPU, docker-compose).
SCHEDULER_ENABLED=true alone does not make an idle-suspended container run its scheduler.

Read-Through Cache (DuckDB)

Optional Telemetry & Tracing


3. Container Deployment (Cloud Run)

  1. Build Container Image:
  2. Push Image & Deploy:

Next Steps & Cross-References

Prerequisites

Verify required GCP APIs, service accounts, and database connections.

Security Constraints

Review the pre-live security checklist and architectural invariants.

Cloud Hosting

Examine the maintainers’ managed Cloud Run setup.

Developer Quickstart

Run a lightweight local sandbox instance for testing.