Docs cipi.yml Web panel API MCP Guides Compare GitHub Telegram channel
  1. Docs
  2. Apps
  3. Laravel Octane

Laravel Octane

Run apps on FrankenPHP, convert existing apps and pin builds.

Apps

Laravel Octane keeps your app booted in memory and serves requests with FrankenPHP. Typical result: much lower response times for the same hardware. Octane and PHP-FPM apps run side by side on one server.

Laravel Octane
$ cipi app create shop --octane
$ cipi app convert legacy --to=octane
$ cipi frankenphp upgrade --all

Create or convert#

Your repository needs laravel/octane, installed with php artisan octane:install --server=frankenphp. Octane starts after the first deploy.

bash
cipi app create --user=myapp --domain=myapp.com \
    --repository=git@github.com:you/myapp.git --octane
cipi app convert myapp --to=octane     # an existing FPM app
cipi app convert myapp --to=fpm        # and back
cipi app limits myapp --octane-workers=4

What Cipi sets up#

Step 1 of 4Nginx

Nginx terminates HTTPS and serves files in public/ directly (CSS, JS, images). Everything else goes to Octane.

PieceSetting
Nginxproxy_pass to the app's local port; static files from current/public; no PHP-FPM pool
ProcessSupervisor program myapp-octane, next to the queue workers
DeploysThe pinned FrankenPHP binary is linked into each release, then Octane reloads
.envOCTANE_SERVER=frankenphp, OCTANE_HTTPS=true

Converting rewrites the vhost, process, deploy recipe and .env, and keeps the certificate. It turns JIT off; enable it again if you use it.

FrankenPHP builds, pinned per app#

The PHP an Octane app runs is the one compiled into its FrankenPHP binary. Cipi keeps those binaries in /opt/cipi-frankenphp/builds/ (read-only to apps) and pins one per app. A deploy never downloads a new binary, so PHP changes only when you decide.

bash
cipi frankenphp                      # each app's build and PHP, patched or not
cipi frankenphp upgrade myapp        # newest build on the same PHP minor
cipi frankenphp upgrade --all
cipi frankenphp use myapp            # pin a specific build
cipi frankenphp import ./frankenphp  # a build you compiled (other PHP minor)
cipi frankenphp adopt myapp          # pin the binary Octane downloaded
cipi frankenphp prune                # remove unused builds
RuleWhy it keeps you stable
Upgrades stay on the app's PHP minor and FrankenPHP majorNo surprise PHP 8.5 → 8.6 jump
Octane must answer after an upgrade, or the previous build returnsA bad build never stays live
A deploy that needs a newer FrankenPHP stops before migrationsThe live release is untouched; run cipi frankenphp upgrade
Apps on different PHP minors use different builds8.5 and 8.6 coexist
Nightly patches via cipi autoupdate (component frankenphp)Security fixes without manual work

To move an app to a new PHP minor: cipi app edit myapp --php=8.6, then cipi frankenphp upgrade myapp.

Octane serves HTTP only. Run long jobs on queue workers or Horizon and WebSockets on Reverb.

Common problems#

ProblemFix
502 after convertingOctane not running: cipi worker list myapp, logs with --type=worker
Users see others' dataA state leak in long-lived objects: see the Octane guide

Questions#

QuestionAnswer
Can I go back to PHP-FPM?Yes: cipi app convert myapp --to=fpm.
How many workers?Start with one per CPU core: cipi app limits myapp --octane-workers=4.