Here’s how to install a LAMP server on the latest Ubuntu 20.04 LTS.

Install Apache.

<pre lang="bash">apt install apache2
systemctl status apache2
systemctl is-enabled apache2

Install MariaDB.

<pre lang="bash">apt install mariadb-server mariadb-client
systemctl status mariadb
systemctl is-enabled mariadb

Install PHP.

<pre lang="bash">apt install php libapache2-mod-php php-mysql
systemctl restart apache2

Enable ssl and mod_rewrite.

<pre lang="bash">a2enmod ssl
a2enmod rewrite
systemctl restart apache2