{"id":51995,"date":"2026-06-22T12:30:00","date_gmt":"2026-06-22T17:30:00","guid":{"rendered":"https:\/\/www.rosehosting.com\/blog\/?p=51995"},"modified":"2026-05-24T11:15:16","modified_gmt":"2026-05-24T16:15:16","slug":"how-to-set-up-a-high-performance-lemp-stack-on-ubuntu-26-04-in-2026-nginx-php-8-4-mariadb-11-redis","status":"publish","type":"post","link":"https:\/\/www.rosehosting.com\/blog\/how-to-set-up-a-high-performance-lemp-stack-on-ubuntu-26-04-in-2026-nginx-php-8-4-mariadb-11-redis\/","title":{"rendered":"How to Set Up a High-Performance LEMP Stack on Ubuntu 26.04 in 2026 (NGINX + PHP 8.4 + MariaDB 11 + Redis)"},"content":{"rendered":"<div id=\"bsf_rt_marker\"><\/div>\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2026\/06\/how-to-set-up-a-high-performance-lemp-stack-on-ubuntu-26.04-in-2026.webp\" alt=\"How to Set Up a High-Performance LEMP Stack on Ubuntu 26.04 in 2026 (Nginx + PHP 8.4 + MariaDB 11 + Redis)\" class=\"wp-image-52031\" srcset=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2026\/06\/how-to-set-up-a-high-performance-lemp-stack-on-ubuntu-26.04-in-2026.webp 1024w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2026\/06\/how-to-set-up-a-high-performance-lemp-stack-on-ubuntu-26.04-in-2026-300x169.webp 300w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2026\/06\/how-to-set-up-a-high-performance-lemp-stack-on-ubuntu-26.04-in-2026-150x84.webp 150w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2026\/06\/how-to-set-up-a-high-performance-lemp-stack-on-ubuntu-26.04-in-2026-768x432.webp 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In this tutorial, we are going to show you how to set up a high-performance LEMP stack on Ubuntu 26.04. LEMP is a shortcut for <strong>Linux, NGINX, MariaDB (or MySQL), and PHP<\/strong>. This stack has powered millions of fast, modern websites and web applications. The version we are going to install in this tutorial is the latest and greatest combination available in 2026: NGINX as the web server, <strong>PHP 8.4<\/strong> with the FPM process manager, <strong>MariaDB 11.8 LTS<\/strong> as the database engine, and <strong>Redis <\/strong>as an in-memory cache layer for sessions and object caching.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">NGINX is well known for its event-driven architecture, low memory footprint, and ability to handle thousands of concurrent connections without breaking a sweat \u2013 which makes it the perfect web server for high-traffic dynamic websites. Pair it with PHP 8.4\u2019s JIT compiler, MariaDB 11.8\u2019s improved query optimizer, and Redis to offload sessions and queries from the database, and you get a stack that can comfortably serve WordPress, Laravel, Magento, Nextcloud, or any other PHP-based application at scale<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Installing a high-performance LEMP stack on Ubuntu 26.04 is straightforward and should take 15 to 20 minutes. Let\u2019s get started!<\/p>\n\n\n\n<!--more-->\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_85 counter-hierarchy ez-toc-counter ez-toc-transparent ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-6a3a34bd95e19\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"ez-toc-cssicon\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-6a3a34bd95e19\"  aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-set-up-a-high-performance-lemp-stack-on-ubuntu-26-04-in-2026-nginx-php-8-4-mariadb-11-redis\/#Prerequisites\" >Prerequisites<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-set-up-a-high-performance-lemp-stack-on-ubuntu-26-04-in-2026-nginx-php-8-4-mariadb-11-redis\/#Step-1-Update-the-System\" >Step 1. Update the System<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-set-up-a-high-performance-lemp-stack-on-ubuntu-26-04-in-2026-nginx-php-8-4-mariadb-11-redis\/#Step-2-Install-NGINX\" >Step 2. Install NGINX<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-set-up-a-high-performance-lemp-stack-on-ubuntu-26-04-in-2026-nginx-php-8-4-mariadb-11-redis\/#Step-3-Install-MariaDB-118\" >Step 3. Install MariaDB 11.8<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-set-up-a-high-performance-lemp-stack-on-ubuntu-26-04-in-2026-nginx-php-8-4-mariadb-11-redis\/#Step-4-Install-PHP-84-with-PHP-FPM\" >Step 4. Install PHP 8.4 with PHP-FPM<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-set-up-a-high-performance-lemp-stack-on-ubuntu-26-04-in-2026-nginx-php-8-4-mariadb-11-redis\/#Step-5-Install-and-Configure-Redis\" >Step 5. Install and Configure Redis<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-set-up-a-high-performance-lemp-stack-on-ubuntu-26-04-in-2026-nginx-php-8-4-mariadb-11-redis\/#Step-6-Tune-PHP-FPM-for-High-Performance\" >Step 6. Tune PHP-FPM for High Performance<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-set-up-a-high-performance-lemp-stack-on-ubuntu-26-04-in-2026-nginx-php-8-4-mariadb-11-redis\/#Step-7-Configure-NGINX-with-PHP-FPM\" >Step 7. Configure NGINX with PHP-FPM<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-set-up-a-high-performance-lemp-stack-on-ubuntu-26-04-in-2026-nginx-php-8-4-mariadb-11-redis\/#Step-8-Use-Redis-as-the-PHP-Session-Handler\" >Step 8. Use Redis as the PHP Session Handler<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-set-up-a-high-performance-lemp-stack-on-ubuntu-26-04-in-2026-nginx-php-8-4-mariadb-11-redis\/#Step-9-Optional-Performance-Tweaks\" >Step 9. Optional Performance Tweaks<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-set-up-a-high-performance-lemp-stack-on-ubuntu-26-04-in-2026-nginx-php-8-4-mariadb-11-redis\/#Step-10-Add-FastCGI-caching-in-NGINX\" >Step 10. Add FastCGI caching in NGINX<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-set-up-a-high-performance-lemp-stack-on-ubuntu-26-04-in-2026-nginx-php-8-4-mariadb-11-redis\/#Step-11-Tune-MariaDB-for-your-workload\" >Step 11. Tune MariaDB for your workload<\/a><\/li><\/ul><\/nav><\/div>\n<h2 id=\"h-prerequisites\" class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Prerequisites\"><\/span><strong>Prerequisites<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">&#8211; An <a href=\"https:\/\/www.rosehosting.com\/ubuntu-hosting\/\" target=\"_blank\" rel=\"noreferrer noopener\">Ubuntu 26.04 server<\/a> (codenamed <em>Resolute Raccoon<\/em>)<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&#8211; User privileges: root, or a non-root user with sudo privileges<\/p>\n\n\n\n<h2 id=\"h-step-1-update-the-system\" class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Step-1-Update-the-System\"><\/span><strong>Step 1. Update the System<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Before we start with any installation, we will update the system packages to their latest versions:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&nbsp;# apt update -y &amp;&amp; sudo apt upgrade -y<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Once finished, it is a good idea to reboot if a new kernel was installed:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># reboot<\/code><\/pre>\n\n\n\n<h2 id=\"h-step-2-install-nginx\" class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Step-2-Install-NGINX\"><\/span><strong>Step 2. Install NGINX<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The first component of our <strong>LEMP <\/strong>stack is the <strong>NGINX <\/strong>web server. NGINX is available in the default Ubuntu 26.04 repositories, so installation is just a single command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>apt install nginx -y<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Once installed, start the NGINX service and enable it to start automatically at boot:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl start nginx &amp;&amp; sudo systemctl enable nginx<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">To confirm that NGINX is up and running, execute the following command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl status nginx<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You should see output similar to this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\u25cf nginx.service - A high performance web server and a reverse proxy server\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Loaded: loaded (\/usr\/lib\/systemd\/system\/nginx.service; enabled; preset: enabled)\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Active: active (running) since Mon 2026-05-11 10:14:22 UTC; 5s ago\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Docs: man:nginx(8)\n&nbsp; &nbsp; &nbsp; &nbsp;Main PID: 2418 (nginx)\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Tasks: 4 (limit: 4613)\nMemory: 3.1M (peak: 3.7M)\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CPU: 38ms\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;CGroup: \/system.slice\/nginx.service\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\u251c\u25002418 \"nginx: master process \/usr\/sbin\/nginx -g daemon on; master_process on;\"\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\u251c\u25002419 \"nginx: worker process\"\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\u251c\u25002420 \"nginx: worker process\"\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\u2514\u25002421 \"nginx: worker process\"<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Now open your browser and navigate to `http:\/\/your_server_ip`. You should see the default NGINX welcome page, which confirms that the web server is working as expected.<\/p>\n\n\n\n<h2 id=\"h-step-3-install-mariadb-11-8\" class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Step-3-Install-MariaDB-118\"><\/span><strong>Step 3. Install MariaDB 11.8<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The next component is the database server. Ubuntu 26.04 ships <strong>MariaDB 11.8 LTS<\/strong> directly in the default repositories, so there is no need to add an external repository for this release. You can also confirm this by checking the available mariadb-server packages with:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>apt-cache search mariadb-server<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Now, to install MariaDB, use the command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>apt install mariadb-server mariadb-client -y<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Once installed, start and enable the service:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl start mariadb &amp;&amp; sudo systemctl enable mariadb<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Verify that the database service is running:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># systemctl status mariadb\n     Loaded: loaded (\/usr\/lib\/systemd\/system\/mariadb.service; enabled; preset: enabled)\n     Active: active (running) since Tue 2026-05-12 04:37:05 UTC; 6h ago<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You can now connect to the MariaDB shell to confirm everything is working:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo mariadb<\/code><\/pre>\n\n\n\n<h2 id=\"h-step-4-install-php-8-4-with-php-fpm\" class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Step-4-Install-PHP-84-with-PHP-FPM\"><\/span><strong>Step 4. Install PHP 8.4 with PHP-FPM<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">At the moment of writing the tutorial, the PPA Ondrej is not supported for Ubuntu 26.04. So for this tutorial, we will show you how to install PHP 8.4 from source.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You can download the source files from GitHub or directly download and extract the files with the command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>wget https:\/\/www.php.net\/distributions\/php-8.4.21.tar.gz\ntar -xzvf php-8.4.21.tar.gz\ncd php-8.4.21<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Now, to install, you will need to configure PHP with the PHP extensions:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>.\/configure --prefix=\/usr\/local\/php8.4 \\\n    --with-config-file-path=\/usr\/local\/php8.4\/etc \\\n    --enable-fpm \\\n    --with-fpm-user=www-data \\\n    --with-fpm-group=www-data \\\n    --with-fpm-systemd \\\n    --with-mysqli \\\n    --with-pdo-mysql \\\n    --with-openssl \\\n    --with-zlib \\\n    --with-curl \\\n    --with-gd \\\n    --with-mbstring \\\n    --with-opcache \\\n    --enable-opcache \\\n    --enable-intl \\\n    --enable-zip<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Once completed, go ahead and compile the PHP with the following command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>make -j$(nproc)<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You should allow some time for the compilation process to finish. When the compilation is done, we can install PHP 8.3 with the command below:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>make install<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">After the installation, we need to make a symbolic link:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ln -s \/usr\/local\/php8.4\/bin\/php \/usr\/bin\/php<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Once the installation is complete, check the PHP version:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>php -v<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You should get an output similar to this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>PHP 8.4.21 (cli) (built: May 11 2026 18:23:32) (NTS)\nCopyright (c) The PHP Group\nZend Engine v4.4.21, Copyright (c) Zend Technologies<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You can now configure the PHP-FPM service. First, create the php-fpm.service file in \/etc\/systemd\/system\/ and enter the following:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;Unit]\nDescription=The PHP FastCGI Process Manager\nAfter=syslog.target network.target\n\n&#91;Service]\nType=simple\nPIDFile=\/run\/php-fpm\/php-fpm.pid\nExecStart=\/usr\/local\/php8.4\/sbin\/php-fpm --nodaemonize --fpm-config \/usr\/local\/php8.4\/etc\/php-fpm.d\/www.conf.default\nExecReload=\/bin\/kill -USR2 $MAINPID\n\n&#91;Install]\nWantedBy=multi-user.target<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Now reload the php-fpm daemon and start the service<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl daemon-reload\nsystemctl start php-fpm<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">To check if the service is started and running, check with:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># systemctl status php-fpm\n\u25cf php-fpm.service - The PHP FastCGI Process Manager\n     Loaded: loaded (\/etc\/systemd\/system\/php-fpm.service; disabled; preset: enabled)\n     Active: active (running) since Tue 2026-05-12 20:25:17 UTC; 4s ago<\/code><\/pre>\n\n\n\n<h2 id=\"h-step-5-install-and-configure-redis\" class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Step-5-Install-and-Configure-Redis\"><\/span><strong>Step 5. Install and Configure Redis<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Redis is an in-memory key-value store that drastically reduces database load by caching sessions, objects, and frequently used queries. Ubuntu 26.04 ships Redis 8 in the default repositories, which is a perfectly good choice for production use.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Install Redis and the CLI tools with: <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>apt install redis-server redis-tools -y<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Now open the Redis configuration file to tune it for production:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code> nano \/etc\/redis\/redis.conf<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Find and update the following directives<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>supervised systemd\nmaxmemory 512mb\nmaxmemory-policy allkeys-lru<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The `supervised systemd` directive lets systemd properly manage the Redis process. The `maxmemory` directive caps Redis memory usage \u2013 adjust this to your hardware. The `allkeys-lru` policy tells Redis to evict the least recently used keys when the memory cap is reached, which is the best policy for using Redis as a cache.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For security, make sure Redis is bound only to localhost (this is the default), and set a password by uncommenting and editing the `requirepass` directive:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>bind 127.0.0.1 ::1\nrequirepass YourStrongRedisPasswordHere<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Save the file and exit. Then restart Redis and enable it on boot:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl restart redis-server &amp;&amp; sudo systemctl enable redis-server<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Verify Redis is responding:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>redis-cli -a YourStrongRedisPasswordHere ping<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You should get:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>PONG<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">That confirms Redis is installed and responding.<\/p>\n\n\n\n<h2 id=\"h-step-6-tune-php-fpm-for-high-performance\" class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Step-6-Tune-PHP-FPM-for-High-Performance\"><\/span><strong>Step 6. Tune PHP-FPM for High Performance<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The default PHP-FPM pool configuration is conservative and not ideal for high-traffic websites. Open the `www` pool config:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code> nano \/usr\/local\/php8.4\/etc\/php-fpm.d\/www.conf.default<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Find the following directives and adjust them based on your server resources. The values below are a sensible baseline for a server with 4 GB of RAM:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>pm = dynamic\npm.max_children = 50\npm.start_servers = 10\npm.min_spare_servers = 5\npm.max_spare_servers = 15\npm.max_requests = 500<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">A rough rule of thumb: `pm.max_children` should be set so that `max_children \u00d7 average PHP process memory` is less than your available RAM. On a 4 GB server, assuming each PHP process uses around 40 MB, 50 workers is a safe ceiling.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Next, let\u2019s tune OPcache, the bytecode cache that ships with PHP and is one of the biggest single performance wins you can enable. Open the OPcache config file and set the following settings:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>zend_extension=opcache\nopcache.enable=1\nopcache.enable_cli=1\nopcache.memory_consumption=256\nopcache.jit_buffer_size=128M\nopcache.jit=tracing<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The last two lines enable the PHP 8.4 <strong>JIT (Just-In-Time) compiler in tracing mode<\/strong>, which can deliver significant performance gains for CPU-bound workloads.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Save the file and restart PHP-FPM to apply the changes:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code> systemctl restart php-fpm<\/code><\/pre>\n\n\n\n<h2 id=\"h-step-7-configure-nginx-with-php-fpm\" class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Step-7-Configure-NGINX-with-PHP-FPM\"><\/span><strong>Step 7. Configure NGINX with PHP-FPM<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Now we will create an NGINX server block that passes PHP requests to PHP-FPM. We\u2019ll also tune the worker processes for performance.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">First, edit the main NGINX configuration file:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>nano \/etc\/nginx\/nginx.conf<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Adjust the top-level performance directives:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>worker_processes auto;\n&nbsp; &nbsp; worker_rlimit_nofile 65535;\n\n&nbsp; &nbsp; events {\n&nbsp; &nbsp; &nbsp; &nbsp; worker_connections 4096;\n&nbsp; &nbsp; &nbsp; &nbsp; multi_accept on;\n&nbsp; &nbsp; &nbsp; &nbsp; use epoll;\n&nbsp; &nbsp; }\n\u2026<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Save and close the file. Next, create a new server block for your website. Replace `your_domain.com` with your actual domain:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code> nano \/etc\/nginx\/sites-available\/your_domain.com<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Paste the following configuration:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>server {\nlisten 80;\nserver_name example.com;\n\nroot \/var\/www\/html;\nindex index.php index.html;\n\nlocation \/ {\ntry_files $uri $uri\/ \/index.php?$query_string;\n}\n\nlocation ~ \\.php$ {\ninclude fastcgi_params;\n\nfastcgi_pass unix:\/var\/run\/php\/php8.4-fpm.sock;\nfastcgi_index index.php;\n\nfastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;\n}\n\nlocation ~ \/\\.ht {\ndeny all;\n}\n&nbsp; &nbsp; &nbsp; &nbsp; # Static asset caching\n&nbsp; &nbsp; &nbsp; &nbsp; location ~* \\.(jpg|jpeg|png|gif|ico|css|js|woff2?|svg)$ {\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; expires 30d;\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; access_log off;\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; add_header Cache-Control \"public, no-transform\";\n&nbsp; &nbsp; &nbsp; &nbsp; }\n&nbsp; &nbsp; }<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Save the file and exit. Now create the document root and enable the site:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code> mkdir -p \/var\/www\/html\/\n chown -R www-data:www-data \/var\/www\/html\n&nbsp;sudo ln -s \/etc\/nginx\/sites-available\/your_domain.com \/etc\/nginx\/sites-enabled\/ your_domain.com<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Test the NGINX configuration for syntax errors:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>nginx -t<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">If everything is fine, you will see:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>nginx: the configuration file \/etc\/nginx\/nginx.conf syntax is ok\nnginx: configuration file \/etc\/nginx\/nginx.conf test is successful<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Reload NGINX to apply the new configuration:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl reload nginx<\/code><\/pre>\n\n\n\n<h2 id=\"h-step-8-use-redis-as-the-php-session-handler\" class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Step-8-Use-Redis-as-the-PHP-Session-Handler\"><\/span><strong>Step 8. Use Redis as the PHP Session Handler<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">By default, PHP stores session data on disk, which is slow and does not scale well. By moving sessions into Redis, you cut disk I\/O and gain support for sticky sessions across multiple servers.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Open the PHP-FPM `php.ini`:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>nano \/etc\/php\/8.4\/fpm\/php.ini<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Find these two directives and change them to point at Redis:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>session.save_handler = redis\nsession.save_path = \"tcp:\/\/127.0.0.1:6379?auth=YourStrongRedisPasswordHere\"<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Save the file, then restart PHP-FPM:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl restart php8.4-fpm<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">From this point on, all PHP sessions will be stored in Redis, freeing up disk I\/O and giving you blazing-fast session reads and writes.<\/p>\n\n\n\n<h2 id=\"h-step-9-optional-performance-tweaks\" class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Step-9-Optional-Performance-Tweaks\"><\/span><strong>Step 9. Optional Performance Tweaks<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Install Certbot and grab a free Let\u2019s Encrypt certificate:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>  apt install certbot python3-certbot-nginx -y\n&nbsp; certbot --nginx -d your_domain.com -d www.your_domain.com<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">After Certbot finishes, edit your server block and replace `listen 80;` with `listen 443 ssl http2;` to enable HTTP\/2, which dramatically improves load times for asset-heavy pages.<\/p>\n\n\n\n<h2 id=\"h-step-10-add-fastcgi-caching-in-nginx\" class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Step-10-Add-FastCGI-caching-in-NGINX\"><\/span>Step 10. <strong>Add FastCGI caching in NGINX<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">For mostly-static sites (blogs, brochure sites, WordPress with Redis object caching), enable FastCGI caching at the NGINX layer to skip PHP entirely for cached pages.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You can adjust the nginx file \/etc\/nginx\/sites-available\/your_domain.com to:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>set $skip_cache 0;\n\nif ($request_method = POST) {\n    set $skip_cache 1;\n}\n\nif ($query_string != \"\") {\n    set $skip_cache 1;\n}\n\nif ($http_cookie ~* \"PHPSESSID|wordpress_logged_in|woocommerce_items_in_cart\") {\n    set $skip_cache 1;\n}\n\nlocation ~ \\.php$ {\n\n    include fastcgi_params;\n\n    fastcgi_pass unix:\/var\/run\/php\/php8.4-fpm.sock;\n\n    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;\n\n    fastcgi_cache PHP;\n    fastcgi_cache_bypass $skip_cache;\n    fastcgi_no_cache $skip_cache;\n\n    fastcgi_cache_valid 200 301 302 30m;\n    fastcgi_cache_valid 404 1m;\n\n    add_header X-FastCGI-Cache $upstream_cache_status;\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Reload NGINX and watch your TTFB drop into the single-digit milliseconds for cached responses.<\/p>\n\n\n\n<h2 id=\"h-step-11-tune-mariadb-for-your-workload\" class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Step-11-Tune-MariaDB-for-your-workload\"><\/span>Step 11. <strong>Tune MariaDB for your workload<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">You can use MySQL Tuner to check and tune MySQL according to your server resources.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>wget https:\/\/raw.githubusercontent.com\/major\/MySQLTuner-perl\/master\/mysqltuner.pl\nchmod +x mysqltuner.pl\nperl mysqltuner.pl<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Running this script will check and suggest the edits you can apply to your MySQL configuration file.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Or if you have a dedicated database server, you can adjust the buffer pool to roughly 50\u201370% of total RAM by editing the \/etc\/mysql\/mariadb.conf.d\/50-server.cnf file.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>innodb_buffer_pool_size = 2G\ninnodb_log_file_size = 512M\ninnodb_flush_log_at_trx_commit = 2\ninnodb_flush_method = O_DIRECT\nmax_connections = 200\nquery_cache_type = 0\nquery_cache_size = 0<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Restart MariaDB to apply:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl restart mariadb<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">That\u2019s it! You now have a fully working, production-ready, high-performance LEMP stack on Ubuntu 26.04 with NGINX, PHP 8.4 (with JIT and OPcache), MariaDB 11.8 LTS, and Redis 8 acting as both a session store and a general-purpose cache. This stack is more than capable of handling thousands of concurrent users on a modest VPS, and it gives you a solid foundation for installing WordPress, Laravel, Magento, Nextcloud, or any other modern PHP application.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Of course, you don\u2019t have to set up a high-performance LEMP stack on Ubuntu 26.04 if you use one of our [Managed Linux VPS Hosting](https:\/\/www.rosehosting.com\/linux-vps-hosting\/) services, in which case you can simply ask our expert Linux admins to set up, optimize, and secure the entire stack for you \u2013 completely free of charge. They are available 24\/7 and will take care of your request immediately.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this tutorial, we are going to show you how to set up a high-performance LEMP stack on Ubuntu 26.04. &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"How to Set Up a High-Performance LEMP Stack on Ubuntu 26.04 in 2026 (NGINX + PHP 8.4 + MariaDB 11 + Redis)\" class=\"read-more button\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-set-up-a-high-performance-lemp-stack-on-ubuntu-26-04-in-2026-nginx-php-8-4-mariadb-11-redis\/#more-51995\" aria-label=\"Read more about How to Set Up a High-Performance LEMP Stack on Ubuntu 26.04 in 2026 (NGINX + PHP 8.4 + MariaDB 11 + Redis)\">Read More<\/a><\/p>\n","protected":false},"author":4,"featured_media":52031,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1698],"tags":[2315,1957,310,2317,49,2316,433,2308],"class_list":["post-51995","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ubuntu","tag-high-performance","tag-how-to-set-up","tag-lemp","tag-mariadb-11","tag-nginx","tag-php-8-4","tag-redis","tag-ubuntu-26-04","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-33"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.8 (Yoast SEO v27.8) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>LEMP Stack on Ubuntu 26.04 Setup Guide | RoseHosting<\/title>\n<meta name=\"description\" content=\"Set up a high-performance LEMP stack on Ubuntu 26.04. Follow our easy guide to install NGINX, PHP, and MariaDB.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-set-up-a-high-performance-lemp-stack-on-ubuntu-26-04-in-2026-nginx-php-8-4-mariadb-11-redis\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Set Up a High-Performance LEMP Stack on Ubuntu 26.04 in 2026 (NGINX + PHP 8.4 + MariaDB 11 + Redis)\" \/>\n<meta property=\"og:description\" content=\"How to Set Up a High-Performance LEMP Stack on Ubuntu 26.04 in 2026 (NGINX + PHP 8.4 + MariaDB 11 + Redis) | RoseHosting\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.rosehosting.com\/blog\/how-to-set-up-a-high-performance-lemp-stack-on-ubuntu-26-04-in-2026-nginx-php-8-4-mariadb-11-redis\/\" \/>\n<meta property=\"og:site_name\" content=\"RoseHosting\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/RoseHosting\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/rosehosting.helpdesk\" \/>\n<meta property=\"article:published_time\" content=\"2026-06-22T17:30:00+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2026\/06\/how-to-set-up-a-high-performance-lemp-stack-on-ubuntu-26.04-in-2026.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"1024\" \/>\n\t<meta property=\"og:image:height\" content=\"576\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\n<meta name=\"author\" content=\"Jeff Wilson\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@rosehosting\" \/>\n<meta name=\"twitter:site\" content=\"@rosehosting\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jeff Wilson\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-set-up-a-high-performance-lemp-stack-on-ubuntu-26-04-in-2026-nginx-php-8-4-mariadb-11-redis\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-set-up-a-high-performance-lemp-stack-on-ubuntu-26-04-in-2026-nginx-php-8-4-mariadb-11-redis\\\/\"},\"author\":{\"name\":\"Jeff Wilson\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#\\\/schema\\\/person\\\/7ce77a842fa6a9a7f8efa186f2353713\"},\"headline\":\"How to Set Up a High-Performance LEMP Stack on Ubuntu 26.04 in 2026 (NGINX + PHP 8.4 + MariaDB 11 + Redis)\",\"datePublished\":\"2026-06-22T17:30:00+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-set-up-a-high-performance-lemp-stack-on-ubuntu-26-04-in-2026-nginx-php-8-4-mariadb-11-redis\\\/\"},\"wordCount\":1416,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-set-up-a-high-performance-lemp-stack-on-ubuntu-26-04-in-2026-nginx-php-8-4-mariadb-11-redis\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/06\\\/how-to-set-up-a-high-performance-lemp-stack-on-ubuntu-26.04-in-2026.webp\",\"keywords\":[\"high-performance\",\"how to set up\",\"lemp\",\"MariaDB 11\",\"nginx\",\"PHP 8.4\",\"redis\",\"ubuntu 26.04\"],\"articleSection\":[\"Ubuntu\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-set-up-a-high-performance-lemp-stack-on-ubuntu-26-04-in-2026-nginx-php-8-4-mariadb-11-redis\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-set-up-a-high-performance-lemp-stack-on-ubuntu-26-04-in-2026-nginx-php-8-4-mariadb-11-redis\\\/\",\"url\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-set-up-a-high-performance-lemp-stack-on-ubuntu-26-04-in-2026-nginx-php-8-4-mariadb-11-redis\\\/\",\"name\":\"LEMP Stack on Ubuntu 26.04 Setup Guide | RoseHosting\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-set-up-a-high-performance-lemp-stack-on-ubuntu-26-04-in-2026-nginx-php-8-4-mariadb-11-redis\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-set-up-a-high-performance-lemp-stack-on-ubuntu-26-04-in-2026-nginx-php-8-4-mariadb-11-redis\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/06\\\/how-to-set-up-a-high-performance-lemp-stack-on-ubuntu-26.04-in-2026.webp\",\"datePublished\":\"2026-06-22T17:30:00+00:00\",\"description\":\"Set up a high-performance LEMP stack on Ubuntu 26.04. Follow our easy guide to install NGINX, PHP, and MariaDB.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-set-up-a-high-performance-lemp-stack-on-ubuntu-26-04-in-2026-nginx-php-8-4-mariadb-11-redis\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-set-up-a-high-performance-lemp-stack-on-ubuntu-26-04-in-2026-nginx-php-8-4-mariadb-11-redis\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-set-up-a-high-performance-lemp-stack-on-ubuntu-26-04-in-2026-nginx-php-8-4-mariadb-11-redis\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/06\\\/how-to-set-up-a-high-performance-lemp-stack-on-ubuntu-26.04-in-2026.webp\",\"contentUrl\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/06\\\/how-to-set-up-a-high-performance-lemp-stack-on-ubuntu-26.04-in-2026.webp\",\"width\":1024,\"height\":576,\"caption\":\"How to Set Up a High-Performance LEMP Stack on Ubuntu 26.04 in 2026 (Nginx + PHP 8.4 + MariaDB 11 + Redis)\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-set-up-a-high-performance-lemp-stack-on-ubuntu-26-04-in-2026-nginx-php-8-4-mariadb-11-redis\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Set Up a High-Performance LEMP Stack on Ubuntu 26.04 in 2026 (NGINX + PHP 8.4 + MariaDB 11 + Redis)\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/\",\"name\":\"RoseHosting.com\",\"description\":\"Premium Linux Tutorials Since 2001\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#organization\",\"name\":\"RoseHosting\",\"url\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/03\\\/android-chrome-192x192-1.png\",\"contentUrl\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/03\\\/android-chrome-192x192-1.png\",\"width\":192,\"height\":192,\"caption\":\"RoseHosting\"},\"image\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/RoseHosting\",\"https:\\\/\\\/x.com\\\/rosehosting\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/rosehosting\\\/\"],\"description\":\"RoseHosting is a leading Linux hosting provider, serving thousands of clients world-wide since 2001.\",\"email\":\"info@rosehosting.com\",\"telephone\":\"(314) 275-0414\",\"legalName\":\"Rose Web Services LLC\",\"foundingDate\":\"2001-04-02\",\"numberOfEmployees\":{\"@type\":\"QuantitativeValue\",\"minValue\":\"11\",\"maxValue\":\"50\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#\\\/schema\\\/person\\\/7ce77a842fa6a9a7f8efa186f2353713\",\"name\":\"Jeff Wilson\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g\",\"caption\":\"Jeff Wilson\"},\"description\":\"An experienced Linux veteran with many years of experience. Helping other Linux admins with frequent Linux and business-related blog posts on the RoseHosting blog. Techie by choice. Loving nature and travel. Happily married and father of two lovely children.\",\"sameAs\":[\"https:\\\/\\\/www.rosehosting.com\",\"https:\\\/\\\/www.facebook.com\\\/rosehosting.helpdesk\"],\"url\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/author\\\/jwilson\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"LEMP Stack on Ubuntu 26.04 Setup Guide | RoseHosting","description":"Set up a high-performance LEMP stack on Ubuntu 26.04. Follow our easy guide to install NGINX, PHP, and MariaDB.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.rosehosting.com\/blog\/how-to-set-up-a-high-performance-lemp-stack-on-ubuntu-26-04-in-2026-nginx-php-8-4-mariadb-11-redis\/","og_locale":"en_US","og_type":"article","og_title":"How to Set Up a High-Performance LEMP Stack on Ubuntu 26.04 in 2026 (NGINX + PHP 8.4 + MariaDB 11 + Redis)","og_description":"How to Set Up a High-Performance LEMP Stack on Ubuntu 26.04 in 2026 (NGINX + PHP 8.4 + MariaDB 11 + Redis) | RoseHosting","og_url":"https:\/\/www.rosehosting.com\/blog\/how-to-set-up-a-high-performance-lemp-stack-on-ubuntu-26-04-in-2026-nginx-php-8-4-mariadb-11-redis\/","og_site_name":"RoseHosting","article_publisher":"https:\/\/www.facebook.com\/RoseHosting","article_author":"https:\/\/www.facebook.com\/rosehosting.helpdesk","article_published_time":"2026-06-22T17:30:00+00:00","og_image":[{"width":1024,"height":576,"url":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2026\/06\/how-to-set-up-a-high-performance-lemp-stack-on-ubuntu-26.04-in-2026.webp","type":"image\/webp"}],"author":"Jeff Wilson","twitter_card":"summary_large_image","twitter_creator":"@rosehosting","twitter_site":"@rosehosting","twitter_misc":{"Written by":"Jeff Wilson","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.rosehosting.com\/blog\/how-to-set-up-a-high-performance-lemp-stack-on-ubuntu-26-04-in-2026-nginx-php-8-4-mariadb-11-redis\/#article","isPartOf":{"@id":"https:\/\/www.rosehosting.com\/blog\/how-to-set-up-a-high-performance-lemp-stack-on-ubuntu-26-04-in-2026-nginx-php-8-4-mariadb-11-redis\/"},"author":{"name":"Jeff Wilson","@id":"https:\/\/www.rosehosting.com\/blog\/#\/schema\/person\/7ce77a842fa6a9a7f8efa186f2353713"},"headline":"How to Set Up a High-Performance LEMP Stack on Ubuntu 26.04 in 2026 (NGINX + PHP 8.4 + MariaDB 11 + Redis)","datePublished":"2026-06-22T17:30:00+00:00","mainEntityOfPage":{"@id":"https:\/\/www.rosehosting.com\/blog\/how-to-set-up-a-high-performance-lemp-stack-on-ubuntu-26-04-in-2026-nginx-php-8-4-mariadb-11-redis\/"},"wordCount":1416,"commentCount":0,"publisher":{"@id":"https:\/\/www.rosehosting.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.rosehosting.com\/blog\/how-to-set-up-a-high-performance-lemp-stack-on-ubuntu-26-04-in-2026-nginx-php-8-4-mariadb-11-redis\/#primaryimage"},"thumbnailUrl":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2026\/06\/how-to-set-up-a-high-performance-lemp-stack-on-ubuntu-26.04-in-2026.webp","keywords":["high-performance","how to set up","lemp","MariaDB 11","nginx","PHP 8.4","redis","ubuntu 26.04"],"articleSection":["Ubuntu"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.rosehosting.com\/blog\/how-to-set-up-a-high-performance-lemp-stack-on-ubuntu-26-04-in-2026-nginx-php-8-4-mariadb-11-redis\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.rosehosting.com\/blog\/how-to-set-up-a-high-performance-lemp-stack-on-ubuntu-26-04-in-2026-nginx-php-8-4-mariadb-11-redis\/","url":"https:\/\/www.rosehosting.com\/blog\/how-to-set-up-a-high-performance-lemp-stack-on-ubuntu-26-04-in-2026-nginx-php-8-4-mariadb-11-redis\/","name":"LEMP Stack on Ubuntu 26.04 Setup Guide | RoseHosting","isPartOf":{"@id":"https:\/\/www.rosehosting.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.rosehosting.com\/blog\/how-to-set-up-a-high-performance-lemp-stack-on-ubuntu-26-04-in-2026-nginx-php-8-4-mariadb-11-redis\/#primaryimage"},"image":{"@id":"https:\/\/www.rosehosting.com\/blog\/how-to-set-up-a-high-performance-lemp-stack-on-ubuntu-26-04-in-2026-nginx-php-8-4-mariadb-11-redis\/#primaryimage"},"thumbnailUrl":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2026\/06\/how-to-set-up-a-high-performance-lemp-stack-on-ubuntu-26.04-in-2026.webp","datePublished":"2026-06-22T17:30:00+00:00","description":"Set up a high-performance LEMP stack on Ubuntu 26.04. Follow our easy guide to install NGINX, PHP, and MariaDB.","breadcrumb":{"@id":"https:\/\/www.rosehosting.com\/blog\/how-to-set-up-a-high-performance-lemp-stack-on-ubuntu-26-04-in-2026-nginx-php-8-4-mariadb-11-redis\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.rosehosting.com\/blog\/how-to-set-up-a-high-performance-lemp-stack-on-ubuntu-26-04-in-2026-nginx-php-8-4-mariadb-11-redis\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.rosehosting.com\/blog\/how-to-set-up-a-high-performance-lemp-stack-on-ubuntu-26-04-in-2026-nginx-php-8-4-mariadb-11-redis\/#primaryimage","url":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2026\/06\/how-to-set-up-a-high-performance-lemp-stack-on-ubuntu-26.04-in-2026.webp","contentUrl":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2026\/06\/how-to-set-up-a-high-performance-lemp-stack-on-ubuntu-26.04-in-2026.webp","width":1024,"height":576,"caption":"How to Set Up a High-Performance LEMP Stack on Ubuntu 26.04 in 2026 (Nginx + PHP 8.4 + MariaDB 11 + Redis)"},{"@type":"BreadcrumbList","@id":"https:\/\/www.rosehosting.com\/blog\/how-to-set-up-a-high-performance-lemp-stack-on-ubuntu-26-04-in-2026-nginx-php-8-4-mariadb-11-redis\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.rosehosting.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to Set Up a High-Performance LEMP Stack on Ubuntu 26.04 in 2026 (NGINX + PHP 8.4 + MariaDB 11 + Redis)"}]},{"@type":"WebSite","@id":"https:\/\/www.rosehosting.com\/blog\/#website","url":"https:\/\/www.rosehosting.com\/blog\/","name":"RoseHosting.com","description":"Premium Linux Tutorials Since 2001","publisher":{"@id":"https:\/\/www.rosehosting.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.rosehosting.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.rosehosting.com\/blog\/#organization","name":"RoseHosting","url":"https:\/\/www.rosehosting.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.rosehosting.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2022\/03\/android-chrome-192x192-1.png","contentUrl":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2022\/03\/android-chrome-192x192-1.png","width":192,"height":192,"caption":"RoseHosting"},"image":{"@id":"https:\/\/www.rosehosting.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/RoseHosting","https:\/\/x.com\/rosehosting","https:\/\/www.linkedin.com\/in\/rosehosting\/"],"description":"RoseHosting is a leading Linux hosting provider, serving thousands of clients world-wide since 2001.","email":"info@rosehosting.com","telephone":"(314) 275-0414","legalName":"Rose Web Services LLC","foundingDate":"2001-04-02","numberOfEmployees":{"@type":"QuantitativeValue","minValue":"11","maxValue":"50"}},{"@type":"Person","@id":"https:\/\/www.rosehosting.com\/blog\/#\/schema\/person\/7ce77a842fa6a9a7f8efa186f2353713","name":"Jeff Wilson","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g","caption":"Jeff Wilson"},"description":"An experienced Linux veteran with many years of experience. Helping other Linux admins with frequent Linux and business-related blog posts on the RoseHosting blog. Techie by choice. Loving nature and travel. Happily married and father of two lovely children.","sameAs":["https:\/\/www.rosehosting.com","https:\/\/www.facebook.com\/rosehosting.helpdesk"],"url":"https:\/\/www.rosehosting.com\/blog\/author\/jwilson\/"}]}},"_links":{"self":[{"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/posts\/51995","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/comments?post=51995"}],"version-history":[{"count":3,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/posts\/51995\/revisions"}],"predecessor-version":[{"id":52033,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/posts\/51995\/revisions\/52033"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/media\/52031"}],"wp:attachment":[{"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/media?parent=51995"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/categories?post=51995"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/tags?post=51995"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}