Skip to main content
UpNext is configured via environment variables with the UPNEXT_ prefix. Some settings can also be passed directly to Worker and Api constructors where applicable.

Core settings

VariableDefaultDescription
UPNEXT_REDIS_URLRedis connection URL (required for workers and real-time server streams)
UPNEXT_URLhttp://localhost:8000UpNext server URL (for dashboard reporting)
UPNEXT_API_KEYStatic bearer token for self-hosted server authentication
UPNEXT_DEBUGfalseEnable debug mode
UPNEXT_ENVdevelopmentEnvironment name (development/dev or production/prod)

Server settings

Backend-first: set UPNEXT_BACKEND explicitly when starting the server.
VariableDefaultDescription
UPNEXT_BACKENDredisServer persistence backend: redis, sqlite, or postgres
UPNEXT_DATABASE_URLSQL connection URL used only when UPNEXT_BACKEND=sqlite or postgres
UPNEXT_AUTH_ENABLEDfalseEnable the self-hosted bearer-token gate
UPNEXT_CLEANUP_RETENTION_HOURSbackend-dependentJob/artifact cleanup retention window in hours

Persistence backend behavior

UPNEXT_BACKENDUPNEXT_DATABASE_URL behaviorMigrations
redisIgnored for persistenceNot used
sqliteOptional; defaults to sqlite+aiosqlite:///upnext.dbNot required (tables auto-create at startup)
postgresRequiredRequired before startup (upnext server db upgrade head)
UPNEXT_BACKEND=redis is ideal for simple/low-scale deployments with no SQL dependency.
UPNEXT_BACKEND=postgres is the recommended path for longer-term, higher-scale persistence needs.

Authentication model

  • Self-hosted: optional single-token auth using UPNEXT_AUTH_ENABLED=true and UPNEXT_API_KEY.

Cleanup retention defaults

  • UPNEXT_BACKEND=redis defaults UPNEXT_CLEANUP_RETENTION_HOURS to 6.
  • UPNEXT_BACKEND=sqlite and UPNEXT_BACKEND=postgres default it to 168.

Queue tuning

Queue behavior can be tuned with environment variables.
VariableDefaultDescription
UPNEXT_QUEUE_BATCH_SIZE4Number of jobs fetched/flushed per batch
UPNEXT_QUEUE_INBOX_SIZE4In-memory fetch buffer size (minimum batch size)
UPNEXT_QUEUE_OUTBOX_SIZE10000In-memory completion buffer size
UPNEXT_QUEUE_FLUSH_INTERVAL_MS5.0Max delay before flushing completion updates
UPNEXT_QUEUE_JOB_TTL_SECONDS86400Job data TTL (24 hours)
UPNEXT_QUEUE_CLAIM_TIMEOUT_MS30000Job claim timeout (30 seconds)
UPNEXT_QUEUE_STREAM_MAXLEN0Stream trim cap (0 = unbounded)
UPNEXT_QUEUE_DISPATCH_EVENTS_STREAM_MAXLEN10000Dispatch diagnostics stream max length

Status stream settings

VariableDefaultDescription
UPNEXT_STATUS_STREAM_MAX_LEN50000Status event stream max length
UPNEXT_STATUS_PUBLISH_RETRY_ATTEMPTS3Retries for publishing status events
UPNEXT_STATUS_PUBLISH_RETRY_BASE_MS25.0Base retry delay (ms)
UPNEXT_STATUS_PUBLISH_RETRY_MAX_MS500.0Max retry delay (ms)
UPNEXT_STATUS_PENDING_BUFFER_SIZE10000In-memory pending buffer capacity
UPNEXT_STATUS_PENDING_FLUSH_BATCH_SIZE128Pending buffer flush batch size
UPNEXT_STATUS_DURABLE_BUFFER_ENABLEDtrueEnable Redis-backed durable buffer
UPNEXT_STATUS_DURABLE_BUFFER_MAXLEN10000Durable buffer max entries
UPNEXT_STATUS_SHUTDOWN_FLUSH_TIMEOUT_SECONDS2.0Timeout for flushing on shutdown
UPNEXT_STATUS_PUBLISH_STRICTfalseFail-closed on publish errors

Progress settings

VariableDefaultDescription
UPNEXT_PROGRESS_MIN_DELTA0.01Minimum progress change to publish (1%)
UPNEXT_PROGRESS_MIN_INTERVAL_SECONDS0.2Minimum time between progress updates

API tracking settings

VariableDefaultDescription
UPNEXT_API_TRACKING_NORMALIZE_PATHStrueNormalize path parameters in tracking
UPNEXT_API_TRACKING_REGISTRY_REFRESH_SECONDS60Route registry refresh interval
UPNEXT_API_REQUEST_EVENTS_ENABLEDtrueEnable request event tracking
UPNEXT_API_REQUEST_EVENTS_SAMPLE_RATE1.0Sampling rate for request events (0.0-1.0)
UPNEXT_API_REQUEST_EVENTS_SLOW_MS500.0Threshold for slow request logging (ms)
UPNEXT_API_REQUEST_EVENTS_STREAM_MAX_LEN50000Request event stream max length

Artifact storage

VariableDefaultDescription
UPNEXT_ARTIFACT_STORAGE_BACKENDlocalStorage backend: local or s3
UPNEXT_ARTIFACT_STORAGE_LOCAL_ROOT~/.upnext/artifactsLocal storage directory