Background Mode

Run controlled public shares as background daemons so you can close your terminal and keep a folder available. Manage multiple background shares by name.

Starting a Daemon

Add --bg to any share command to run it in the background:

# Basic background share
localbridge --bg ./my-project

# With a custom name and password
localbridge --bg --name staging --password "project-access" ./dist

# Temporary share that stops after 2 hours
localbridge --bg --name preview-share --expire 2h ./build

The CLI prints the public URL and process ID, then immediately returns control to your terminal.

Listing Running Shares

localbridge list

  NAME       PID    PORT   URL                                           STARTED
  staging       4092   8080   https://preview-edge.trycloudflare.com      2 hours ago
  preview-share 4150   8081   https://artifact-share.trycloudflare.com    30 min ago

localbridge list --json
[{"name":"staging","pid":4092,"port":8080,"url":"https://...","started_at":"..."}]

Use --json for machine-readable output in scripts and automation.

Stopping Shares

# Stop a specific share
localbridge stop staging

# Stop all running shares
localbridge stop all

When a daemon is stopped, the local file server and the tunnel helper are terminated, and the entry is removed from the registry.

How It Works

Local Bridge stores all running background shares in an internal registry. Each entry contains:

  • name - Custom name or auto-generated identifier
  • pid - OS process ID of the background share process
  • port - Local port the share is running on
  • url - Public share URL, when tunnel creation succeeds
  • started_at - Timestamp of when the daemon was started
  • password_enabled - Whether password protection is active

Cross-Platform Support

Background mode works natively on Windows, macOS, and Linux. The CLI uses platform-appropriate mechanisms to detach processes in the background. No extra dependencies like tmux, screen, or nohup are required.