Requirements
| Requirement | When you need it |
|---|---|
| macOS and Node.js 22.23 or later | Native commands, automatic owners, and managed databases. |
ps and lsof | Native application commands use the macOS tools for process and listener checks. |
| macOS 13 or later | Optional automatic keystore unlock through Keychain. |
| An unlocked keystore | Stored secrets and managed database credentials. See Secrets. |
| A local Docker Engine | Managed PostgreSQL and Redis only. See Databases. |
| Your application's dependencies | Install these before startup, or declare setup jobs. |
Password-only keystore access also has Linux test coverage. Windows remains unverified. This does not establish cross-platform preview support.
The published npm package includes the native helper. Installation needs no compiler or GitHub access.
Install the CLI
Run these commands in your terminal:
npm install -g previewhost
previewhost --version
previewhost --helpChoose First preview with the CLI for terminal use or MCP setup for a coding agent. If your editor cannot find the executable, follow the PATH troubleshooting steps.
Install in a project
For library imports or a project-specific CLI, run this from the application directory:
npm install previewhost
./node_modules/.bin/previewhost --versionUse ./node_modules/.bin/previewhost instead of previewhost in the guides that follow.
See the library guide for a complete program.
Update an installation
Before updating an existing installation, follow the reset instructions for runtime storage and managed data.
For a global installation:
npm install -g previewhost
previewhost --versionExisting project owners keep their loaded version. When you can stop their previews, run this from each affected project:
previewhost shutdownThen start the preview again. Managed data and stored values remain, but owner shutdown ends secret access approvals. Each restarted owner needs keystore unlock unless automatic unlock is available. See secret access troubleshooting.