Install LAMP server on ubuntu ec2 instance Connect to the EC2 Instance: Use PuTTY with the instance's public IP and private key, or the EC2 Console's “Connect” option (EC2 Instance Connect) to access your instance sudo apt update sudo apt upgrade sudo apt install apache2 -y sudo apt install mysql-server -y sudo apt install php libapache2-mod-php php-mysql -y sudo systemctl restart apache2 sudo nano /var/www/html/info.php http://your-public-ip/info.php