---
title: fastly compute serve
summary: Build and run a Compute package locally
url: https://www.fastly.com/documentation/reference/cli/compute/serve
---

Build and run a Compute package locally

## Flags

| Flag | Description | Required | Default |
|------|-------------|----------|----------|
| `--addr` | The IPv4 address and port to listen on | No | 127.0.0.1:7676 |
| `--dir` | Project directory to build (default: current directory) | No | - |
| `--env` | The manifest environment config to use (e.g. 'stage' will attempt to read 'fastly.stage.toml') | No | - |
| `--file` | The Wasm file to run (causes build process to be skipped) | No | - |
| `--include-source` | Include source code in built package | No | - |
| `--language` | Language type | No | - |
| `--metadata-disable` | Disable Wasm binary metadata annotations | No | - |
| `--metadata-filter-envvars` | Redact specified environment variables from [scripts.env_vars] using comma-separated list | No | - |
| `--metadata-show` | Inspect the Wasm binary metadata | No | - |
| `--package-name` | Package name | No | - |
| `--experimental-enable-pushpin` | Enable experimental Pushpin support for local testing of Fanout | No | - |
| `--pushpin-path` | The path to a user installed version of the Pushpin runner binary | No | - |
| `--pushpin-proxy-port` | The port to run the Pushpin runner on. Overrides 'local_server.pushpin.proxy_port' from 'fastly.toml', and if not specified there, defaults to 7677. | No | - |
| `--pushpin-publish-port` | The port to run the Pushpin publish handler on. Overrides 'local_server.pushpin.publish_port' from 'fastly.toml', and if not specified there, defaults to 5561. | No | - |
| `--profile-guest` | Profile the Wasm guest under Viceroy (requires Viceroy 0.9.1 or higher). View profiles at https://profiler.firefox.com/. | No | - |
| `--profile-guest-dir` | The directory where the per-request profiles are saved to. Defaults to guest-profiles. | No | - |
| `--skip-build` | Skip the build step | No | - |
| `--timeout` | Timeout, in seconds, for the build compilation step | No | - |
| `--viceroy-args` | Additional arguments to pass to the Viceroy binary, separated by space | No | - |
| `--viceroy-check` | Force the CLI to check for a newer version of the Viceroy binary | No | - |
| `--viceroy-path` | The path to a user installed version of the Viceroy binary | No | - |
| `--watch` | Watch for file changes, then rebuild project and restart local server | No | - |
| `--watch-dir` | The directory to watch files from (can be relative or absolute). Defaults to current directory. | No | - |

## Global options

| Flag | Description | Required | Default |
|------|-------------|----------|----------|
| `--help` | Show context-sensitive help. | No | - |
| `--accept-defaults` | Accept default options for all interactive prompts apart from Yes/No confirmations | No | - |
| `--auto-yes` | Answer yes automatically to all Yes/No confirmations. This may suppress security warnings | No | - |
| `--debug-mode` | Print API request and response details (NOTE: can disrupt the normal CLI flow output formatting) | No | - |
| `--non-interactive` | Do not prompt for user input - suitable for CI processes. Equivalent to --accept-defaults and --auto-yes | No | - |
| `--quiet` | Silence all output except direct command output. This won't prevent interactive prompts (see: --accept-defaults, --auto-yes, --non-interactive) | No | - |
| `--token` | Fastly API token, or name of a stored auth token (use 'default' for the default token). Falls back to FASTLY_API_TOKEN env var | No | - |
| `--verbose` | Verbose logging | No | - |

## Examples

### Build and run a Compute package locally

The `compute serve` command wraps the existing build command. All flags present on the <kbd>fastly compute build</kbd> command are available to use here. Additionally, the `--watch` command enables 'hot reloading' of your project code whenever changes are made to the source code.

```bash
fastly compute serve --watch
```

