ItsmeITItsmeIT
  • Linux
    • Debian
    • Ubuntu
  • PC/Windows
Reading: How to Install XAMPP on Ubuntu 22.04/24.04 LTS
Share
Notification Show More
Font ResizerAa
ItsmeITItsmeIT
Font ResizerAa
  • Categories
    • Linux
    • Debian
    • Ubuntu
    • PC/Windows
Have an existing account? Sign In
Follow US
© 2025 ItsmeIT. All rights reserved.

Home » Linux » Ubuntu » How to Install XAMPP on Ubuntu 22.04/24.04 LTS

How to Install XAMPP on Ubuntu 22.04/24.04 LTS

avatar
By
Loibv
avatar
ByLoibv
The ItsmeIT team – delivering cutting-edge updates, tech trends, and insider knowledge from the world of technology.
Follow:
Last updated: March 22, 2025

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.

Install XAMPP 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.

download XAMPP linux
download XAMPP

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)

Install Xampp on Ubuntu 22.04
Install Xampp on Ubuntu 22.04

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
Using terminal start Xampp
Using terminal start Xampp

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
create Xampp shortcut
create Xampp shortcut on Ubuntu Desktop

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:

create Xampp shortcut Ubuntu

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.

add xampp taskbar
add xampp taskbar

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!

Share This Article
Facebook Reddit Telegram Threads
avatar
ByLoibv
Follow:
The ItsmeIT team – delivering cutting-edge updates, tech trends, and insider knowledge from the world of technology.
Leave a Comment

Leave a Reply Cancel reply

You must be logged in to post a comment.

Most Popular

install wordpress nginx
How to Install WordPress on Ubuntu 22.04/24.04 with Nginx, MariaDB, PHP8.2 (LEMP)
Scan Virus Ubuntu
3 Best Ways to Detect and Remove Malware on Ubuntu/Linux
boot virtualbox from usb
How to Boot from USB in VirtualBox on Ubuntu/Linux
Install SSL Localhost Ubuntu
How to Install SSL on Localhost in Ubuntu / Linux?
fix login error Gnome Online Accounts Ubuntu 22.04
How to Fix GNOME Online Accounts Login Issues on Ubuntu 22.04
Previous Next
ItsmeITItsmeIT
Follow US
© 2025 ItsmeIT. All Rights Reserved.
  • Privacy Policy
  • Terms of Service
Logo ItsmeIT logo
Welcome Back!

Sign in to your account

Continue with Google
Register   |Lost your password?