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 PriorityCLI 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")
$env:LOCALBRIDGE_PASSWORD = "my-password"
$env:LOCALBRIDGE_PORT = "9000"
# PowerShell (persistent per-user)
[System.Environment]::SetEnvironmentVariable("LOCALBRIDGE_PASSWORD", "my-password", "User")
| Variable | Type | Description |
|---|---|---|
| LOCALBRIDGE_PASSWORD | string | Password for protected file access. Avoids exposing the password in shell history. |
| LOCALBRIDGE_LICENSE_KEY | string | License key for non-interactive activation in CI/CD environments. |
| LOCALBRIDGE_PORT | number | Override the default local port (8080). |
| LOCALBRIDGE_RATE_LIMIT | number | Override the default per-IP rate limit (60 req/min). |
| LOCALBRIDGE_IGNORE | string | Comma-separated glob patterns to hide from file listings. |
| LOCALBRIDGE_NO_TUNNEL | boolean | Set to "1" or "true" to disable the public Cloudflare tunnel. |
| LOCALBRIDGE_BG | boolean | Set 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\
| File | Purpose |
|---|---|
| config.json | Global configuration defaults (port, rate limit, ignore patterns). |
| license.json | License activation data (license key, device token, email). Protected by file permissions. |
| registry.json | Registry of running background shares (PIDs, URLs, names). |
| logs/ | Log files for background share processes. |
| cloudflared | Cached Cloudflared binary (auto-downloaded on first use). |