From https://www.apachefriends.org/download.html website download xampp-linux-x64-7.4.3-0-installer.run .Put it inside Downloads folder.
Then open ubuntu terminal.
cd Downloads . Hit Enter
Then give the execute permission by : chmod +x ./xampp-linux-x64-7.4.3-0-installer.run .And Hit Enter
After that enter the below command sudo ./xampp-linux-64-7.4.3-0-installer.run .And Hit Enter.
To open the xampp write: sudo /opt/lampp/manager-linux-x64.run and hit enter.
Access Url: http://localhost
Phpmyadmin url : http://localhost/phpmyadmin/
Troubleshooting: If apache and mysql service is not starting through xampp control panel then from the terminal stop apache and mysql service by below command:
sudo /etc/init.d/apache2 stop
sudo /etc/init.d/mysql stop