Laravel Octane on Heroku

Laravel Octane is a new way of running Laravel applications at super high speeds:

“Laravel Octane supercharges your application’s performance by serving your application using high-powered application servers, including Swoole and RoadRunner. Octane boots your application once, keeps it in memory, and then feeds it requests at supersonic speeds.”

Swoole has a number of benefits over RoadRunner including Concurrent Tasks, Ticks / Intervals and The Octane Cache so we’ll concentrate on getting that up and running on Heroku.

These steps assume you have the following:

  • Laravel Installer
  • Heroku’s CLI installed and authenticated

Start off, by creating a new Laravel instance with Octane installed:

Create a new Heroku app:

Let’s add a PHP Custom Platform Repo kindly provided by cachewerk/heroku-php-extensions which will allow us to install the Swoole extension

Then let’s tell Heroku how to run our application via Octane, add the following Procfile

Commit our files and push:

Your Laravel app is now running via Heroku on Octane!

For more tips, check out my Ultimate Guide to running Laravel on Heroku.

Solutions Architect. Technical Lead. Full-stack Developer.