RunCloud Help

Jul 22, 2022

How To Set Up A Laravel Octane Server

Laravel Octane is a wrapper behind the high-performance servers, Swoole (PHP extension) and RoadRunner (application server, load-balancer and process manager). It is designed to allow developers to deliver better performance with a range of new features.

Running Laravel Octane on servers managed with RunCloud couldn't be easier.

Although there currently isn't a 1-click installation process for Laravel, RunCloud does support it out of the box and installing it is quite easy.


Instructions to set up a Laravel Octane server




Step 1: Create a Git-based Web Application



  • In this case, we've deployed an application called "app-koolman":




Step 2 : Webhook

  • Once deployed, get your Webhook URL from your web application's Git settings, as shown above, copy it and head over to GitHub.

  • Head over to your repository, Settings > Webhooks and drop in the webhook URL.



Step 3 : Next, you'll need to SSH into your server.

  • After that, navigate to the folder of the web application we deployed earlier.



Step 4 : Install Composer

  • Install composer by running the following command: 
composer install




Step 5 : Create your .env file

  • Create a .env file by running the following command : 
cp.env.example .env




Step 6 : Generate Your Application Key

  • Generate your application key by running the following command : 
php artisan key:generate




Step 7 : Change Your Web Application Type to Laravel

  • Head back over to your RunCloud dashboard, and navigate to your web application settings to change the web application type from Custom to Laravel, as shown below :
     



Step 8 : Add Laravel Octane as Project Dependency (using composer require)

  • To start using the newly installed Laravel Octane package, run the following command : 
composer require laravel/octane


Note : The require command adds new packages to the composer.json file from the current directory. If no file exists, one will be created on the fly. After adding or changing the requirements, the modified requirements will be installed or updated.




Step 9 : Complete Your Laravel Octane Setup

  • Now that the package is installed, run the following command :
php artisan octane:install


Note : This will perform the required configuration for us (including generating the Octane config file).


  • When prompted, enter to use swoole: 




Step 10 : Head to Your Laravel Octane Settings in RunCloud

  • Last but certainly not least, now when you head back to your web application in your RunCloud dashboard, you'll see the new Octane settings tab.

  • Navigate there and click Let's get started.


 

 


  • And that's it - time to start building!




In the case of having mixed-content issue, do set your .env with the command below to fix this .


OCTANE_HTTPS=true