Skip to content

Environment Variables

Complete reference for all environment variables supported by r8r.

Server configuration

VariableDescriptionDefault
R8R_SERVER_HOSTBind address0.0.0.0
R8R_SERVER_PORTHTTP port3000
R8R_SERVER_REQUEST_TIMEOUTRequest timeout30s
R8R_SERVER_MAX_BODY_SIZEMax body size10MB
R8R_SERVER_WORKERSWorker threadsCPU count

Workflow configuration

VariableDescriptionDefault
R8R_WORKFLOWS_DIRECTORYWorkflows directory./workflows
R8R_WORKFLOWS_HOT_RELOADAuto-reload on changetrue

Logging

VariableDescriptionDefault
R8R_LOGGING_LEVELLog levelinfo
R8R_LOGGING_FORMATOutput formatpretty
R8R_LOGGING_OUTPUTLog destinationstdout

Log levels: trace, debug, info, warn, error

Formats: pretty (colored), json (structured), compact

Integration variables

PostgreSQL

VariableDescription
DATABASE_URLPostgreSQL connection string

Redis

VariableDescription
REDIS_URLRedis connection string

Slack

VariableDescription
SLACK_TOKENBot OAuth token
SLACK_SIGNING_SECRETWebhook signing secret

Kafka

VariableDescription
KAFKA_BROKERSComma-separated broker list

Security

VariableDescription
R8R_SECRET_KEYEncryption key for secrets
R8R_ALLOWED_HOSTSComma-separated allowed hosts

Profile

VariableDescription
R8R_PROFILEActive profile (dev/staging/production)
R8R_ENVEnvironment name

Example .env file

Terminal window
# Server
R8R_SERVER_PORT=8080
R8R_SERVER_WORKERS=4
# Logging
R8R_LOGGING_LEVEL=debug
R8R_LOGGING_FORMAT=json
# Integrations
DATABASE_URL=postgres://user:pass@localhost/db
REDIS_URL=redis://localhost:6379
SLACK_TOKEN=xoxb-your-token
# Profile
R8R_PROFILE=production

Loading .env files

r8r automatically loads .env files:

  1. .env — Base environment
  2. .env.local — Local overrides (gitignored)
  3. .env.{PROFILE} — Profile-specific

Example:

.env
R8R_SERVER_PORT=3000
# .env.local
R8R_SERVER_PORT=3001 # Local developer override
# .env.production
R8R_LOGGING_LEVEL=warn