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

# Install command for managed browser runtimes

> Add a managed browser runtime to the Extension.js cache for deterministic builds. Supports Chrome for Testing, Chromium, Firefox, and Edge.

Use `install` to add a managed browser runtime into the Extension.js cache.

This is most useful when you want a consistent browser binary for `dev`, `build`, `start`, or `preview`. It supports Chrome for Testing, Chromium, Firefox, and Edge.

## When to use `install`

* You need a consistent, repeatable browser binary for continuous integration (CI), automation, or team-consistent local runs.
* You want Chrome for Testing instead of relying on whatever Chrome version your system has installed.
* You are setting up cross-browser testing with managed Firefox or Edge runtimes.

## Canonical usage

For a single browser, use the positional form:

<CodeGroup>
  ```bash npm theme={null}
  extension install <browser>
  ```

  ```bash pnpm theme={null}
  extension install <browser>
  ```

  ```bash yarn theme={null}
  extension install <browser>
  ```

  ```bash bun theme={null}
  extension install <browser>
  ```

  ```bash deno theme={null}
  extension install <browser>
  ```
</CodeGroup>

Use `--browser` only when you need multiple targets, browser families, or `all`.

## Install command capabilities

| Capability            | What it gives you                                                          |
| --------------------- | -------------------------------------------------------------------------- |
| Managed browser cache | Stable install location under the Extension.js browser cache               |
| Repeatable runtime    | Consistent binaries for repeatable local runs and automation               |
| Cross-browser setup   | One command flow for Chrome, Chromium, Edge, and Firefox                   |
| Path discovery        | `--where` reveals the resolved cache root or browser-specific install path |

## Usage

<CodeGroup>
  ```bash npm theme={null}
  extension install [browser-name] [options]
  ```

  ```bash pnpm theme={null}
  extension install [browser-name] [options]
  ```

  ```bash yarn theme={null}
  extension install [browser-name] [options]
  ```

  ```bash bun theme={null}
  extension install [browser-name] [options]
  ```

  ```bash deno theme={null}
  extension install [browser-name] [options]
  ```
</CodeGroup>

## Arguments and flags

| Flag / argument                                                                                | What it does                                                                       | Default    |
| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------- |
| `[browser-name]`                                                                               | Install a single browser target such as `chrome`, `chromium`, `edge`, or `firefox` | `chromium` |
| `--browser <chrome\|chromium\|edge\|firefox\|chromium-based\|gecko-based\|firefox-based\|all>` | Override the positional browser name and support multi-target installs             | unset      |
| `--where`                                                                                      | Print the resolved managed cache root, or browser-specific install path            | disabled   |

## Examples

### Install Chrome for Testing

```bash theme={null}
extension install chrome
```

### Install multiple targets in one command

```bash theme={null}
extension install --browser chrome,firefox
```

### Show the managed install path for Chrome

```bash theme={null}
extension install chrome --where
```

## Cache locations

By default, Extension.js stores managed browsers in a stable per-user cache:

* macOS: `~/Library/Caches/extension.js/browsers`
* Linux: `~/.cache/extension.js/browsers` or `$XDG_CACHE_HOME/extension.js/browsers`
* Windows: `%LOCALAPPDATA%\extension.js\browsers`

You can override the cache root with `EXT_BROWSERS_CACHE_DIR`.

## Best practices

* **Use `install` in CI** to pin a consistent browser binary instead of relying on whatever the runner provides.
* **Prefer `chrome`** over `chromium` for Chrome for Testing: it matches stable Chrome behavior more closely.
* **Use `--where`** to verify cache paths before scripting automation around managed browsers.
* `install` only manages browsers inside the Extension.js cache. It does not modify system browser installs.

## Behavior notes

* `chrome` installs Chrome for Testing rather than relying on the system Google Chrome app.
* `edge` may require a privileged interactive session on Linux.

## Next steps

* Remove managed browsers with [`uninstall`](/docs/commands/uninstall).
* Use managed browsers with [`dev`](/docs/commands/dev) and [`start`](/docs/commands/start).
* Learn about [Running other browsers](/docs/browsers/running-other-browsers) with custom binary paths.
