Back when I used XAMPP on Windows, everything felt straightforward—just a few clicks, and it was up and running. But switching to Ubuntu was a different story; I had to navigate a few hurdles before figuring out the best way to install XAMPP on Ubuntu properly. To save you time and effort, this guide will walk you through each step, ensuring a smooth installation process. You’ll also learn how to create shortcuts for easier access, making XAMPP more convenient to use on Ubuntu.

Step 1: Update system
First, before starting to install XAMPP, make sure you have your Ubuntu system up to date. You can do this using the commands below in terminal:
sudo apt update; sudo apt upgrade
Step 2: Download XAMPP
Next, click to download the latest XAMPP from the official Apache Friends website, select the version of XAMPP suitable for your Ubuntu operating system, and download the installation file.

Step 3: Install Xampp
The files previously downloaded often reside in the “~/Downloads” directory, now you will need to grant executable permission to the file and install XAMPP using the following command:
cd ~/Downloads
chmod +x xampp-linux-x64-xx-installer.run
Where “xx” is your downloaded version. In this tutorial, we downloaded the version “xampp-linux-x64-8.2.4-0-installer.run”. So after granting execute permission, I will run the following command to install XAMPP on my Ubuntu 22.04:
sudo ./xampp-linux-x64-8.2.4-0-installer.run
The installation process will proceed, simply click “Forward” to accept the default location at “/opt/lampp” and continue clicking “Next” until reaching “Finish”. (similar to the screenshot)

Step 4: Start Xampp using terminal
After completing the install Xampp you can start Xampp with the command below and switch to the manager server tab to start Apache and MYSQL Database.
sudo /opt/lampp/./manager-linux-x64.run

XAMPP will start running and you can access your web browser by typing “http://localhost” in the address bar. You will see the XAMPP management interface where you can manage web services like Apache, MySQL, FileZilla.
Step 5: Create Xampp shortcut on desktop
At first, starting XAMPP felt like a chore—I had to open the terminal and type a command every time. It wasn’t a huge problem, but it did get annoying fast. So, I figured out a way to create a handy shortcut—just like on Windows—allowing me to start it with a single click. To simplify this process, you can create a XAMPP shortcut icon, similar to Windows. To achieve this, open a terminal and execute the following command to create the file “‘xampp.desktop”:
sudo nano /usr/share/applications/xampp.desktop
Then copy this code and paste it into the xampp.desktop
file, press the “Ctrl + X” key combination and select “Y” to save the file.
[Desktop Entry]
Version=1.0
Type=Application
Name=XAMPP
Exec=sudo /opt/lampp/manager-linux-x64.run
Icon=/opt/lampp/htdocs/favicon.ico
Terminal=false
StartupNotify=false
[Desktop Action Manager]
Name=XAMPP
Exec=sudo /opt/lampp/manager-linux-x64.run

Go ahead, give sudo permission to the “xampp.desktop” shortcut to run on the desktop to open xampp on Ubuntu. To do this run the command “sudo visudo” and add the code “your-user ALL = NOPASSWD: /opt/lampp/manager-linux-x64.run” to the end of the file.
sudo visudo
your-user ALL = NOPASSWD: /opt/lampp/manager-linux-x64.run
Where “ your-user ” is your Ubuntu login account, my example is itsmeit, so I will enter itsmeit like screenshot:

Okay, now you can find “Xampp” in the application list (Menu) and click “Add to Favorites” to add Xampp to the taskbar. From now on you can click on the Xampp icon and open xampp on Ubuntu without having to run a command every time you want to start or shut down/pause.

Recommendations:
- If you are a beginner, start with XAMPP to simplify the installation and usage process.
- When you become more familiar with system administration and web development, you can switch to using Nginx and PHP + MySQL for better performance and security.
If you want to completely remove the XAMPP server from your system, see the command you can use. But first, stop MySQL and Apache on XAMPP.
sudo /opt/lampp/./uninstall
sudo rm /usr/share/applications/xampp.desktop
I still remember the thrill of seeing my first local web project come to life—no need for a real server, just my own machine. Now, you can do the same, right from your own machine!