{"id":13628,"date":"2026-10-15T00:27:38","date_gmt":"2026-10-15T00:27:38","guid":{"rendered":"https:\/\/resizemyimg.com\/blog\/?p=13628"},"modified":"2026-10-15T00:35:46","modified_gmt":"2026-10-15T00:35:46","slug":"how-to-install-lamp-on-ubuntu-apache-vs-nginx-for-building-a-linux-web-server","status":"publish","type":"post","link":"https:\/\/resizemyimg.com\/blog\/how-to-install-lamp-on-ubuntu-apache-vs-nginx-for-building-a-linux-web-server\/","title":{"rendered":"How to Install LAMP on Ubuntu: Apache vs Nginx for Building a Linux Web Server"},"content":{"rendered":"<p><strong>For most Ubuntu web servers, install Apache if you want the simplest LAMP setup, and choose Nginx with PHP FPM if you expect heavy traffic or plan to run several sites behind one server.<\/strong> Ubuntu LTS is a strong base because it receives five years of standard security maintenance, which matters when the server will stay online for years <a href=\"https:\/\/ubuntu.com\/about\/release-cycle\">[source: Ubuntu]<\/a>. Strictly speaking, <strong>LAMP<\/strong> means <em>Linux, Apache, MySQL, PHP<\/em>. If you use Nginx instead of Apache, the stack is usually called <strong>LEMP<\/strong>, but the goal is the same: serve PHP applications from a Linux server.<\/p>\n<div>\n<p><strong>TLDR:<\/strong> Use <strong>Apache<\/strong> for a standard WordPress, Drupal, Laravel, or phpMyAdmin server where quick setup and broad documentation matter. Use <strong>Nginx<\/strong> when concurrency, reverse proxying, and lower memory use matter more than easy configuration. For example, a small business site with 5,000 monthly visits will run fine on Apache, while a SaaS landing site receiving 300 simultaneous requests may fit Nginx better. Expect Apache to be faster to configure, but Nginx is often cleaner once traffic grows.<\/p>\n<\/div>\n<img loading=\"lazy\" decoding=\"async\" width=\"1080\" height=\"608\" src=\"https:\/\/resizemyimg.com\/blog\/wp-content\/uploads\/2026\/07\/a-computer-with-a-keyboard-and-mouse-hosting-comparison-pricing-plans-php-websites.jpg\" class=\"attachment-full size-full\" alt=\"\" srcset=\"https:\/\/resizemyimg.com\/blog\/wp-content\/uploads\/2026\/07\/a-computer-with-a-keyboard-and-mouse-hosting-comparison-pricing-plans-php-websites.jpg 1080w, https:\/\/resizemyimg.com\/blog\/wp-content\/uploads\/2026\/07\/a-computer-with-a-keyboard-and-mouse-hosting-comparison-pricing-plans-php-websites-300x169.jpg 300w, https:\/\/resizemyimg.com\/blog\/wp-content\/uploads\/2026\/07\/a-computer-with-a-keyboard-and-mouse-hosting-comparison-pricing-plans-php-websites-1024x576.jpg 1024w, https:\/\/resizemyimg.com\/blog\/wp-content\/uploads\/2026\/07\/a-computer-with-a-keyboard-and-mouse-hosting-comparison-pricing-plans-php-websites-575x324.jpg 575w, https:\/\/resizemyimg.com\/blog\/wp-content\/uploads\/2026\/07\/a-computer-with-a-keyboard-and-mouse-hosting-comparison-pricing-plans-php-websites-768x432.jpg 768w\" sizes=\"(max-width: 1080px) 100vw, 1080px\" \/>\n<h2>What You Are Actually Installing<\/h2>\n<p>A basic Ubuntu web server needs four parts:<\/p>\n<ul>\n<li><strong>Linux:<\/strong> Ubuntu Server, usually an LTS release.<\/li>\n<li><strong>Web server:<\/strong> Apache or Nginx.<\/li>\n<li><strong>Database:<\/strong> MySQL or MariaDB.<\/li>\n<li><strong>PHP:<\/strong> The language runtime used by many CMS and web apps.<\/li>\n<\/ul>\n<p>Apache reads PHP through an Apache PHP module or through PHP FPM. Nginx cannot process PHP by itself, so it passes PHP files to <strong>PHP FPM<\/strong>. That extra piece is not hard, but it adds one more service to check when something breaks. Honestly, the PHP socket mismatch is the kind of small server issue that can waste 20 minutes for no good reason.<\/p>\n<h2>Option 1: Install a Classic LAMP Stack with Apache<\/h2>\n<p>Start with a clean Ubuntu server. Log in as a sudo user, then update packages:<\/p>\n<pre><code>sudo apt update\nsudo apt upgrade -y<\/code><\/pre>\n<p>Install Apache, MySQL, PHP, and the common PHP MySQL extension:<\/p>\n<pre><code>sudo apt install apache2 mysql-server php libapache2-mod-php php-mysql -y<\/code><\/pre>\n<p>Enable and start the services:<\/p>\n<pre><code>sudo systemctl enable --now apache2\nsudo systemctl enable --now mysql<\/code><\/pre>\n<p>Allow web traffic through the firewall:<\/p>\n<pre><code>sudo ufw allow 'Apache Full'\nsudo ufw enable<\/code><\/pre>\n<p>Then run the MySQL security helper:<\/p>\n<pre><code>sudo mysql_secure_installation<\/code><\/pre>\n<p>Apache should now serve its default page at your server IP address. Place site files in:<\/p>\n<pre><code>\/var\/www\/html<\/code><\/pre>\n<p>To test PHP, create a temporary file:<\/p>\n<pre><code>echo \"&lt;?php phpinfo(); ?&gt;\" | sudo tee \/var\/www\/html\/info.php<\/code><\/pre>\n<p>Visit:<\/p>\n<pre><code>http:\/\/your_server_ip\/info.php<\/code><\/pre>\n<p>If the PHP information page appears, PHP works. Delete the file right away:<\/p>\n<pre><code>sudo rm \/var\/www\/html\/info.php<\/code><\/pre>\n<p>Leaving <code>phpinfo()<\/code> public is sloppy. It exposes paths, modules, and version data attackers do not need to see.<\/p>\n<h2>Option 2: Install Nginx with MySQL and PHP FPM<\/h2>\n<p>If you prefer Nginx, install it with MySQL and PHP FPM:<\/p>\n<pre><code>sudo apt update\nsudo apt install nginx mysql-server php-fpm php-mysql -y<\/code><\/pre>\n<p>Start and enable services:<\/p>\n<pre><code>sudo systemctl enable --now nginx\nsudo systemctl enable --now mysql\nsudo systemctl enable --now php8.3-fpm<\/code><\/pre>\n<p>Your PHP version may differ. Check it with:<\/p>\n<pre><code>php -v\nsystemctl status php*-fpm<\/code><\/pre>\n<p>Allow Nginx traffic:<\/p>\n<pre><code>sudo ufw allow 'Nginx Full'\nsudo ufw enable<\/code><\/pre>\n<p>Create a simple Nginx server block:<\/p>\n<pre><code>sudo nano \/etc\/nginx\/sites-available\/example.com<\/code><\/pre>\n<p>Add this configuration, changing the domain and PHP version if needed:<\/p>\n<pre><code>server {\n    listen 80;\n    server_name example.com www.example.com;\n    root \/var\/www\/example.com;\n    index index.php index.html;\n\n    location \/ {\n        try_files $uri $uri\/ \/index.php?$args;\n    }\n\n    location ~ \\.php$ {\n        include snippets\/fastcgi-php.conf;\n        fastcgi_pass unix:\/run\/php\/php8.3-fpm.sock;\n    }\n\n    location ~ \/\\.ht {\n        deny all;\n    }\n}<\/code><\/pre>\n<p>Create the web root and enable the site:<\/p>\n<pre><code>sudo mkdir -p \/var\/www\/example.com\nsudo ln -s \/etc\/nginx\/sites-available\/example.com \/etc\/nginx\/sites-enabled\/\nsudo nginx -t\nsudo systemctl reload nginx<\/code><\/pre>\n<p>Nginx is strict about syntax. That is good for production, but annoying during setup. A missing semicolon can stop the reload cold.<\/p>\n<img loading=\"lazy\" decoding=\"async\" width=\"1080\" height=\"720\" src=\"https:\/\/resizemyimg.com\/blog\/wp-content\/uploads\/2026\/10\/a-computer-screen-with-a-program-running-on-it-terminal-commands-web-server-setup-linux-administrator.jpg\" class=\"attachment-full size-full\" alt=\"\" srcset=\"https:\/\/resizemyimg.com\/blog\/wp-content\/uploads\/2026\/10\/a-computer-screen-with-a-program-running-on-it-terminal-commands-web-server-setup-linux-administrator.jpg 1080w, https:\/\/resizemyimg.com\/blog\/wp-content\/uploads\/2026\/10\/a-computer-screen-with-a-program-running-on-it-terminal-commands-web-server-setup-linux-administrator-300x200.jpg 300w, https:\/\/resizemyimg.com\/blog\/wp-content\/uploads\/2026\/10\/a-computer-screen-with-a-program-running-on-it-terminal-commands-web-server-setup-linux-administrator-1024x683.jpg 1024w, https:\/\/resizemyimg.com\/blog\/wp-content\/uploads\/2026\/10\/a-computer-screen-with-a-program-running-on-it-terminal-commands-web-server-setup-linux-administrator-575x383.jpg 575w, https:\/\/resizemyimg.com\/blog\/wp-content\/uploads\/2026\/10\/a-computer-screen-with-a-program-running-on-it-terminal-commands-web-server-setup-linux-administrator-768x512.jpg 768w\" sizes=\"(max-width: 1080px) 100vw, 1080px\" \/>\n<h2>Apache vs Nginx: Which One Should You Use?<\/h2>\n<table>\n<thead>\n<tr>\n<th>Factor<\/th>\n<th>Apache<\/th>\n<th>Nginx<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><strong>Ease of setup<\/strong><\/td>\n<td>Very easy for PHP apps<\/td>\n<td>Moderate, needs PHP FPM<\/td>\n<\/tr>\n<tr>\n<td><strong>Performance<\/strong><\/td>\n<td>Good for most sites<\/td>\n<td>Very strong with many concurrent connections<\/td>\n<\/tr>\n<tr>\n<td><strong>Configuration style<\/strong><\/td>\n<td>Supports <code>.htaccess<\/code><\/td>\n<td>Central server blocks only<\/td>\n<\/tr>\n<tr>\n<td><strong>Shared hosting habits<\/strong><\/td>\n<td>Common and familiar<\/td>\n<td>Less forgiving, cleaner at scale<\/td>\n<\/tr>\n<tr>\n<td><strong>Reverse proxy use<\/strong><\/td>\n<td>Works well<\/td>\n<td>Often preferred<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Choose <strong>Apache<\/strong> if you are installing WordPress quickly, using legacy PHP software, or relying on <code>.htaccess<\/code> rules. Many plugins and CMS guides assume Apache. That saves time.<\/p>\n<p>Choose <strong>Nginx<\/strong> if you want a front end for PHP apps, Node.js apps, containers, or multiple upstream services. Nginx is also a strong pick for static files, caching, and reverse proxy setups. The official Nginx documentation describes the server block model in detail <a href=\"https:\/\/nginx.org\/en\/docs\/\">[source: Nginx]<\/a>.<\/p>\n<h2>Secure the Server Before You Publish<\/h2>\n<p>Do not stop after the first successful page load. A working server is not the same as a safe server.<\/p>\n<ul>\n<li><strong>Enable automatic security updates:<\/strong> install <code>unattended-upgrades<\/code>.<\/li>\n<li><strong>Use SSH keys:<\/strong> avoid password based root access.<\/li>\n<li><strong>Install TLS:<\/strong> use Certbot for a free Let\u2019s Encrypt certificate.<\/li>\n<li><strong>Limit open ports:<\/strong> keep only SSH, HTTP, and HTTPS open unless needed.<\/li>\n<li><strong>Back up databases:<\/strong> test restore steps, not just backup jobs.<\/li>\n<li><strong>Check logs:<\/strong> review <code>\/var\/log\/apache2\/<\/code>, <code>\/var\/log\/nginx\/<\/code>, and auth logs.<\/li>\n<\/ul>\n<p>For Apache TLS:<\/p>\n<pre><code>sudo apt install certbot python3-certbot-apache -y\nsudo certbot --apache<\/code><\/pre>\n<p>For Nginx TLS:<\/p>\n<pre><code>sudo apt install certbot python3-certbot-nginx -y\nsudo certbot --nginx<\/code><\/pre>\n<p>After that, test renewal:<\/p>\n<pre><code>sudo certbot renew --dry-run<\/code><\/pre>\n<img loading=\"lazy\" decoding=\"async\" width=\"1080\" height=\"608\" src=\"https:\/\/resizemyimg.com\/blog\/wp-content\/uploads\/2025\/04\/a-black-and-white-sign-cyber-security-shield-icon-secure-web-hosting-server-room-ssl-certificate-illustration-1.jpg\" class=\"attachment-full size-full\" alt=\"\" srcset=\"https:\/\/resizemyimg.com\/blog\/wp-content\/uploads\/2025\/04\/a-black-and-white-sign-cyber-security-shield-icon-secure-web-hosting-server-room-ssl-certificate-illustration-1.jpg 1080w, https:\/\/resizemyimg.com\/blog\/wp-content\/uploads\/2025\/04\/a-black-and-white-sign-cyber-security-shield-icon-secure-web-hosting-server-room-ssl-certificate-illustration-1-300x169.jpg 300w, https:\/\/resizemyimg.com\/blog\/wp-content\/uploads\/2025\/04\/a-black-and-white-sign-cyber-security-shield-icon-secure-web-hosting-server-room-ssl-certificate-illustration-1-1024x576.jpg 1024w, https:\/\/resizemyimg.com\/blog\/wp-content\/uploads\/2025\/04\/a-black-and-white-sign-cyber-security-shield-icon-secure-web-hosting-server-room-ssl-certificate-illustration-1-575x324.jpg 575w, https:\/\/resizemyimg.com\/blog\/wp-content\/uploads\/2025\/04\/a-black-and-white-sign-cyber-security-shield-icon-secure-web-hosting-server-room-ssl-certificate-illustration-1-768x432.jpg 768w\" sizes=\"(max-width: 1080px) 100vw, 1080px\" \/>\n<h2>Final Recommendation<\/h2>\n<p>If this is your first Ubuntu Linux web server, start with <strong>Apache LAMP<\/strong>. It is direct, heavily documented, and friendly to common PHP software. If you already know your site will handle higher concurrency or act as a reverse proxy, use <strong>Nginx with PHP FPM<\/strong>.<\/p>\n<p>The practical answer is simple. Apache gets you online faster. Nginx gives you tighter control as traffic and complexity increase. Pick the server that matches the workload, not the trend.<\/p>\n","protected":false},"excerpt":{"rendered":"<p><strong>For most Ubuntu web servers, install Apache if you want the simplest LAMP setup, and choose Nginx with PHP FPM if you expect heavy traffic or plan to run several sites behind one server.<\/strong> Ubuntu LTS is a strong base because it receives five years of standard security maintenance, which matters when the server will stay online for years <a href=\"https:\/\/ubuntu.com\/about\/release-cycle\">[source: Ubuntu]<\/a>. Strictly speaking, <strong>LAMP<\/strong> means <em>Linux, Apache, MySQL, PHP<\/em>. If you use Nginx instead of Apache, the stack is usually called <strong>LEMP<\/strong>, but the goal is the same: serve PHP applications from a Linux server. <\/p>\n<p class=\"read-more-container\"><a href=\"https:\/\/resizemyimg.com\/blog\/how-to-install-lamp-on-ubuntu-apache-vs-nginx-for-building-a-linux-web-server\/\" class=\"read-more button\">Read more<\/a><\/p>\n","protected":false},"author":91,"featured_media":2999,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-13628","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-50","no-featured-image-padding"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v23.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to Install LAMP on Ubuntu: Apache vs Nginx for Building a Linux Web Server<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/resizemyimg.com\/blog\/how-to-install-lamp-on-ubuntu-apache-vs-nginx-for-building-a-linux-web-server\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Install LAMP on Ubuntu: Apache vs Nginx for Building a Linux Web Server\" \/>\n<meta property=\"og:description\" content=\"For most Ubuntu web servers, install Apache if you want the simplest LAMP setup, and choose Nginx with PHP FPM if you expect heavy traffic or plan to run several sites behind one server. Ubuntu LTS is a strong base because it receives five years of standard security maintenance, which matters when the server will stay online for years [source: Ubuntu]. Strictly speaking, LAMP means Linux, Apache, MySQL, PHP. If you use Nginx instead of Apache, the stack is usually called LEMP, but the goal is the same: serve PHP applications from a Linux server. Read more\" \/>\n<meta property=\"og:url\" content=\"https:\/\/resizemyimg.com\/blog\/how-to-install-lamp-on-ubuntu-apache-vs-nginx-for-building-a-linux-web-server\/\" \/>\n<meta property=\"og:site_name\" content=\"Resize my Image Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webfactoryltd\/\" \/>\n<meta property=\"article:published_time\" content=\"2026-10-15T00:27:38+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-10-15T00:35:46+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/resizemyimg.com\/blog\/wp-content\/uploads\/2021\/04\/apache-installation-on-linux.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1289\" \/>\n\t<meta property=\"og:image:height\" content=\"569\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Jame Miller\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@webfactoryltd\" \/>\n<meta name=\"twitter:site\" content=\"@webfactoryltd\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jame Miller\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/resizemyimg.com\/blog\/how-to-install-lamp-on-ubuntu-apache-vs-nginx-for-building-a-linux-web-server\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/resizemyimg.com\/blog\/how-to-install-lamp-on-ubuntu-apache-vs-nginx-for-building-a-linux-web-server\/\"},\"author\":{\"name\":\"Jame Miller\",\"@id\":\"https:\/\/resizemyimg.com\/blog\/#\/schema\/person\/4bece8cd1b5bcd61a4e5dab002eb7dca\"},\"headline\":\"How to Install LAMP on Ubuntu: Apache vs Nginx for Building a Linux Web Server\",\"datePublished\":\"2026-10-15T00:27:38+00:00\",\"dateModified\":\"2026-10-15T00:35:46+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/resizemyimg.com\/blog\/how-to-install-lamp-on-ubuntu-apache-vs-nginx-for-building-a-linux-web-server\/\"},\"wordCount\":795,\"publisher\":{\"@id\":\"https:\/\/resizemyimg.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/resizemyimg.com\/blog\/how-to-install-lamp-on-ubuntu-apache-vs-nginx-for-building-a-linux-web-server\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/resizemyimg.com\/blog\/wp-content\/uploads\/2021\/04\/apache-installation-on-linux.jpg\",\"articleSection\":[\"Blog\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/resizemyimg.com\/blog\/how-to-install-lamp-on-ubuntu-apache-vs-nginx-for-building-a-linux-web-server\/\",\"url\":\"https:\/\/resizemyimg.com\/blog\/how-to-install-lamp-on-ubuntu-apache-vs-nginx-for-building-a-linux-web-server\/\",\"name\":\"How to Install LAMP on Ubuntu: Apache vs Nginx for Building a Linux Web Server\",\"isPartOf\":{\"@id\":\"https:\/\/resizemyimg.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/resizemyimg.com\/blog\/how-to-install-lamp-on-ubuntu-apache-vs-nginx-for-building-a-linux-web-server\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/resizemyimg.com\/blog\/how-to-install-lamp-on-ubuntu-apache-vs-nginx-for-building-a-linux-web-server\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/resizemyimg.com\/blog\/wp-content\/uploads\/2021\/04\/apache-installation-on-linux.jpg\",\"datePublished\":\"2026-10-15T00:27:38+00:00\",\"dateModified\":\"2026-10-15T00:35:46+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/resizemyimg.com\/blog\/how-to-install-lamp-on-ubuntu-apache-vs-nginx-for-building-a-linux-web-server\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/resizemyimg.com\/blog\/how-to-install-lamp-on-ubuntu-apache-vs-nginx-for-building-a-linux-web-server\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/resizemyimg.com\/blog\/how-to-install-lamp-on-ubuntu-apache-vs-nginx-for-building-a-linux-web-server\/#primaryimage\",\"url\":\"https:\/\/resizemyimg.com\/blog\/wp-content\/uploads\/2021\/04\/apache-installation-on-linux.jpg\",\"contentUrl\":\"https:\/\/resizemyimg.com\/blog\/wp-content\/uploads\/2021\/04\/apache-installation-on-linux.jpg\",\"width\":1289,\"height\":569,\"caption\":\"Apache can be installed quickly, even on Linux systems\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/resizemyimg.com\/blog\/how-to-install-lamp-on-ubuntu-apache-vs-nginx-for-building-a-linux-web-server\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/resizemyimg.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Install LAMP on Ubuntu: Apache vs Nginx for Building a Linux Web Server\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/resizemyimg.com\/blog\/#website\",\"url\":\"https:\/\/resizemyimg.com\/blog\/\",\"name\":\"Resize my Image Blog\",\"description\":\"News, insights, tips&amp;tricks on image related business &amp; SaaS\",\"publisher\":{\"@id\":\"https:\/\/resizemyimg.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/resizemyimg.com\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/resizemyimg.com\/blog\/#organization\",\"name\":\"WebFactory Ltd\",\"url\":\"https:\/\/resizemyimg.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/resizemyimg.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/resizemyimg.com\/blog\/wp-content\/uploads\/2019\/12\/webfactory_icon.png\",\"contentUrl\":\"https:\/\/resizemyimg.com\/blog\/wp-content\/uploads\/2019\/12\/webfactory_icon.png\",\"width\":300,\"height\":300,\"caption\":\"WebFactory Ltd\"},\"image\":{\"@id\":\"https:\/\/resizemyimg.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/webfactoryltd\/\",\"https:\/\/x.com\/webfactoryltd\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/resizemyimg.com\/blog\/#\/schema\/person\/4bece8cd1b5bcd61a4e5dab002eb7dca\",\"name\":\"Jame Miller\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/resizemyimg.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/f60a3114f608fcfdd6b15a13f37f24b2?s=96&d=monsterid&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/f60a3114f608fcfdd6b15a13f37f24b2?s=96&d=monsterid&r=g\",\"caption\":\"Jame Miller\"},\"description\":\"I'm Jame Miller, a cybersecurity analyst and blogger. Sharing knowledge on online security, data protection, and privacy issues is what I do best.\",\"url\":\"https:\/\/resizemyimg.com\/blog\/author\/jamesm\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Install LAMP on Ubuntu: Apache vs Nginx for Building a Linux Web Server","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:\/\/resizemyimg.com\/blog\/how-to-install-lamp-on-ubuntu-apache-vs-nginx-for-building-a-linux-web-server\/","og_locale":"en_US","og_type":"article","og_title":"How to Install LAMP on Ubuntu: Apache vs Nginx for Building a Linux Web Server","og_description":"For most Ubuntu web servers, install Apache if you want the simplest LAMP setup, and choose Nginx with PHP FPM if you expect heavy traffic or plan to run several sites behind one server. Ubuntu LTS is a strong base because it receives five years of standard security maintenance, which matters when the server will stay online for years [source: Ubuntu]. Strictly speaking, LAMP means Linux, Apache, MySQL, PHP. If you use Nginx instead of Apache, the stack is usually called LEMP, but the goal is the same: serve PHP applications from a Linux server. Read more","og_url":"https:\/\/resizemyimg.com\/blog\/how-to-install-lamp-on-ubuntu-apache-vs-nginx-for-building-a-linux-web-server\/","og_site_name":"Resize my Image Blog","article_publisher":"https:\/\/www.facebook.com\/webfactoryltd\/","article_published_time":"2026-10-15T00:27:38+00:00","article_modified_time":"2026-10-15T00:35:46+00:00","og_image":[{"width":1289,"height":569,"url":"https:\/\/resizemyimg.com\/blog\/wp-content\/uploads\/2021\/04\/apache-installation-on-linux.jpg","type":"image\/jpeg"}],"author":"Jame Miller","twitter_card":"summary_large_image","twitter_creator":"@webfactoryltd","twitter_site":"@webfactoryltd","twitter_misc":{"Written by":"Jame Miller","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/resizemyimg.com\/blog\/how-to-install-lamp-on-ubuntu-apache-vs-nginx-for-building-a-linux-web-server\/#article","isPartOf":{"@id":"https:\/\/resizemyimg.com\/blog\/how-to-install-lamp-on-ubuntu-apache-vs-nginx-for-building-a-linux-web-server\/"},"author":{"name":"Jame Miller","@id":"https:\/\/resizemyimg.com\/blog\/#\/schema\/person\/4bece8cd1b5bcd61a4e5dab002eb7dca"},"headline":"How to Install LAMP on Ubuntu: Apache vs Nginx for Building a Linux Web Server","datePublished":"2026-10-15T00:27:38+00:00","dateModified":"2026-10-15T00:35:46+00:00","mainEntityOfPage":{"@id":"https:\/\/resizemyimg.com\/blog\/how-to-install-lamp-on-ubuntu-apache-vs-nginx-for-building-a-linux-web-server\/"},"wordCount":795,"publisher":{"@id":"https:\/\/resizemyimg.com\/blog\/#organization"},"image":{"@id":"https:\/\/resizemyimg.com\/blog\/how-to-install-lamp-on-ubuntu-apache-vs-nginx-for-building-a-linux-web-server\/#primaryimage"},"thumbnailUrl":"https:\/\/resizemyimg.com\/blog\/wp-content\/uploads\/2021\/04\/apache-installation-on-linux.jpg","articleSection":["Blog"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/resizemyimg.com\/blog\/how-to-install-lamp-on-ubuntu-apache-vs-nginx-for-building-a-linux-web-server\/","url":"https:\/\/resizemyimg.com\/blog\/how-to-install-lamp-on-ubuntu-apache-vs-nginx-for-building-a-linux-web-server\/","name":"How to Install LAMP on Ubuntu: Apache vs Nginx for Building a Linux Web Server","isPartOf":{"@id":"https:\/\/resizemyimg.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/resizemyimg.com\/blog\/how-to-install-lamp-on-ubuntu-apache-vs-nginx-for-building-a-linux-web-server\/#primaryimage"},"image":{"@id":"https:\/\/resizemyimg.com\/blog\/how-to-install-lamp-on-ubuntu-apache-vs-nginx-for-building-a-linux-web-server\/#primaryimage"},"thumbnailUrl":"https:\/\/resizemyimg.com\/blog\/wp-content\/uploads\/2021\/04\/apache-installation-on-linux.jpg","datePublished":"2026-10-15T00:27:38+00:00","dateModified":"2026-10-15T00:35:46+00:00","breadcrumb":{"@id":"https:\/\/resizemyimg.com\/blog\/how-to-install-lamp-on-ubuntu-apache-vs-nginx-for-building-a-linux-web-server\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/resizemyimg.com\/blog\/how-to-install-lamp-on-ubuntu-apache-vs-nginx-for-building-a-linux-web-server\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/resizemyimg.com\/blog\/how-to-install-lamp-on-ubuntu-apache-vs-nginx-for-building-a-linux-web-server\/#primaryimage","url":"https:\/\/resizemyimg.com\/blog\/wp-content\/uploads\/2021\/04\/apache-installation-on-linux.jpg","contentUrl":"https:\/\/resizemyimg.com\/blog\/wp-content\/uploads\/2021\/04\/apache-installation-on-linux.jpg","width":1289,"height":569,"caption":"Apache can be installed quickly, even on Linux systems"},{"@type":"BreadcrumbList","@id":"https:\/\/resizemyimg.com\/blog\/how-to-install-lamp-on-ubuntu-apache-vs-nginx-for-building-a-linux-web-server\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/resizemyimg.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to Install LAMP on Ubuntu: Apache vs Nginx for Building a Linux Web Server"}]},{"@type":"WebSite","@id":"https:\/\/resizemyimg.com\/blog\/#website","url":"https:\/\/resizemyimg.com\/blog\/","name":"Resize my Image Blog","description":"News, insights, tips&amp;tricks on image related business &amp; SaaS","publisher":{"@id":"https:\/\/resizemyimg.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/resizemyimg.com\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/resizemyimg.com\/blog\/#organization","name":"WebFactory Ltd","url":"https:\/\/resizemyimg.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/resizemyimg.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/resizemyimg.com\/blog\/wp-content\/uploads\/2019\/12\/webfactory_icon.png","contentUrl":"https:\/\/resizemyimg.com\/blog\/wp-content\/uploads\/2019\/12\/webfactory_icon.png","width":300,"height":300,"caption":"WebFactory Ltd"},"image":{"@id":"https:\/\/resizemyimg.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webfactoryltd\/","https:\/\/x.com\/webfactoryltd"]},{"@type":"Person","@id":"https:\/\/resizemyimg.com\/blog\/#\/schema\/person\/4bece8cd1b5bcd61a4e5dab002eb7dca","name":"Jame Miller","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/resizemyimg.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/f60a3114f608fcfdd6b15a13f37f24b2?s=96&d=monsterid&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/f60a3114f608fcfdd6b15a13f37f24b2?s=96&d=monsterid&r=g","caption":"Jame Miller"},"description":"I'm Jame Miller, a cybersecurity analyst and blogger. Sharing knowledge on online security, data protection, and privacy issues is what I do best.","url":"https:\/\/resizemyimg.com\/blog\/author\/jamesm\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/resizemyimg.com\/blog\/wp-json\/wp\/v2\/posts\/13628"}],"collection":[{"href":"https:\/\/resizemyimg.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/resizemyimg.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/resizemyimg.com\/blog\/wp-json\/wp\/v2\/users\/91"}],"replies":[{"embeddable":true,"href":"https:\/\/resizemyimg.com\/blog\/wp-json\/wp\/v2\/comments?post=13628"}],"version-history":[{"count":1,"href":"https:\/\/resizemyimg.com\/blog\/wp-json\/wp\/v2\/posts\/13628\/revisions"}],"predecessor-version":[{"id":13673,"href":"https:\/\/resizemyimg.com\/blog\/wp-json\/wp\/v2\/posts\/13628\/revisions\/13673"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/resizemyimg.com\/blog\/wp-json\/wp\/v2\/media\/2999"}],"wp:attachment":[{"href":"https:\/\/resizemyimg.com\/blog\/wp-json\/wp\/v2\/media?parent=13628"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/resizemyimg.com\/blog\/wp-json\/wp\/v2\/categories?post=13628"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/resizemyimg.com\/blog\/wp-json\/wp\/v2\/tags?post=13628"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}