Installation & Setup

Getting started with InertJS is incredibly fast. Because we don't use bundlers like Webpack or Vite, you don't need to wait for complex dependencies to install or for the initial build step to complete.

Quick Start

To scaffold a new InertJS project, run the following command in your terminal:

$ npx create-inert@latest my-app

Once the project is created, navigate into the directory, install dependencies, and start the lightning-fast dev server:

$ cd my-app $ npm install $ npm run dev

CLI Commands & Flags

The InertJS CLI comes with powerful commands for development and production:

  • npx inert dev - Starts the development server with hot reloading and Lens debugging.
  • npx inert serve - Starts the production server (disables debugging and optimizations).
  • npx inert build - Zero-build indicator (no build step is actually needed!).

Both dev and serve support network flags to customize the binding:

$ npx inert serve --port 8080 --host 0.0.0.0

Project Structure

InertJS enforces a simple, predictable directory structure:

  • src/routes/ - Contains all your file-based routing components.
  • src/routes/shell.js - The global layout wrapper (HTML head, body, header, footer).
  • src/routes/view.js - The root home page.
  • public/ - Static assets like images and fonts.
  • .vault.key - The local master key for your Vault secrets (NEVER commit this!).

That's it. You are now ready to build!

🚀 Currently in Public Beta (v1.0.0-beta.4) - Help us improve by reporting issues on GitHub.