Server-side rendering with Inertia SSR

2 min read Updated 1 day ago

Server-side rendering with Inertia SSR

Inertia SSR renders your Inertia.js views on the server before sending them to the browser. Instead of shipping a mostly empty page and waiting for JavaScript to fill it in, the user receives fully rendered HTML on the first load. That means a faster first paint, especially on slower connections, and real content for search engines to index instead of an empty shell.

It is a small sidecar: it runs alongside your application in its own container, using your application's image. Because it shares your image, it is always in sync with your application's code and dependencies. There is nothing separate to keep updated.

Where to find it

Inertia SSR is only offered to Laravel and Statamic applications. To add it:

  1. Go to your application and open the Custom services card.
  2. Select Inertia SSR and choose Create service. It uses your application's image, so there is no version to pick.

Because it is a sidecar that mirrors your application, the panel keeps some controls hidden. Its status is not shown, and you cannot edit its resources, open debug access, or restart it on its own. You do still have its logs, which is where you go if you need to see why it is not starting.

Service configuration

SSR_COMMAND is the command that starts the SSR server inside the container, under Service configuration. You will not usually need to touch it. The default is:

php artisan inertia:start-ssr

Environment variables

Adding the service injects a couple of variables into your application so it knows the SSR server is there:

  • INERTIA_SSR_ENABLED is set to true when the sidecar is running.
  • INERTIA_SSR_URL points at the SSR server, at http://127.0.0.1:13714.

Your application reads these to decide whether to send Inertia requests to the SSR server. The service listens on port 13714 internally, inside the same application, so nothing needs to be exposed.

Advanced settings

If you ever want to run a custom start command, set SSR_COMMAND under Advanced settings and save. Updating the configuration takes effect on the next deployment. Logs remain available while it is running, so confirm the SSR server started cleanly before you rely on it.