Skip to content
Distr
Book DemoStart free trialLogin

Configuration Reference

This page lists all environment variables used to configure a self-hosted Distr Hub. Variables marked as required must be set for the Hub to start (some are only required when a related feature is enabled). Durations use Go’s duration syntax (e.g. 5s, 10m, 24h) and cron values use standard cron syntax (e.g. 0 * * * *).

VariableRequiredDefaultDescription
DATABASE_URLyesPostgreSQL connection string (e.g. postgres://user:pass@host:5432/distr).
DATABASE_MAX_CONNSnoOverrides the maximum number of connections in the pgx pool.
JWT_SECRETyesBase64-encoded secret used to sign JWTs. Generate with openssl rand -base64 32.
DISTR_HOSTyesBase URL of your Distr instance. Used for links, callbacks and email content.
DISTR_ENVnoPath to a dotenv file to load on startup (a matching .secret file is also loaded if present).
REGISTRATIONnoenabledSign-up mode: enabled, hidden or disabled.
USER_EMAIL_VERIFICATION_REQUIREDnotrueWhether new users must verify their email address before signing in.
SERVER_SHUTDOWN_DELAY_DURATIONnoDelay between receiving a shutdown signal and stopping the server (useful for rolling deploys).
ENABLE_QUERY_LOGGINGnofalseLogs all database queries. Intended for debugging only.
VariableRequiredDefaultDescription
INVITE_TOKEN_VALID_DURATIONno24hHow long user invite links remain valid.
RESET_TOKEN_VALID_DURATIONno1hHow long password reset links remain valid.
AGENT_TOKEN_MAX_VALID_DURATIONno24hMaximum validity of an agent access token before it is refreshed.
VariableRequiredDefaultDescription
AGENT_INTERVALno5sInterval at which agents poll the Hub for updates.
AGENT_DOCKER_CONFIGnoBase64-encoded Docker config JSON provided to Docker agents for registry authentication.

Email sending is disabled unless MAILER_TYPE is set. MAILER_SMTP_* values only apply when MAILER_TYPE=smtp.

VariableRequiredDefaultDescription
MAILER_TYPEnoMailer backend: smtp, ses or empty (disabled).
MAILER_FROM_ADDRESSif mailer enabledSender address used for outgoing emails.
MAILER_SMTP_HOSTnoSMTP server hostname.
MAILER_SMTP_PORTif smtpSMTP server port.
MAILER_SMTP_USERNAMEnoSMTP username.
MAILER_SMTP_PASSWORDnoSMTP password.
MAILER_SMTP_IMPLICIT_TLSnofalseUse implicit TLS instead of STARTTLS (typically required on port 465).
NOTIFICATION_EMAIL_HOURLY_QUOTAno120Max status/metrics notification emails sent to a single address per hour. 0 disables the limit.

Registry variables are only read when REGISTRY_ENABLED=true. See Registry Configuration for a feature overview.

VariableRequiredDefaultDescription
REGISTRY_ENABLEDnofalseEnables the built-in OCI-compatible artifact registry.
REGISTRY_HOSTif registry enabledHost (and optional port) clients use to reach the registry.
REGISTRY_S3_BUCKETif registry enabledS3 bucket used to store registry blobs.
REGISTRY_S3_REGIONif registry enabledS3 region of the bucket.
REGISTRY_S3_CREATE_BUCKETnofalseCreates the bucket on startup (requires s3:CreateBucket).
REGISTRY_S3_ENDPOINTnoCustom S3 endpoint (for MinIO or other S3-compatible storage).
REGISTRY_S3_ACCESS_KEY_IDnoS3 access key ID (falls back to the default AWS credential chain if unset).
REGISTRY_S3_SECRET_ACCESS_KEYnoS3 secret access key.
REGISTRY_S3_USE_PATH_STYLEnofalseUse path-style bucket addressing (required by most non-AWS S3 implementations).
REGISTRY_S3_ALLOW_REDIRECTnotrueAllow redirecting blob downloads directly to S3.
REGISTRY_S3_REQUEST_CHECKSUM_CALCULATIONnofalseOnly calculate request checksums when required (compatibility with some backends).
REGISTRY_S3_RESPONSE_CHECKSUM_VALIDATIONnofalseOnly validate response checksums when required.
REGISTRY_RESIGN_FOR_GCPnofalseRe-sign requests for Google Cloud Storage compatibility.
REGISTRY_SCRATCH_DIRnoDirectory used for temporary files during uploads.
ARTIFACT_TAGS_DEFAULT_LIMIT_PER_ORGno0Default maximum number of artifact tags per organization. 0 means unlimited.
REGISTRY_UPSTREAM_SYNC_CRONnoCron schedule for syncing tags from upstream registries (pull-through cache).
REGISTRY_UPSTREAM_SYNC_TIMEOUTno10mTimeout for a single upstream sync run.
VariableRequiredDefaultDescription
SUPPORT_BUNDLE_LOG_TAIL_LINESno1000Number of container log lines (per container) collected by the support bundle collect script.

Deployment and deployment target log records are stored in Grafana Loki. All shipped deployment methods (Docker Compose and the Helm chart) include a preconfigured Loki instance with a time-based retention of 30 days. Log retention is managed entirely by the Loki configuration (limits_config.retention_period).

VariableRequiredDefaultDescription
LOKI_URLyesBase URL of the Loki instance, e.g. http://loki:3100.
LOKI_BEARER_TOKENnoBearer token for authenticating against Loki.
LOKI_BASIC_AUTH_USERNAMEnoUsername for basic authentication against Loki. Ignored when LOKI_BEARER_TOKEN is set.
LOKI_BASIC_AUTH_PASSWORDnoPassword for basic authentication against Loki. Only used when LOKI_BASIC_AUTH_USERNAME is set.
LOKI_REQUEST_TIMEOUTno30sTimeout for a single Loki HTTP request.

These control the built-in job scheduler and retention limits. See Maintenance Jobs for details and Kubernetes CronJob alternatives. If a *_CRON variable is unset, the corresponding job is not scheduled. A *_TIMEOUT of 0 means no timeout.

VariableRequiredDefaultDescription
STATUS_ENTRIES_MAX_AGEnoMax age of deployment revision status entries before cleanup removes them.
METRICS_ENTRIES_MAX_AGEnoMax age of deployment target metrics entries before cleanup removes them.
CLEANUP_DEPLOYMENT_REVISION_STATUS_CRONnoCron schedule for pruning deployment revision status entries.
CLEANUP_DEPLOYMENT_REVISION_STATUS_TIMEOUTno0Timeout for the revision status cleanup run.
CLEANUP_DEPLOYMENT_TARGET_METRICS_CRONnoCron schedule for pruning deployment target metrics.
CLEANUP_DEPLOYMENT_TARGET_METRICS_TIMEOUTno0Timeout for the metrics cleanup run.
CLEANUP_OIDC_STATE_CRONnoCron schedule for pruning expired OIDC state entries.
CLEANUP_OIDC_STATE_CRON_TIMEOUTno0Timeout for the OIDC state cleanup run.
CLEANUP_ARTIFACT_BLOB_CRONnoCron schedule for pruning unreferenced registry blobs from S3.
CLEANUP_ARTIFACT_BLOB_TIMEOUTno0Timeout for the artifact blob cleanup run.
CLEANUP_ARTIFACT_BLOB_MIN_AGEno24hMinimum age of an unreferenced blob before it is eligible for deletion.
CLEANUP_ORGANIZATION_CRONnoCron schedule for permanently deleting soft-deleted organizations.
CLEANUP_ORGANIZATION_TIMEOUTno0Timeout for the organization cleanup run.
CLEANUP_ORGANIZATION_MIN_AGEno720hRetention period before a soft-deleted organization is permanently deleted.
DEPLOYMENT_STATUS_NOTIFICATION_CRONnoCron schedule for sending deployment status notification emails.
DEPLOYMENT_STATUS_NOTIFICATION_TIMEOUTno0Timeout for the deployment status notification run.

Each provider is enabled independently and its credentials are only required when it is enabled. See OIDC Authentication for setup instructions and callback URLs.

VariableRequiredDefaultDescription
OIDC_GITHUB_ENABLEDnofalseEnables GitHub sign-in.
OIDC_GITHUB_CLIENT_IDif GitHub enabledGitHub OAuth App client ID.
OIDC_GITHUB_CLIENT_SECRETif GitHub enabledGitHub OAuth App client secret.
OIDC_GOOGLE_ENABLEDnofalseEnables Google sign-in.
OIDC_GOOGLE_CLIENT_IDif Google enabledGoogle OAuth 2.0 client ID.
OIDC_GOOGLE_CLIENT_SECRETif Google enabledGoogle OAuth 2.0 client secret.
OIDC_MICROSOFT_ENABLEDnofalseEnables Microsoft (Entra ID) sign-in.
OIDC_MICROSOFT_CLIENT_IDif MS enabledEntra ID application (client) ID.
OIDC_MICROSOFT_CLIENT_SECRETif MS enabledEntra ID client secret.
OIDC_MICROSOFT_TENANT_IDif MS enabledDirectory (tenant) ID, or common/organizations/consumers.
OIDC_GENERIC_ENABLEDnofalseEnables a generic OIDC provider.
OIDC_GENERIC_CLIENT_IDif generic enabledClient ID issued by the provider.
OIDC_GENERIC_CLIENT_SECRETif generic enabledClient secret issued by the provider.
OIDC_GENERIC_ISSUERif generic enabledIssuer URL exposing /.well-known/openid-configuration.
OIDC_GENERIC_SCOPESif generic enabledComma- or space-separated scopes (e.g. openid,email,profile).
OIDC_GENERIC_PKCE_ENABLEDnofalseEnables PKCE (S256) for the generic provider.
WELLKNOWN_MICROSOFT_IDENTITY_ASSOCIATION_JSONnoBase64-encoded JSON served at /.well-known/microsoft-identity-association.json.

Tracing and error reporting via Sentry and OpenTelemetry. Sampler variables accept always_on, always_off, traceidratio, parentbased_always_on, parentbased_always_off or parentbased_traceidratio.

VariableRequiredDefaultDescription
SENTRY_DSNnoSentry DSN for backend error reporting.
SENTRY_DEBUGnofalseEnables Sentry debug logging.
SENTRY_ENVIRONMENTnoEnvironment name reported to Sentry (e.g. production).
OTEL_EXPORTER_SENTRY_ENABLEDnofalseExports OpenTelemetry traces to Sentry.
OTEL_EXPORTER_OTLP_ENABLEDnofalseExports OpenTelemetry traces via OTLP (configured with standard OTEL_* variables).
OTEL_AGENT_SAMPLERnoTrace sampler used for agent requests.
OTEL_AGENT_SAMPLER_ARGno1.0Argument for the agent sampler (e.g. ratio for traceidratio).
OTEL_REGISTRY_SAMPLERnoTrace sampler used for registry requests.
OTEL_REGISTRY_SAMPLER_ARGno1.0Argument for the registry sampler.

Exposes an internal Prometheus metrics endpoint. See Prometheus Integration for details.

VariableRequiredDefaultDescription
METRICS_ENABLEDnofalseEnables the Prometheus metrics endpoint.
METRICS_ADDRno:3000Address the metrics endpoint listens on.
METRICS_BEARER_TOKENnoBearer token required to scrape the metrics endpoint, if set.

These values are injected into the compiled frontend at runtime.

VariableRequiredDefaultDescription
FRONTEND_SENTRY_DSNnoSentry DSN for frontend error reporting.
FRONTEND_SENTRY_TRACE_SAMPLE_RATEnoFrontend trace sample rate (0.01.0).
FRONTEND_POSTHOG_TOKENnoPostHog project API token for frontend analytics.
FRONTEND_POSTHOG_API_HOSTnoPostHog API host.
FRONTEND_POSTHOG_UI_HOSTnoPostHog UI host.

Options relevant to Distr Pro and hosted billing.

VariableRequiredDefaultDescription
LICENSE_KEYnoDistr Pro license key enabling enterprise features.
LICENSE_KEY_PRIVATE_KEYnoPEM-encoded private key used to sign customer license keys.
STRIPE_API_KEYnoStripe API key for billing integration.
STRIPE_WEBHOOK_SECRETnoSecret used to verify incoming Stripe webhooks.
STRIPE_WEBHOOK_VERSION_MISMATCH_BEHAVIORnoerrorBehavior on Stripe API version mismatch: error or ignore.