Inertia SSR
Inertia SSR
Server-side rendering (SSR) improves the initial load time and SEO of your Inertia.js applications by rendering pages on the server before sending them to the browser.
Prerequisites
Important: You must select a Node.js version in your application settings before adding the Inertia SSR service. SSR requires Node.js to render your Vue, React, or Svelte components on the server.
To configure Node.js:
- Navigate to your application's Settings tab
- Find the Node.js version section
- Select a Node.js version (20, 22, or 24)
- Save your settings and deploy your application
Adding Inertia SSR
- Go to your application's Services section
- Click Add service
- Select Custom service
- Select the Rendering category
- Choose Inertia SSR
- Optionally customize the SSR command
- Click Create service
- Deploy your application
How it works
The Inertia SSR service runs as a separate process alongside your main application. When a request comes in:
- Your Laravel application receives the request
- Instead of sending an empty HTML shell, Laravel calls the SSR server
- The SSR server renders your frontend component to HTML
- The fully rendered HTML is sent to the browser
- The browser hydrates the page, making it interactive
Environment variables
When you add the Inertia SSR service, the following environment variables are automatically configured:
INERTIA_SSR_ENABLED- Set totrueto enable SSRINERTIA_SSR_URL- The URL where the SSR server is running (http://127.0.0.1:13714)
These variables tell your Laravel application to use server-side rendering.
Custom SSR command
By default, the service runs:
php artisan inertia:start-ssr
You can customize this when adding the service if your application uses a different command.