Installation
Requirements
Section titled “Requirements”Before installing Inertia, verify that your environment meets these requirements:
| Requirement | Version |
|---|---|
| PHP | >= 8.4 |
| ProcessWire | >= 3.0.271 |
| Required Module | Vite (trk/processwire-vite) |
| Node.js or Bun | Node >= 20 or Bun >= 1.1 for Vite builds and optional SSR |
| Optional CLI | trk/processwire-console (vendor/bin/wire) for inertia:* commands |
Installation Steps
Section titled “Installation Steps”Ensure Vite is installed first so ProcessWire can resolve the dependency cleanly, then install Inertia:
-
Require the package from your project root:
Terminal window composer require trk/processwire-inertia -
Refresh and install
Inertia:Terminal window php vendor/bin/wire module:refreshphp vendor/bin/wire module:install Inertia
- Log in as a superuser and navigate to Modules -> New.
- Use Add Module from Directory (enter
Inertia), Add Module from URL, or Add Module from Upload (ZIP archive). - Click Modules -> Refresh, locate Inertia under the Site tab, and click Install.
- Download and extract the release archive into
site/modules/Inertia/. - Open Modules -> Refresh in the ProcessWire admin (or run
php vendor/bin/wire module:refresh). - Click Install next to Inertia under Modules -> Site.
Scaffold Your Frontend Stack (Optional)
Section titled “Scaffold Your Frontend Stack (Optional)”Run inertia:install and pick your preferred frontend stack (vue, react, or svelte), then start Vite (npm run dev):
php vendor/bin/wire inertia:install --stack=react --template=inertiaphp vendor/bin/wire inertia:install --stack=vue --template=inertiaphp vendor/bin/wire inertia:install --stack=svelte --template=inertiaPass --dry-run first if you want to preview every file and configuration change without writing to disk. Install the Inertia v3 client adapter for your chosen framework (@inertiajs/react, @inertiajs/vue3, or @inertiajs/svelte) and start your Vite dev server with npm run dev.
Files Created by inertia:install
Section titled “Files Created by inertia:install”Running inertia:install publishes the starter files inside site/ without overwriting existing files unless you pass --force:
Directorysite/
Directoryclasses/
- DefaultPage.php
- InertiaPage.php
Directorytemplates/
- _inertia.php
- inertia.php
Directoryassets/
Directoryjs/
- inertia.ts
DirectoryPages/
- Home.tsx
Directorytypes/
- inertia.d.ts