The LAMP stack — Linux, Apache, MySQL/MariaDB, PHP — runs a huge share of the web. Here's how to install it on Ubuntu or Debian.
1. Install Apache
sudo apt update
sudo apt install apache2 -y
sudo ufw allow 'Apache Full'
2. Install the database
sudo apt install mariadb-server -y
sudo mysql_secure_installation
3. Install PHP
sudo apt install php libapache2-mod-php php-mysql -y
sudo systemctl restart apache2
4. Test PHP
Create /var/www/html/info.php with <?php phpinfo(); ?> and visit it in your browser (then delete it).
5. Set up a virtual host
Add a config in /etc/apache2/sites-available/, enable it with a2ensite, and reload Apache. Add HTTPS with sudo certbot --apache.
Your LAMP server is ready for WordPress, Laravel, or any PHP application — with the dedicated resources of a VPS behind it.