Configuration

Environment variables and settings to customize your fxPanel instance.


Environment Variables

fxPanel host configuration is read from process environment variables with the TXHOST_ prefix. Set these in the FXServer launch environment before starting the process.

Note

The production runtime reads process.env; it does not load a .env file by itself. The repository's dev scripts load the root .env for TXDEV_* workflows, but TXHOST_* values for a deployed server should come from your shell, service manager, container, or hosting panel. Do not wrap values in quotes; fxPanel rejects quoted TXHOST_* values.

VariableDescriptionDefault
TXHOST_DATA_PATHAbsolute path to the txData folderDerived from FXServer path
TXHOST_GAME_NAMERestrict game selection to fivem or redmAuto-detect
TXHOST_MAX_SLOTSEnforce a positive integer maximum player countUnset
TXHOST_QUIET_MODESet to true to hide FXServer output in stdoutfalse
TXHOST_API_TOKENToken for GET /host/status; use disabled to disable the endpointUnset

TXHOST_API_TOKEN must be 16-48 characters and may contain letters, numbers, underscores, and dashes.


Networking

Control how fxPanel binds to network interfaces and which ports it uses.

VariableDescriptionDefault
TXHOST_TXA_URLPublic URL for fxPanelUnset
TXHOST_TXA_PORTfxPanel web interface port; cannot be 3012040120
TXHOST_FXS_PORTForce a specific positive FXServer port; cannot be 40120-40150Unset
TXHOST_INTERFACEBind interface IPv4 addressDefault bind behavior

Provider Customization

Hosting providers can brand the fxPanel interface with their name and logo.

VariableDescription
TXHOST_PROVIDER_NAMEHosting provider name displayed in the panel
TXHOST_PROVIDER_LOGOURL to provider logo

Provider names must be 2-16 characters, start and end with a letter or number, and may contain letters, numbers, spaces, underscores, periods, and hyphens. Consecutive special characters are rejected.


Default Values

Pre-fill setup fields so server owners don't have to enter them manually. These are used as defaults during the initial setup wizard and deployer.

VariableDescription
TXHOST_DEFAULT_DBHOSTDefault database host
TXHOST_DEFAULT_DBPORTDefault database port
TXHOST_DEFAULT_DBUSERDefault database username
TXHOST_DEFAULT_DBPASSDefault database password
TXHOST_DEFAULT_DBNAMEDefault database name
TXHOST_DEFAULT_CFXKEYDefault CFX license key
TXHOST_DEFAULT_ACCOUNTDefault admin account for auto-setup

Security Note

Default credentials (especially database passwords and CFX keys) should only be set in secure hosting environments. They are visible to anyone with access to environment variables on the machine.

TXHOST_DEFAULT_ACCOUNT must be username:fivemId or username:fivemId:bcrypt. The username must pass the same FiveM username validation used for admin accounts, and the optional password must be a bcrypt hash.


Environment validation errors

On startup, fxPanel parses every set TXHOST_* variable through getHostVars(). Invalid values call fatalError and stop the process before the panel listens. Full tables (including host FXPHOST_* and UI strings) are in Error messages.

Message / patternVariable (typical)What to do
Invalid value for a TXHOST environment variable. + quote hintAny TXHOST_*Remove surrounding " or ' in your host panel / systemd / Docker env
Zod detail after the block aboveThe failing key shown in logsFix format per tables in Environment Variables and Networking
Token must be alphanumeric… / lengthTXHOST_API_TOKENUse 16–48 chars from [A-Za-z0-9_-] or set disabled
DATA_PATH must be an absolute pathTXHOST_DATA_PATHFull filesystem path to txData
TXA_PORT cannot be 30120TXHOST_TXA_PORTChoose another panel port (default 40120)
FXS_PORT cannot be between 40120 and 40150TXHOST_FXS_PORTAvoid the reserved panel port range
Invalid IPv4 addressTXHOST_INTERFACEDotted-quad IPv4 only
Provider name validation messagesTXHOST_PROVIDER_NAMESee Provider Customization
The account needs to be in the username:fivemId…TXHOST_DEFAULT_ACCOUNTname:fivemId or name:fivemId:bcrypt
The key needs to be in the cfxk_… formatTXHOST_DEFAULT_CFXKEYValid Cfx license key string
Public addon server requires TLS credentials…TXHOST_ADDON_PUBLIC_TLS_*Set TLS key/cert (or _FILE paths) when addons use a dedicated public HTTPS port