Configuration

Local Bridge supports three layers of configuration. They are applied in a strict priority order so you always know which value wins.

Priority Order

Highest Priority
       |
  CLI Flags          --port 9000
       |
  Environment Vars   LOCALBRIDGE_PORT=9000
       |
  Config File        (see path below)
       |
  Built-in Defaults  port: 8080
       |
Lowest Priority

CLI flags always win. If a flag is not provided, the CLI checks environment variables. If those are not set, it reads the config file. If that key is missing, it falls back to the hardcoded default.

Config File

The configuration file location for your platform:

%USERPROFILE%\.localbridge\config.json

Example config.json:

{
  "port": 9000,
  "rate_limit": 100,
  "ignore_patterns": "*.env,*.key,node_modules",
  "no_tunnel": false,
  "bg": false
}

Security Note

Local Bridge applies restrictive ACL permissions to the configuration directory during install and activate, ensuring only your user account can access these files.

Environment Variables

Set environment variables to configure Local Bridge without modifying the config file:

# PowerShell (current session)
$env:LOCALBRIDGE_PASSWORD = "my-password"
$env:LOCALBRIDGE_PORT = "9000"

# PowerShell (persistent per-user)
[System.Environment]::SetEnvironmentVariable("LOCALBRIDGE_PASSWORD", "my-password", "User")
VariableTypeDescription
LOCALBRIDGE_PASSWORDstringPassword for protected file access. Avoids exposing the password in shell history.
LOCALBRIDGE_LICENSE_KEYstringLicense key for non-interactive activation in CI/CD environments.
LOCALBRIDGE_PORTnumberOverride the default local port (8080).
LOCALBRIDGE_RATE_LIMITnumberOverride the default per-IP rate limit (60 req/min).
LOCALBRIDGE_IGNOREstringComma-separated glob patterns to hide from file listings.
LOCALBRIDGE_NO_TUNNELbooleanSet to "1" or "true" to disable the public Cloudflare tunnel.
LOCALBRIDGE_BGbooleanSet to "1" or "true" to default to daemon background mode.

Files on Disk

Local Bridge stores all its data in a dedicated directory:

%USERPROFILE%\.localbridge\
FilePurpose
config.jsonGlobal configuration defaults (port, rate limit, ignore patterns).
license.jsonLicense activation data (license key, device token, email). Protected by file permissions.
registry.jsonRegistry of running background shares (PIDs, URLs, names).
logs/Log files for background share processes.
cloudflaredCached Cloudflared binary (auto-downloaded on first use).