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
| Variable | Description | Default | Required? |
|---|---|---|---|
PUBLIC_URL | The public address of your instance | http://localhost:8080 | Yes |
PORT | HTTP server listening port | 8080 | No |
SSH_PORT | SSH TUI listening port | 2222 | No |
DB_PATH | Path to the SQLite database file | data/flux.db | No |
KEYS_PATH | Path to the SSH authorized_keys file | data/authorized_keys | No |
FLUX_KEY | Master key for auto-unlocking the store | None | No |