Self-HostingEnvironment Variables

Environment Variables

This is the complete reference for every environment variable across all RAT services. Variables are organized by service and category.


ratd (Go Platform)

The central API server, scheduler, and plugin host.

Server

VariableDefaultDescription
RAT_LISTEN_ADDR127.0.0.1:8080Full address the HTTP server binds to (host:port)
PORTAlternative port setting. When set, binds to 0.0.0.0:<PORT>. RAT_LISTEN_ADDR takes precedence
CORS_ORIGINShttp://localhost:3000Comma-separated list of allowed CORS origins. Must include the portal URL
RATE_LIMIT50Maximum requests per second per client IP. Set to "0" to disable rate limiting
RAT_CONFIGrat.yamlPath to the rat.yaml configuration file
EDITIONcommunityPlatform edition: community or pro

Authentication

VariableDefaultDescription
RAT_API_KEYStatic API key. When set, all requests require Authorization: Bearer <key>
RAT_LICENSE_KEYPro Edition license key for plugin activation

When RAT_API_KEY is not set, the API is unauthenticated. This is the default for the Community Edition (single-user, localhost-only). For production deployments, always set an API key or use a plugin-based auth system.

Database

VariableDefaultDescription
DATABASE_URLPostgreSQL connection string. Required. Format: postgres://user:pass@host:port/dbname?sslmode=disable

S3 Storage

VariableDefaultDescription
S3_ENDPOINTMinIO or S3-compatible endpoint (e.g., minio:9000). Required
S3_ACCESS_KEYS3 access key ID. Required
S3_SECRET_KEYS3 secret access key. Required
S3_BUCKETratS3 bucket name where all data is stored
S3_USE_SSLfalseEnable TLS for S3 connections. Set to "true" for AWS S3 or TLS-enabled MinIO
S3_METADATA_TIMEOUT10sTimeout for S3 metadata operations (list, head, stat). Go duration format
S3_DATA_TIMEOUT60sTimeout for S3 data operations (get, put, upload). Go duration format

Service Discovery

VariableDefaultDescription
RUNNER_ADDRRunner service gRPC address. Required. Format: http://runner:50052
RATQ_ADDRQuery service gRPC address. Required. Format: http://ratq:50051
NESSIE_URLNessie REST catalog URL. Required. Format: http://nessie:19120/api/v1

Scheduler

VariableDefaultDescription
SCHEDULER_ENABLEDtrueEnable the built-in cron scheduler. Set to "false" to disable

TLS

VariableDefaultDescription
TLS_CERT_FILEPath to TLS certificate for HTTPS. When set with TLS_KEY_FILE, ratd serves HTTPS
TLS_KEY_FILEPath to TLS private key for HTTPS
GRPC_TLS_CAPath to CA certificate for verifying gRPC connections to runner and ratq

runner (Python Pipeline Executor)

Executes pipelines, writes to Iceberg, and runs quality tests.

S3 Storage

VariableDefaultDescription
S3_ENDPOINTminio:9000MinIO or S3-compatible endpoint
S3_ACCESS_KEYS3 access key ID. Required
S3_SECRET_KEYS3 secret access key. Required
S3_BUCKETratS3 bucket name
S3_USE_SSLfalseEnable TLS for S3 connections
S3_SESSION_TOKENSession token for temporary AWS credentials (STS)
S3_REGIONus-east-1S3 region. Required by some S3-compatible stores

DuckDB

VariableDefaultDescription
DUCKDB_MEMORY_LIMIT2GBMaximum memory per DuckDB connection. Supports units: MB, GB
DUCKDB_THREADS4Number of CPU threads for DuckDB query execution
⚠️

DUCKDB_MEMORY_LIMIT should be set lower than the container’s memory limit. If DuckDB tries to use more memory than the container allows, the OOM killer will terminate the process. A good rule of thumb: set DuckDB to 75% of the container memory.

Catalog

VariableDefaultDescription
NESSIE_URLhttp://nessie:19120/api/v1Nessie REST catalog endpoint

gRPC Server

VariableDefaultDescription
GRPC_PORT50052Port for the gRPC server
GRPC_TLS_CERTPath to TLS certificate for the gRPC server
GRPC_TLS_KEYPath to TLS private key for the gRPC server

Execution

VariableDefaultDescription
RUN_TTL_SECONDS3600How long completed run state is kept in memory (seconds). After expiry, the run status becomes unavailable via gRPC
RUNNER_MAX_CONCURRENT10Maximum number of pipelines executing simultaneously
RUNNER_MAX_WORKERS10Maximum worker threads in the execution thread pool
RUNNER_STATE_DIR/tmp/rat-runner-stateDirectory for temporary run state and intermediate files
RATD_CALLBACK_URLBase URL for push-based status callbacks to ratd. Format: http://ratd:8080. When set, the runner POSTs terminal run status instead of waiting for ratd to poll

ratq (Python Query Service)

Handles interactive DuckDB queries (read-only) and schema introspection.

S3 Storage

VariableDefaultDescription
S3_ENDPOINTminio:9000MinIO or S3-compatible endpoint
S3_ACCESS_KEYS3 access key ID. Required
S3_SECRET_KEYS3 secret access key. Required
S3_BUCKETratS3 bucket name
S3_USE_SSLfalseEnable TLS for S3 connections
S3_REGIONus-east-1S3 region

DuckDB

VariableDefaultDescription
DUCKDB_MEMORY_LIMIT2GBMaximum memory per DuckDB connection
DUCKDB_THREADS4Number of CPU threads for DuckDB query execution

Catalog

VariableDefaultDescription
NESSIE_URLhttp://nessie:19120/api/v1Nessie REST catalog endpoint

gRPC Server

VariableDefaultDescription
GRPC_PORT50051Port for the gRPC server
GRPC_TLS_CERTPath to TLS certificate for the gRPC server
GRPC_TLS_KEYPath to TLS private key for the gRPC server

portal (Next.js Web IDE)

The web-based user interface.

VariableDefaultDescription
NEXT_PUBLIC_API_URLhttp://localhost:8080Public API URL for browser-side requests. Embedded at build time
API_URLhttp://ratd:8080Internal API URL for server-side rendering. Read at runtime
⚠️

Build-time vs runtime: NEXT_PUBLIC_API_URL is baked into the JavaScript bundle during next build. Changing it requires rebuilding the portal image. API_URL is a runtime variable that can be changed via environment without rebuilding.


Infrastructure Services

These services use their official Docker images and are configured through their standard environment variables.

postgres

VariableDefaultDescription
POSTGRES_USERratPostgreSQL superuser name
POSTGRES_PASSWORDratPostgreSQL superuser password
POSTGRES_DBratDefault database name

minio

VariableDefaultDescription
MINIO_ROOT_USERminioadminMinIO root username (maps to S3_ACCESS_KEY)
MINIO_ROOT_PASSWORDminioadminMinIO root password (maps to S3_SECRET_KEY)

nessie

VariableDefaultDescription
NESSIE_VERSION_STORE_TYPEJDBCMetadata persistence backend
QUARKUS_DATASOURCE_JDBC_URLJDBC URL for Nessie metadata (points to Postgres)
QUARKUS_DATASOURCE_USERNAMEDatabase username for Nessie
QUARKUS_DATASOURCE_PASSWORDDatabase password for Nessie
NESSIE_CATALOG_DEFAULT_WAREHOUSEwarehouseDefault Iceberg warehouse name
NESSIE_CATALOG_WAREHOUSES_WAREHOUSE_LOCATIONs3://rat/Root S3 path for Iceberg data

Production Checklist

When deploying RAT in production, ensure these variables are set to secure values:

Change all default credentials

infra/.env
POSTGRES_USER=ratprod
POSTGRES_PASSWORD=<strong-random-password>
S3_ACCESS_KEY=<strong-random-key>
S3_SECRET_KEY=<strong-random-secret>

Set an API key

infra/.env
RAT_API_KEY=<your-api-key>

Configure CORS for your domain

infra/.env
CORS_ORIGINS=https://rat.yourdomain.com

Set the public API URL

infra/.env
NEXT_PUBLIC_API_URL=https://api.rat.yourdomain.com
API_URL=http://ratd:8080

Enable TLS if exposing to the internet

See the Security Hardening page for TLS configuration details.

🚫

Never use the default credentials (rat/rat, minioadmin/minioadmin) in production. These are well-known development defaults and will be the first thing an attacker tries.