{"id":4469,"date":"2026-09-12T17:33:02","date_gmt":"2026-09-12T12:03:02","guid":{"rendered":"https:\/\/cpanelfree.com\/blog\/how-to-deploy-laravel-11-frankenphp-octane-vps\/"},"modified":"2026-09-17T11:23:39","modified_gmt":"2026-09-17T05:53:39","slug":"how-to-deploy-laravel-11-frankenphp-octane-vps","status":"publish","type":"post","link":"https:\/\/cpanelfree.com\/blog\/how-to-deploy-laravel-11-frankenphp-octane-vps\/","title":{"rendered":"How to Deploy Laravel 11 with Nginx, PHP 8.3 &amp; FrankenPHP \/ Octane on VPS"},"content":{"rendered":"<p>Laravel 11 is the gold standard for enterprise web application development in PHP. However, traditional PHP-FPM deployment architectures suffer from an inherent performance ceiling: on every single incoming HTTP request, the PHP runtime must boot the entire Laravel framework, register service providers, parse configuration arrays, and compile route trees before executing a single line of business logic.<\/p>\n<p>By deploying Laravel 11 with <strong>Laravel Octane<\/strong> powered by <strong>FrankenPHP<\/strong>\u2014a modern, Go-based application server written by K\u00e9vin Dunglas\u2014your application boots once and remains resident in system memory. Request handling transitions from hundreds of milliseconds to sub-5ms latencies, capable of sustaining <strong>5,000+ requests per second<\/strong> on a standard <a href=\"https:\/\/cpanelfree.com\/\">Linux VPS<\/a>. In this tutorial, you will learn how to configure FrankenPHP, optimize Octane worker pools, configure Redis queue daemons, and manage zero-downtime deployments.<\/p>\n<h2>1. Understanding the FrankenPHP Octane Architecture<\/h2>\n<p>FrankenPHP combines the Caddy web server core with an embedded C-based PHP SAPI:<\/p>\n<ul>\n<li><strong>Zero Boot Overhead:<\/strong> FrankenPHP boots Laravel once upon daemon startup. Subsequent HTTP requests execute inside existing memory threads, bypassing repetitive framework initialization.<\/li>\n<li><strong>Early Hints &amp; HTTP\/3:<\/strong> FrankenPHP provides out-of-the-box support for 103 Early Hints and native HTTP\/3 (QUIC) over UDP, pre-loading frontend assets before HTML bodies stream.<\/li>\n<li><strong>Automated Worker Recycling:<\/strong> Automatically recycles worker threads after a specified number of requests to prevent memory leaks in legacy packages.<\/li>\n<\/ul>\n<h2>2. Installing Prerequisites on Ubuntu 24.04 VPS<\/h2>\n<p>Install PHP 8.3 CLI, required extensions, Redis server, and Composer:<\/p>\n<pre><code># Install Ond\u0159ej Sur\u00fd PHP repository\nsudo add-apt-repository ppa:ondrej\/php -y\nsudo apt update &amp;&amp; sudo apt install -y php8.3-cli php8.3-common php8.3-mysql php8.3-redis     php8.3-xml php8.3-curl php8.3-mbstring php8.3-zip php8.3-bcmath php8.3-intl     redis-server git unzip supervisor\n\n# Install Composer globally\ncurl -sS https:\/\/getcomposer.org\/installer | php\nsudo mv composer.phar \/usr\/local\/bin\/composer<\/code><\/pre>\n<h2>3. Installing and Configuring Laravel Octane with FrankenPHP<\/h2>\n<p>Inside your Laravel 11 application directory, install Laravel Octane via Composer:<\/p>\n<pre><code>cd \/var\/www\/my-laravel-app\ncomposer require laravel\/octane\n\n# Run the Octane installation wizard and select 'frankenphp'\nphp artisan octane:install --server=frankenphp<\/code><\/pre>\n<p>Octane automatically downloads the optimized FrankenPHP binary directly into your project root. Configure your environment variables in <code>.env<\/code>:<\/p>\n<pre><code>OCTANE_SERVER=frankenphp\nOCTANE_HTTPS=true\nOCTANE_WORKERS=auto\nOCTANE_MAX_REQUESTS=1000<\/code><\/pre>\n<h2>4. Production systemd Service Configuration<\/h2>\n<p>Never run Octane manually inside a terminal screen. Create a dedicated systemd service unit at <code>\/etc\/systemd\/system\/laravel-octane.service<\/code> to manage background restarts and port binding:<\/p>\n<pre><code>[Unit]\nDescription=Laravel Octane FrankenPHP High-Performance Server\nAfter=network.target\n\n[Service]\nType=simple\nUser=www-data\nGroup=www-data\nWorkingDirectory=\/var\/www\/my-laravel-app\nExecStart=\/usr\/bin\/php8.3 \/var\/www\/my-laravel-app\/artisan octane:start --server=frankenphp --host=127.0.0.1 --port=8000 --workers=4 --max-requests=1000\nRestart=always\nRestartSec=5\nLimitNOFILE=65535\n\n[Install]\nWantedBy=multi-user.target<\/code><\/pre>\n<p>Reload systemd and start the Octane service:<\/p>\n<pre><code>sudo systemctl daemon-reload\nsudo systemctl enable --now laravel-octane\nsudo systemctl status laravel-octane<\/code><\/pre>\n<h2>5. Nginx Front-End Reverse Proxy Configuration<\/h2>\n<p>Place an Nginx reverse proxy in front of FrankenPHP to manage SSL termination, public static asset caching, and WebSocket connections:<\/p>\n<pre><code>server {\n    listen 443 ssl http2;\n    server_name api.yourdomain.com;\n\n    ssl_certificate \/etc\/letsencrypt\/live\/api.yourdomain.com\/fullchain.pem;\n    ssl_certificate_key \/etc\/letsencrypt\/live\/api.yourdomain.com\/privkey.pem;\n\n    root \/var\/www\/my-laravel-app\/public;\n    index index.php;\n\n    # Serve static assets directly from disk\n    location ~* \\.(jpg|jpeg|gif|png|css|js|ico|svg|woff|woff2)$ {\n        expires 30d;\n        access_log off;\n    }\n\n    # Proxy application requests to FrankenPHP Octane\n    location \/ {\n        proxy_pass http:\/\/127.0.0.1:8000;\n        proxy_http_version 1.1;\n        proxy_set_header Host $host;\n        proxy_set_header X-Real-IP $remote_addr;\n        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n        proxy_set_header X-Forwarded-Proto $scheme;\n        proxy_set_header Upgrade $http_upgrade;\n        proxy_set_header Connection \"Upgrade\";\n    }\n}<\/code><\/pre>\n<p>When deploying updates in production, execute <code>php artisan octane:reload<\/code> to trigger zero-downtime hot reloading of modified PHP classes without dropping active HTTP connections.<\/p>\n<h2>5. Configuring Laravel Octane Worker Watchers &amp; Memory Leak Mitigation<\/h2>\n<p>Because Laravel Octane keeps the entire framework bootstrapped in memory (unlike standard PHP-FPM which executes a fresh lifecycle per request), static variables and singleton service container bindings persist between HTTP requests. This architectural difference requires specific operational hygiene:<\/p>\n<ul>\n<li><strong>State Resetting Between Requests:<\/strong> Register service providers that maintain request-specific state in the <code>warm<\/code> array inside <code>config\/octane.php<\/code>. Octane automatically clears standard bindings (such as authenticated users, current session, and resolved request objects) before handling the next inbound connection.<\/li>\n<li><strong>Mitigating Memory Leaks with Max Requests:<\/strong> Even well-audited third-party Composer packages can introduce minor memory leaks. Safeguard your production server by enforcing an automatic worker recycling threshold:\n<pre><code>php artisan octane:start --server=frankenphp --workers=4 --max-requests=1000<\/code><\/pre>\n<p>    Once an individual FrankenPHP worker serves 1,000 requests, Octane seamlessly reboots that worker in the background while remaining workers continue serving traffic without latency spikes.<\/li>\n<li><strong>File Change Watcher in Staging:<\/strong> Use <code>--watch<\/code> during testing with Chokidar to automatically reload workers when PHP files are modified, matching standard FPM developer experience during staging rollouts.<\/li>\n<\/ul>\n<h2>6. Automated Horizon Queue Monitoring &amp; Redis Cluster Tuning<\/h2>\n<p>High-concurrency Laravel architectures offload transactional workloads to background workers managed by <strong>Laravel Horizon<\/strong>:<\/p>\n<pre><code># \/etc\/systemd\/system\/laravel-horizon.service\n[Unit]\nDescription=Laravel Horizon Process Supervisor\nAfter=network.target redis.service\n\n[Service]\nType=simple\nUser=www-data\nWorkingDirectory=\/var\/www\/laravel\nExecStart=\/usr\/bin\/php \/var\/www\/laravel\/artisan horizon\nExecReload=\/usr\/bin\/php \/var\/www\/laravel\/artisan horizon:terminate\nRestart=always\nRestartSec=3s\n\n[Install]\nWantedBy=multi-user.target<\/code><\/pre>\n<p>Horizon provides real-time dashboard analytics on queue wait times, job throughput, and failed job exceptions, ensuring rock-solid asynchronous execution.<\/p>\n<h2>7. Production OPCache &amp; JIT Compiler Tuning for Laravel 11<\/h2>\n<p>To squeeze maximum raw execution speed out of PHP 8.3 and FrankenPHP, fine-tuning the Zend OPcache and JIT (Just-In-Time) compiler parameters provides significant throughput improvements:<\/p>\n<ul>\n<li><strong>OPcache Memory Allocation:<\/strong> Inside your PHP configuration (<code>\/etc\/php\/8.3\/cli\/conf.d\/10-opcache.ini<\/code>), increase shared memory buffers to prevent cache evictions during heavy deployment cycles:\n<pre><code>opcache.enable=1\nopcache.enable_cli=1\nopcache.memory_consumption=256\nopcache.interned_strings_buffer=32\nopcache.max_accelerated_files=20000\nopcache.validate_timestamps=0\nopcache.save_comments=1<\/code><\/pre>\n<\/li>\n<li><strong>Configuring Tracing JIT:<\/strong> Set <code>opcache.jit=tracing<\/code> and <code>opcache.jit_buffer_size=128M<\/code>. Tracing JIT identifies frequently executed bytecode loops and compiles them directly into native machine code, speeding up CPU-bound operations such as JSON serialization, cryptographic hashing, and complex data formatting by up to 2.5x.<\/li>\n<li><strong>Validating Active JIT Status:<\/strong> Verify that JIT is engaged by running <code>php -r 'var_dump(opcache_get_status()[\"jit\"]);'<\/code> in the terminal.<\/li>\n<\/ul>\n<div style=\"background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);border: 1px solid #334155;border-radius: 12px;padding: 28px;margin: 36px 0;text-align: center\">\n<h3 style=\"color: #38bdf8;margin-top: 0;font-size: 22px\">Scale Laravel Applications on CpanelFree Cloud VPS<\/h3>\n<p style=\"color: #cbd5e1;font-size: 16px;line-height: 1.6;max-width: 680px;margin: 12px auto 24px auto\">Give Octane and Redis the dedicated compute power they deserve. Experience ultra-low latency, NVMe speeds, and high-concurrency stability with CpanelFree.<\/p>\n<p>    <a href=\"https:\/\/cpanelfree.com\/\" style=\"background: #38bdf8;color: #0f172a;font-weight: 700;padding: 12px 28px;border-radius: 6px;text-decoration: none;display: inline-block;font-size: 15px\">Discover CpanelFree High-Speed VPS &rarr;<\/a>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Laravel 11 is the gold standard for enterprise web application development in PHP. However, traditional PHP-FPM deployment architectures suffer from an inherent performance ceiling: on every single incoming HTTP request, the PHP runtime must boot the entire Laravel framework, register service providers, parse configuration arrays, and compile route trees before executing a single line of &#8230; <a title=\"How to Deploy Laravel 11 with Nginx, PHP 8.3 &amp; FrankenPHP \/ Octane on VPS\" class=\"read-more\" href=\"https:\/\/cpanelfree.com\/blog\/how-to-deploy-laravel-11-frankenphp-octane-vps\/\" aria-label=\"Read more about How to Deploy Laravel 11 with Nginx, PHP 8.3 &amp; FrankenPHP \/ Octane on VPS\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":4534,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-4469","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-web-hosting-news"],"_links":{"self":[{"href":"https:\/\/cpanelfree.com\/blog\/wp-json\/wp\/v2\/posts\/4469","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cpanelfree.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cpanelfree.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cpanelfree.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cpanelfree.com\/blog\/wp-json\/wp\/v2\/comments?post=4469"}],"version-history":[{"count":2,"href":"https:\/\/cpanelfree.com\/blog\/wp-json\/wp\/v2\/posts\/4469\/revisions"}],"predecessor-version":[{"id":4494,"href":"https:\/\/cpanelfree.com\/blog\/wp-json\/wp\/v2\/posts\/4469\/revisions\/4494"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/cpanelfree.com\/blog\/wp-json\/wp\/v2\/media\/4534"}],"wp:attachment":[{"href":"https:\/\/cpanelfree.com\/blog\/wp-json\/wp\/v2\/media?parent=4469"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cpanelfree.com\/blog\/wp-json\/wp\/v2\/categories?post=4469"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cpanelfree.com\/blog\/wp-json\/wp\/v2\/tags?post=4469"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}