To install XAMPP on Ubuntu, first use the "pwd" command to find the current working directory and navigate to where the installation file is saved. Then use the "sudo tar" command to copy the installation file to the "/opt" folder in the file system. Finally, start XAMPP by running the "sudo /opt/lampp/lampp start" command. The installation is now complete.