Intermediate

Environment Variables Reference

Complete reference of all environment variables for configuring Tapioca.

This page provides a complete reference of all environment variables supported by Tapioca. Environment variables take precedence over configuration file values and are the recommended way to configure production deployments.

Variable Naming Convention

All environment variables use the prefix TAPIOCA_ followed by the configuration path in uppercase with underscores. For example, server.port becomes TAPIOCA_SERVER_PORT.

Quick Reference

Use this table to quickly find the environment variable you need:

CategoryVariablesDescription
ServerTAPIOCA_SERVER_*HTTP server configuration
DatabaseTAPIOCA_DATABASE_*PostgreSQL connection settings
CacheTAPIOCA_CACHE_*Redis caching configuration
AuthenticationTAPIOCA_AUTH_*Auth methods and SSO
SMTPTAPIOCA_SMTP_*Email sending configuration
JobsTAPIOCA_JOBS_*Background job processing
WebSocketTAPIOCA_WEBSOCKET_*Real-time updates configuration
StorageTAPIOCA_STORAGE_*File storage settings
LoggingTAPIOCA_LOG_*Logging configuration
PerformanceTAPIOCA_PERFORMANCE_*Performance tuning

Server

HTTP server configuration.

VariableTypeDefaultDescription
TAPIOCA_SERVER_HOSTstring0.0.0.0Listen address
TAPIOCA_SERVER_PORTint8080HTTP port
TAPIOCA_SERVER_READ_TIMEOUTduration30sRequest read timeout
TAPIOCA_SERVER_WRITE_TIMEOUTduration30sResponse write timeout
TAPIOCA_SERVER_IDLE_TIMEOUTduration120sKeep-alive idle timeout
TAPIOCA_SERVER_SHUTDOWN_TIMEOUTduration30sGraceful shutdown timeout

Database

PostgreSQL database configuration.

VariableTypeDefaultDescription
TAPIOCA_DATABASE_URLstringrequiredPostgreSQL connection URL
TAPIOCA_DATABASE_MAX_OPEN_CONNSint25Maximum open connections
TAPIOCA_DATABASE_MAX_IDLE_CONNSint5Maximum idle connections
TAPIOCA_DATABASE_CONN_MAX_LIFETIMEduration15mMaximum connection lifetime
TAPIOCA_DATABASE_CONN_MAX_IDLE_TIMEduration5mMaximum idle time
TAPIOCA_DATABASE_AUTO_MIGRATEboolfalseAuto-run migrations on startup
TAPIOCA_DATABASE_FORCE_MIGRATEboolfalseForce migration in dirty state

Database URL Format

The database URL must follow PostgreSQL connection string format: postgres://user:password@host:port/dbname?param=value

Cache

Redis cache configuration.

VariableTypeDefaultDescription
TAPIOCA_CACHE_TYPEstringmemoryCache type: redis, memory, or none
TAPIOCA_CACHE_REDIS_ADDRESSstringlocalhost:6379Redis server address
TAPIOCA_CACHE_REDIS_PASSWORDstring-Redis password
TAPIOCA_CACHE_REDIS_DBint0Redis database number
TAPIOCA_CACHE_REDIS_KEY_PREFIXstringtapioca:Key prefix for namespacing
TAPIOCA_CACHE_REDIS_POOL_SIZEint10Maximum connections in pool
TAPIOCA_CACHE_REDIS_MIN_IDLE_CONNSint2Minimum idle connections

Authentication

User authentication and session management.

VariableTypeDefaultDescription
TAPIOCA_AUTH_SESSION_SECRETstringrequiredJWT signing secret (min 32 chars)
TAPIOCA_AUTH_SESSION_DURATIONduration24hSession validity duration
TAPIOCA_AUTH_TOKEN_EXPIRATIONduration24hAPI token expiration
TAPIOCA_AUTH_FRONTEND_URLstring-Frontend URL for redirects
TAPIOCA_AUTH_INTEGRATION_ENCRYPTION_KEYstringrequiredOAuth token encryption key (64 hex)

Generate Secure Keys

Always generate cryptographically secure keys using openssl rand -base64 32 for session secret and openssl rand -hex 32 for integration key.

OIDC Authentication

VariableTypeDefaultDescription
TAPIOCA_AUTH_OIDC_ENABLEDboolfalseEnable OIDC authentication
TAPIOCA_AUTH_OIDC_ISSUER_URLstring-OIDC provider issuer URL
TAPIOCA_AUTH_OIDC_CLIENT_IDstring-OAuth client ID
TAPIOCA_AUTH_OIDC_CLIENT_SECRETstring-OAuth client secret
TAPIOCA_AUTH_OIDC_REDIRECT_URLstring-OAuth callback URL

SMTP

Email sending configuration.

VariableTypeDefaultDescription
TAPIOCA_SMTP_HOSTstring-SMTP server hostname
TAPIOCA_SMTP_PORTint587SMTP server port
TAPIOCA_SMTP_USERNAMEstring-SMTP username
TAPIOCA_SMTP_PASSWORDstring-SMTP password
TAPIOCA_SMTP_FROMstring-Sender email address
TAPIOCA_SMTP_FROM_NAMEstringTapiocaSender display name
TAPIOCA_SMTP_TLSbooltrueEnable TLS/STARTTLS

Jobs

Background job processing configuration.

VariableTypeDefaultDescription
TAPIOCA_JOBS_ENABLEDbooltrueEnable job processing
TAPIOCA_JOBS_WORKER_MODEstringembeddedWorker mode: embedded, separate, both
TAPIOCA_JOBS_CONCURRENCYint10Number of concurrent workers

WebSocket

Real-time updates and presence tracking.

VariableTypeDefaultDescription
TAPIOCA_WEBSOCKET_ENABLEDbooltrueEnable WebSocket support
TAPIOCA_WEBSOCKET_MAX_CONNECTIONS_PER_USERint5Max connections per user
TAPIOCA_WEBSOCKET_REDIS_ENABLEDboolfalseEnable Redis pub/sub for multi-instance

Storage

File storage configuration.

VariableTypeDefaultDescription
TAPIOCA_STORAGE_TYPEstringlocalStorage type: local or s3
TAPIOCA_STORAGE_LOCAL_BASE_PATHstring./data/exportsLocal storage directory
TAPIOCA_STORAGE_S3_REGIONstringus-east-1AWS region
TAPIOCA_STORAGE_S3_BUCKETstring-S3 bucket name
TAPIOCA_STORAGE_S3_ACCESS_KEY_IDstring-AWS access key
TAPIOCA_STORAGE_S3_SECRET_ACCESS_KEYstring-AWS secret key

Logging

Logging configuration for multiple outputs.

VariableTypeDefaultDescription
TAPIOCA_LOG_STDOUT_ENABLEDbooltrueEnable stdout logging
TAPIOCA_LOG_STDOUT_LEVELstringinfoLog level: trace, debug, info, warn, error
TAPIOCA_LOG_STDOUT_FORMATstringprettyFormat: pretty or json
TAPIOCA_LOG_FILE_ENABLEDboolfalseEnable file logging
TAPIOCA_LOG_FILE_PATHstring-Log file path
TAPIOCA_LOG_LOKI_ENABLEDboolfalseEnable Loki logging
TAPIOCA_LOG_LOKI_ENDPOINTstring-Loki push API endpoint

Performance

Performance tuning configuration.

VariableTypeDefaultDescription
TAPIOCA_PERFORMANCE_COMPRESSION_ENABLEDbooltrueEnable response compression
TAPIOCA_PERFORMANCE_SLOW_QUERY_ENABLEDbooltrueEnable slow query detection
TAPIOCA_PERFORMANCE_SLOW_QUERY_THRESHOLDduration100msSlow query threshold
TAPIOCA_PERFORMANCE_PROFILING_PPROF_ENABLEDbooltrueEnable pprof endpoints

Complete Production Example

Here is a complete production environment variable configuration:

#!/bin/bash
# Production environment variables for Tapioca

# Server
export TAPIOCA_SERVER_HOST="0.0.0.0"
export TAPIOCA_SERVER_PORT=8080

# Database
export TAPIOCA_DATABASE_URL="postgres://tapioca:${DB_PASSWORD}@postgres:5432/tapioca?sslmode=require"
export TAPIOCA_DATABASE_MAX_OPEN_CONNS=50

# Cache
export TAPIOCA_CACHE_TYPE="redis"
export TAPIOCA_CACHE_REDIS_ADDRESS="redis:6379"
export TAPIOCA_CACHE_REDIS_PASSWORD="${REDIS_PASSWORD}"

# Authentication
export TAPIOCA_AUTH_SESSION_SECRET="${SESSION_SECRET}"
export TAPIOCA_AUTH_INTEGRATION_ENCRYPTION_KEY="${INTEGRATION_KEY}"
export TAPIOCA_AUTH_FRONTEND_URL="https://tapioca.example.com"

# OIDC
export TAPIOCA_AUTH_OIDC_ENABLED="true"
export TAPIOCA_AUTH_OIDC_ISSUER_URL="https://accounts.google.com"
export TAPIOCA_AUTH_OIDC_CLIENT_ID="${OIDC_CLIENT_ID}"
export TAPIOCA_AUTH_OIDC_CLIENT_SECRET="${OIDC_CLIENT_SECRET}"

# SMTP
export TAPIOCA_SMTP_HOST="smtp.gmail.com"
export TAPIOCA_SMTP_PORT=587
export TAPIOCA_SMTP_USERNAME="${SMTP_USERNAME}"
export TAPIOCA_SMTP_PASSWORD="${SMTP_PASSWORD}"
export TAPIOCA_SMTP_FROM="[email protected]"

# Storage
export TAPIOCA_STORAGE_TYPE="s3"
export TAPIOCA_STORAGE_S3_REGION="us-east-1"
export TAPIOCA_STORAGE_S3_BUCKET="tapioca-production"
export TAPIOCA_STORAGE_S3_ACCESS_KEY_ID="${AWS_ACCESS_KEY_ID}"
export TAPIOCA_STORAGE_S3_SECRET_ACCESS_KEY="${AWS_SECRET_ACCESS_KEY}"

# Logging
export TAPIOCA_LOG_STDOUT_LEVEL="info"
export TAPIOCA_LOG_STDOUT_FORMAT="json"
export TAPIOCA_LOG_FILE_ENABLED="true"
export TAPIOCA_LOG_LOKI_ENABLED="true"

Next Steps

Was this page helpful?

Let us know how we can improve