inertia start
Getting Started

Deployment

Deploying your application to production.

Since Inertia Start is a standard Laravel application, you can deploy it to any hosting provider that supports PHP and Laravel. Review the Laravel Deployment documentation for best practices.

General Guidelines

When deploying to production, remember to:

  1. Optimize autoloader: composer install --optimize-autoloader --no-dev
  2. Cache configuration: php artisan config:cache
  3. Cache events: php artisan event:cache
  4. Cache routes: php artisan route:cache
  5. Cache views: php artisan view:cache
  6. Build assets: npm run build

Laravel Cloud

Laravel Cloud is the easiest, fastest and all-in-one platform to deploy and scale Laravel applications.

Laravel Forge

If you want to use your own server but don't want to deal with the pain of server management, you can use Laravel Forge.

Ploi.io

Similar to Forge, Ploi.io offers a robust alternative for server management.

Cloudflare proxy

Inertia Start resolves the visitor IP address and country from the incoming request (Helpers::getClientIp() and Helpers::getRequestContext()). These values are used for rate limiting, activity logs, and login notifications, and they are only reliable when the proxies in front of your application are trusted.

On Laravel Cloud

There is nothing to configure: Laravel Cloud manages its own proxy chain and resolves trusted proxies for you, and the framework resolves the client IP address and protocol from the standard X-Forwarded-* headers.

Leave I_S_BEHIND_CLOUDFLARE_PROXY unset (or false) there (it will be ignored anyway).

On other hosting providers

When you serve your application behind your own Cloudflare DNS proxy, enable Cloudflare support:

.env
I_S_BEHIND_CLOUDFLARE_PROXY=true

App\Http\Middleware\TrustProxies then adds the current Cloudflare IP ranges to Laravel's trusted proxies, and the CF-Connecting-IP and CF-IPCountry headers are honored only for requests coming from a trusted proxy. Requests hitting your origin directly (bypassing Cloudflare) fall back to the connecting IP address and carry no country.

The IP ranges are fetched from the Cloudflare API and cached, then refreshed every six hours by the cloudflare:proxies command scheduled in routes/console.php. Make sure the Laravel scheduler is running on your server. You can also refresh them manually at any time:

php artisan cloudflare:proxies

Country detection

The country is only available when IP geolocation is enabled in your Cloudflare dashboard, under [ Website ] > Network. Cloudflare then sends it in the CF-IPCountry header.

On this page