Skip to content

Configuration

Configuration is via environment variables. Set them in your .env file (Docker) or .env.local (bare metal).

Required

VariableDescription
AUTH_SECRETSecret key for JWT sessions. Generate with openssl rand -base64 32

Application

VariableDefaultDescription
OPENTASK_DB_PATH./data/tasks.dbSQLite database file path
AUTH_URLPublic URL for NextAuth redirects (required behind a reverse proxy)

Data Retention

All values in days. Data older than the retention period is automatically purged.

VariableDefaultDescription
OPENTASK_RETENTION_UNDO_DAYS30Undo log entries
OPENTASK_RETENTION_TRASH_DAYS30Trashed tasks before permanent deletion
OPENTASK_RETENTION_COMPLETIONS_DAYS30Task completion records
OPENTASK_RETENTION_STATS_DAYS365Daily statistics
OPENTASK_RETENTION_AI_ACTIVITY_DAYS90AI activity logs

Authentication

VariableDefaultDescription
OPENTASK_PROXY_AUTH_HEADERHeader name for reverse proxy auth (e.g., Remote-User). See Reverse Proxy.

Docker First-Run

Used by the Docker entrypoint to create the initial user on first start.

VariableDescription
OPENTASK_INIT_USERNAMEInitial username
OPENTASK_INIT_PASSWORDInitial password
OPENTASK_INIT_EMAILInitial email (optional)
OPENTASK_INIT_TIMEZONEUser timezone, e.g. America/New_York (required when init vars are set)

Push Notifications

See Notifications for full setup instructions.

Web Push

VariableDescription
VAPID_PUBLIC_KEYGenerate with npx web-push generate-vapid-keys
VAPID_PRIVATE_KEYGenerated alongside public key
VAPID_EMAILContact email for VAPID (e.g., mailto:you@example.com)

APNs (iOS Native)

VariableDescription
APNS_KEY_IDKey ID from Apple Developer portal
APNS_TEAM_IDTeam ID from Apple Developer portal
APNS_KEY_PATHPath to .p8 key file
APNS_BUNDLE_IDApp bundle ID (e.g., io.mcnitt.opentask)

AI Features

See AI Features for details.

VariableDefaultDescription
OPENTASK_AI_ENABLEDfalseEnable AI enrichment, insights, and suggestions
OPENTASK_AI_PROVIDERanthropic, openai, or sdk — auto-detected from available keys and SDK
ANTHROPIC_API_KEYAnthropic API key (required for anthropic provider)
OPENAI_API_KEYOpenAI-compatible API key (required for openai provider)
OPENAI_BASE_URLhttps://api.openai.com/v1Base URL for OpenAI-compatible providers (Grok, DeepSeek, Ollama, etc.)
OPENTASK_AI_ENRICHMENT_MODELModel for task parsing
OPENTASK_AI_QUICKTAKE_MODELModel for Quick Take commentary
OPENTASK_AI_WHATS_NEXT_MODELModel for suggestions
OPENTASK_AI_INSIGHTS_MODELModel for insights
OPENTASK_AI_QUEUE_TIMEOUT_MS30000Max wait time for a concurrent slot (ms)

All four per-feature model variables are required when using Anthropic API or OpenAI-compatible providers. Claude Code SDK provides defaults automatically.

Claude Code SDK only

These variables only apply when using the Claude Code SDK provider.

VariableDefaultDescription
OPENTASK_AI_SDK_MODELsonnetGlobal default model for all SDK features
OPENTASK_AI_ENRICHMENT_SDK_MODELOverride SDK model for task parsing
OPENTASK_AI_QUICKTAKE_SDK_MODELOverride SDK model for Quick Take
OPENTASK_AI_WHATS_NEXT_SDK_MODELOverride SDK model for suggestions
OPENTASK_AI_INSIGHTS_SDK_MODELOverride SDK model for insights
OPENTASK_AI_MAX_REUSES8Subprocess reuse limit before recycling
OPENTASK_AI_QUERY_TIMEOUT_MS60000SDK query timeout in milliseconds
OPENTASK_AI_MAX_CONCURRENT4Max concurrent AI subprocesses
OPENTASK_AI_CLI_PATHPath to Claude Code CLI (standalone builds only)

Monitoring

VariableDefaultDescription
OPENTASK_NTFY_URLhttps://ntfy.shntfy server URL for error alerts
OPENTASK_NTFY_TOPICntfy topic name (empty = disabled)

Analytics

Build-time variables (set before npm run build, not at runtime).

VariableDescription
NEXT_PUBLIC_UMAMI_WEBSITE_IDUmami analytics website ID
NEXT_PUBLIC_UMAMI_SCRIPT_URLUmami instance URL