Laravel Octane with FrankenPHP

2 min read Updated 14 hours ago

Laravel Octane with FrankenPHP

Laravel Octane supercharges your application's performance by serving your application using high-powered application servers. With Octane, your application boots once and stays in memory, serving requests at lightning speed.

FrankenPHP is the recommended server for Laravel Octane on Ploi Cloud, offering an easy setup with excellent performance.

What is Laravel Octane?

Octane dramatically improves your application's performance by:

  • Keeping your application in memory between requests
  • Eliminating the overhead of booting Laravel for each request
  • Providing significant speed improvements for typical Laravel applications

Setting up Octane with FrankenPHP

Follow these steps to deploy your Laravel application with Octane and FrankenPHP:

  1. Navigate to your application's Settings tab
  2. Find the PHP runtime section
  3. Select FrankenPHP (Octane) as the runtime
  4. Save your settings

Install Laravel Octane

Before deploying, install Laravel Octane in your application and commit the changes to your repository:

composer require laravel/octane
php artisan octane:install --server=frankenphp

Set the start command

Configure the start command in your application settings:

  1. Navigate to your application's Settings tab
  2. Find the Start command field
  3. Enter the following command:
php artisan octane:start --server=frankenphp --host=0.0.0.0 --port=8080

Deploy your application

After configuring the runtime, build commands, and start command, deploy your application. The deployment will:

  1. Build your application with Octane installed
  2. Start your application using the FrankenPHP server
  3. Keep your application running in memory for optimal performance