> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bead.run/llms.txt
> Use this file to discover all available pages before exploring further.

# Remote development services

> Start remote development services, forward their ports, and resync local edits with a new dev invocation.

Declare remote development services in `bead.toml`, then run a service with a foreground localhost forward.

## Configure a service

```toml theme={null}
[prepare]
run = "npm ci"
inputs = ["package.json", "package-lock.json"]

[service.web]
run = "npm run dev"
port = 3000
```

Use a template with Node and npm installed. Keep your server on the declared port.

## Start it

```bash theme={null}
bead worktree up
bead worktree prepare
bead worktree dev web
```

The CLI syncs source once, starts the service and forwards HTTP and WebSocket traffic on `127.0.0.1`. Follow the localhost address printed by the command.

A dev invocation has a 24-hour timeout. Restart it when you need a longer session.

To select another local port, or request an allocated port:

```bash theme={null}
bead worktree dev web --local-port 8080
bead worktree dev web --local-port 0
```

## Apply local edits

Press Ctrl-C, then run `bead worktree dev web` again. Each invocation syncs once; local edits require a new invocation.

Other managed commands report busy while dev owns the machine. If the CLI disconnects, use `bead worktree stop` to stop the service. Active services keep compute billed.

See [environment files](https://docs.bead.run/worktrees/environment.md) for service-specific values and [share a preview](https://docs.bead.run/worktrees/sharing.md) for expiring access links.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.