To install the LAMP stack on Ubuntu 22.04 LTS, follow these steps.

  1. Using apt, update the Ubuntu packages:
    sudo apt update && sudo apt upgrade
  2. Install the Apache web server using 
    apt:sudo apt install apache2
  3. Install the MySQL web server:
    sudo apt install mysql-server
  4. Install PHP, along with additional PHP modules for Apache and MySQL:
    sudo apt install php libapache2-mod-php php-mysql
  5. (Optional) Install the following commonly-used PHP modules.
    sudo apt install php-curl php-json php-cgi
  6. (Optional) To host a WordPress site on the server, install the following PHP components:
    sudo apt install php-curl php-gd php-mbstring php-xml php-xmlrpc
Ubuntu 22.04 LAMP Installation

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.