Skip to content

Configuration Reference

Complete reference for configuring Fluxbase via configuration file or environment variables.

Create fluxbase.yaml in your working directory:

# Server Configuration
server:
port: 8080
host: 0.0.0.0
read_timeout: 30s
write_timeout: 30s
idle_timeout: 120s
max_header_bytes: 1048576 # 1MB
# Database Configuration
database:
url: postgres://user:password@localhost:5432/fluxbase?sslmode=disable
max_connections: 100
idle_connections: 10
connection_lifetime: 60m
connection_timeout: 10s
# JWT Authentication
jwt:
secret: your-secret-key-change-this-in-production
access_token_expiry: 15m
refresh_token_expiry: 7d
issuer: fluxbase
audience: authenticated
# Storage Configuration
storage:
provider: local # "local" or "s3"
local_path: ./storage
max_upload_size: 10485760 # 10MB in bytes
# S3 Configuration (when provider: s3)
s3_endpoint: s3.amazonaws.com
s3_access_key: ""
s3_secret_key: ""
s3_region: us-east-1
s3_bucket: fluxbase
s3_use_ssl: true
# Realtime Configuration
realtime:
enabled: true
heartbeat_interval: 30s
max_connections: 1000
read_buffer_size: 1024
write_buffer_size: 1024
# Admin UI
admin:
enabled: true
path: /admin
# Logging
logging:
level: info # debug, info, warn, error
format: json # json or text
output: stdout # stdout, stderr, or file path
# CORS Configuration
cors:
enabled: true
allowed_origins:
- http://localhost:4000
- http://localhost:5173
allowed_methods:
- GET
- POST
- PUT
- PATCH
- DELETE
- OPTIONS
allowed_headers:
- Authorization
- Content-Type
- Accept
exposed_headers:
- Content-Range
- X-Content-Range
allow_credentials: true
max_age: 86400 # 24 hours
# Rate Limiting (Upcoming)
rate_limit:
enabled: false
requests_per_minute: 100
burst: 200
# TLS/HTTPS (Upcoming)
tls:
enabled: false
cert_file: /path/to/cert.pem
key_file: /path/to/key.pem
auto_cert: false # Let's Encrypt
auto_cert_domain: example.com

Environment variables take precedence over configuration file values.

VariableDescriptionDefaultExample
PORTHTTP server port80808080
HOSTHTTP server host0.0.0.00.0.0.0
SERVER_READ_TIMEOUTRead timeout30s30s
SERVER_WRITE_TIMEOUTWrite timeout30s30s
SERVER_IDLE_TIMEOUTIdle timeout120s120s
VariableDescriptionDefaultExample
DATABASE_URLPostgreSQL connection string(required)postgres://user:pass@localhost:5432/db
DB_MAX_CONNECTIONSMax connection pool size100100
DB_IDLE_CONNECTIONSIdle connections in pool1010
DB_CONNECTION_LIFETIMEConnection max lifetime60m60m
DB_CONNECTION_TIMEOUTConnection timeout10s10s
DB_USER_MIGRATIONS_PATHPath to user migrations"" (disabled)/migrations/user

Connection String Format:

postgres://username:password@host:port/database?sslmode=disable&pool_max_conns=100

SSL Modes:

  • disable - No SSL (development only)
  • require - Require SSL
  • verify-ca - Verify CA certificate
  • verify-full - Verify CA and hostname
VariableDescriptionDefaultExample
JWT_SECRETJWT signing key(required)your-secret-key
JWT_ACCESS_TOKEN_EXPIRYAccess token expiration15m15m, 1h
JWT_REFRESH_TOKEN_EXPIRYRefresh token expiration7d7d, 30d
JWT_ISSUERJWT issuerfluxbasemyapp
JWT_AUDIENCEJWT audienceauthenticatedauthenticated

Security Best Practices:

  • Use a strong, random JWT secret (min 32 characters)
  • Rotate JWT secrets periodically
  • Use short access token expiry (15-30 minutes)
  • Use longer refresh token expiry (7-30 days)
VariableDescriptionDefaultExample
STORAGE_PROVIDERStorage backendlocallocal, s3
STORAGE_LOCAL_PATHLocal storage path./storage/var/lib/fluxbase/storage
STORAGE_MAX_UPLOAD_SIZEMax upload size (bytes)1048576010485760 (10MB)
STORAGE_S3_ENDPOINTS3 endpoints3.amazonaws.coms3.amazonaws.com
STORAGE_S3_ACCESS_KEYS3 access key-AKIAIOSFODNN7EXAMPLE
STORAGE_S3_SECRET_KEYS3 secret key-wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
STORAGE_S3_REGIONS3 regionus-east-1us-west-2
STORAGE_S3_BUCKETS3 bucket namefluxbasemy-bucket
STORAGE_S3_USE_SSLUse SSL for S3truetrue, false

S3-Compatible Services:

  • AWS S3
  • MinIO (local development): http://localhost:9000
  • DigitalOcean Spaces: https://nyc3.digitaloceanspaces.com
  • Wasabi: https://s3.wasabisys.com
  • Backblaze B2: https://s3.us-west-002.backblazeb2.com
VariableDescriptionDefaultExample
REALTIME_ENABLEDEnable realtimetruetrue, false
REALTIME_HEARTBEAT_INTERVALHeartbeat interval30s30s
REALTIME_MAX_CONNECTIONSMax WebSocket connections10001000
REALTIME_READ_BUFFER_SIZEWebSocket read buffer10241024
REALTIME_WRITE_BUFFER_SIZEWebSocket write buffer10241024
VariableDescriptionDefaultExample
ADMIN_ENABLEDEnable Admin UItruetrue, false
ADMIN_PATHAdmin UI path/admin/admin, /dashboard
VariableDescriptionDefaultExample
LOG_LEVELLog levelinfodebug, info, warn, error
LOG_FORMATLog formatjsonjson, text
LOG_OUTPUTLog outputstdoutstdout, stderr, /var/log/fluxbase.log
VariableDescriptionDefaultExample
CORS_ENABLEDEnable CORStruetrue, false
CORS_ALLOWED_ORIGINSAllowed origins (comma-separated)*http://localhost:3000,https://app.com
CORS_ALLOWED_METHODSAllowed HTTP methodsAllGET,POST,PUT,DELETE
CORS_ALLOW_CREDENTIALSAllow credentialstruetrue, false
CORS_MAX_AGEPreflight cache time (seconds)8640086400
VariableDescriptionDefaultExample
RATE_LIMIT_ENABLEDEnable rate limitingfalsetrue, false
RATE_LIMIT_REQUESTS_PER_MINUTERequests per minute100100
RATE_LIMIT_BURSTBurst allowance200200
VariableDescriptionDefaultExample
TLS_ENABLEDEnable TLSfalsetrue, false
TLS_CERT_FILEPath to certificate-/etc/certs/tls.crt
TLS_KEY_FILEPath to private key-/etc/certs/tls.key
TLS_AUTO_CERTEnable Let’s Encryptfalsetrue, false
TLS_AUTO_CERT_DOMAINDomain for auto cert-example.com
server:
port: 443 # HTTPS
host: 0.0.0.0
read_timeout: 30s
write_timeout: 30s
database:
url: postgres://fluxbase:password@postgres:5432/fluxbase?sslmode=require
max_connections: 200
idle_connections: 20
connection_lifetime: 30m
jwt:
secret: ${JWT_SECRET} # From environment
access_token_expiry: 15m
refresh_token_expiry: 7d
storage:
provider: s3
max_upload_size: 52428800 # 50MB
s3_endpoint: s3.amazonaws.com
s3_access_key: ${S3_ACCESS_KEY}
s3_secret_key: ${S3_SECRET_KEY}
s3_region: us-east-1
s3_bucket: my-production-bucket
realtime:
enabled: true
heartbeat_interval: 30s
max_connections: 5000
admin:
enabled: false # Disable in production or protect behind VPN
logging:
level: info
format: json
output: /var/log/fluxbase/app.log
cors:
enabled: true
allowed_origins:
- https://app.example.com
- https://www.example.com
allow_credentials: true
rate_limit:
enabled: true
requests_per_minute: 1000
burst: 2000
tls:
enabled: true
auto_cert: true
auto_cert_domain: api.example.com
.env.production
DATABASE_URL=postgres://fluxbase:${DB_PASSWORD}@postgres:5432/fluxbase?sslmode=require
JWT_SECRET=${JWT_SECRET}
STORAGE_PROVIDER=s3
STORAGE_S3_ACCESS_KEY=${S3_ACCESS_KEY}
STORAGE_S3_SECRET_KEY=${S3_SECRET_KEY}
STORAGE_S3_BUCKET=production-bucket
LOG_LEVEL=info
LOG_FORMAT=json
CORS_ALLOWED_ORIGINS=https://app.example.com,https://www.example.com
RATE_LIMIT_ENABLED=true
RATE_LIMIT_REQUESTS_PER_MINUTE=1000
TLS_ENABLED=true
TLS_AUTO_CERT=true
TLS_AUTO_CERT_DOMAIN=api.example.com
server:
port: 8080
host: 127.0.0.1
database:
url: postgres://fluxbase:fluxbase@localhost:5432/fluxbase?sslmode=disable
max_connections: 20
idle_connections: 5
jwt:
secret: dev-secret-change-in-production
access_token_expiry: 24h # Longer for development
refresh_token_expiry: 30d
storage:
provider: local
local_path: ./storage
max_upload_size: 10485760 # 10MB
realtime:
enabled: true
max_connections: 100
admin:
enabled: true
path: /admin
logging:
level: debug
format: text
output: stdout
cors:
enabled: true
allowed_origins:
- http://localhost:3000
- http://localhost:5173
- http://127.0.0.1:3000
allow_credentials: true
rate_limit:
enabled: false # Disable in development
tls:
enabled: false # Use HTTP in development
version: "3.8"
services:
fluxbase:
image: ghcr.io/fluxbase-eu/fluxbase:latest
environment:
# Database
DATABASE_URL: postgres://fluxbase:password@postgres:5432/fluxbase?sslmode=disable
# JWT
JWT_SECRET: ${JWT_SECRET}
JWT_ACCESS_TOKEN_EXPIRY: 15m
JWT_REFRESH_TOKEN_EXPIRY: 7d
# Storage (MinIO)
STORAGE_PROVIDER: s3
STORAGE_S3_ENDPOINT: http://minio:9000
STORAGE_S3_ACCESS_KEY: minioadmin
STORAGE_S3_SECRET_KEY: minioadmin
STORAGE_S3_BUCKET: fluxbase
STORAGE_S3_USE_SSL: false
STORAGE_S3_REGION: us-east-1
# Realtime
REALTIME_ENABLED: true
REALTIME_MAX_CONNECTIONS: 1000
# Logging
LOG_LEVEL: info
LOG_FORMAT: json
# CORS
CORS_ALLOWED_ORIGINS: http://localhost:3000
ports:
- "8080:8080"
depends_on:
postgres:
condition: service_healthy
volumes:
- ./fluxbase.yaml:/app/fluxbase.yaml
postgres:
image: postgis/postgis:18-3.6
environment:
POSTGRES_DB: fluxbase
POSTGRES_USER: fluxbase
POSTGRES_PASSWORD: password
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U fluxbase"]
interval: 5s
timeout: 5s
retries: 5
minio:
image: minio/minio:latest
command: server /data --console-address ":9001"
environment:
MINIO_ROOT_USER: minioadmin
MINIO_ROOT_PASSWORD: minioadmin
ports:
- "9000:9000"
- "9001:9001"
volumes:
- minio_data:/data
volumes:
postgres_data:
minio_data:

Helm chart configuration will be available in a future release.

Configuration is loaded in the following order (later sources override earlier ones):

  1. Default values (built-in)
  2. Configuration file (fluxbase.yaml)
  3. Environment variables
  4. Command-line flags (if applicable)

Fluxbase validates configuration on startup and will fail fast if:

  • Required values are missing (e.g., DATABASE_URL, JWT_SECRET)
  • Values are invalid (e.g., negative numbers, invalid formats)
  • Database connection fails
  • Storage backend is unreachable

Currently, Fluxbase does not support hot reloading of configuration. Restart the server after making configuration changes.

Never commit secrets to version control!

Use environment variables or secret management tools:

Terminal window
# Good: Load from environment
export JWT_SECRET=$(openssl rand -hex 32)
export DATABASE_URL="postgres://user:$(cat /run/secrets/db_password)@localhost/fluxbase"
# Bad: Hardcode in config file
jwt:
secret: my-secret-key # ❌ Don't do this!

Use a secrets management solution:

  • Kubernetes: Use Secrets and ConfigMaps
  • Docker Swarm: Use Docker Secrets
  • AWS: Use AWS Secrets Manager or Parameter Store
  • HashiCorp Vault: Enterprise secret management
  • Environment: Use .env files (not in git) with proper permissions
Terminal window
# Check if file exists
ls -la fluxbase.yaml
# Validate YAML syntax
yamllint fluxbase.yaml
# Check environment variables
env | grep FLUXBASE
Terminal window
# Test connection
psql "$DATABASE_URL"
# Check connection string format
echo $DATABASE_URL

If you see CORS errors in the browser:

  1. Check CORS_ALLOWED_ORIGINS includes your frontend URL
  2. Ensure CORS_ALLOW_CREDENTIALS is true if sending cookies
  3. Check browser console for specific CORS error