Environment Variables

Flux is designed to be configurable via environment variables, allowing for flexible deployment across different environments (local development, Docker, VPS, etc.).

When starting Flux, the application will look for the following environment variables. If a variable is not set, Flux will default to the standard values listed below.

Core Configuration

PUBLIC_URL

Required
This is the most critical variable. Flux needs to know its own public-facing address to correctly generate absolute URLs for form submissions, redirects, and API endpoints.

  • Default: http://localhost:8080
  • Production Example: https://forms.example.com

PORT

The HTTP port where the Flux form server will listen for incoming traffic.

  • Default: 8080

SSH_PORT

The port used by the SSH server for the management TUI (Text User Interface).

  • Default: 2222
  • Note: Ensure this port is not blocked by your firewall if you need remote management access.

Data & Storage

DB_PATH

The file path where Flux will store its SQLite database. This database contains all form definitions, configurations, and logs.

  • Default: data/flux.db
  • Recommendation: For containerized deployments, map this path to a persistent volume to prevent data loss.

KEYS_PATH

The file path to the authorized_keys file used for SSH authentication. This file should contain the public SSH keys of the administrators allowed to access the management interface.

  • Default: data/authorized_keys

Security & Automation

FLUX_KEY

Caution: Use with care.
This variable allows you to provide the master decryption key directly via the environment. If set, Flux will auto-unlock the database upon startup, bypassing the manual unlock step in the TUI.

  • Use Case: Ideal for automated deployments (e.g., Kubernetes, systemd services) where manual intervention is impossible.
  • Security Warning: Placing secrets in environment variables can be less secure than entering them manually, as they may be visible in process listings or logs depending on your platform's configuration.

Summary Table

VariableDescriptionDefaultRequired?
PUBLIC_URLThe public address of your instancehttp://localhost:8080Yes
PORTHTTP server listening port8080No
SSH_PORTSSH TUI listening port2222No
DB_PATHPath to the SQLite database filedata/flux.dbNo
KEYS_PATHPath to the SSH authorized_keys filedata/authorized_keysNo
FLUX_KEYMaster key for auto-unlocking the storeNoneNo