How to install XAMPP (LAMPP) in Ubuntu: Easiest Way

Please note: I highly recommend you to install Apache, PHP & MySQL all-in-one by typing the following 2 commands in terminal:

sudo apt-get install tasksel
sudo tasksel install lamp-server

Awesome! Done… If you’d like to install PHPMyAdmin also type:

sudo apt-get install phpmyadmin

However, you can also read the old article below, which involves downloading an old version of LAMPP thus probably, compromising security!

What is LAMPP? It’s the old name for “XAMPP for Linux” – the all-in-one package of Apache, PHP, MySQL, PHPMyAdmin, PEAR & other packages to run a server. More information available here.

How to Install LAMPP/XAMPP for Linux (Deprecated!)

1. Download LAMPP

Download the latest version of LAMPP. Copy the downloaded file to your desired folder. Rename it to xampp.tar.gz (this is very important, unless you rename it appropriately the installer cannot run!)

2. Download Installer

Download the installer scripts from here. Unzip the zip file and copy two files ‘‘ and ‘python.txt‘ to same folder where the downloaded xampp file (xampp.tar.gz)  exists.

You can also download the installer from here.

3. Run Installer

Double click and open, and run at terminal. Enter the directory path where you want to install xampp.

Note: You should have execution permission to this file “”

You’re done! 🙂

To run lampp, open a terminal and type

sudo <INSTALL-LOCATION>/lampp/lampp start

if you installed LAMPP at /opt directory, you should type:

sudo /opt/lampp/lampp start

To Stop Lampp, type:

sudo <INSTALL-LOCATION>/lampp/lampp stop

You also have a graphical Control Panel, which can be accessed from: Application menu under Internet – in my old versions of Ubuntu!

To Setup security issues, we recommend you to fix security holes:

sudo sudo <INSTALL-LOCATION>/lampp/lampp security

The installer has been made from the guidelines available Ubuntu forums.


10 thoughts on “How to install XAMPP (LAMPP) in Ubuntu: Easiest Way

  1. i renamed the file but after rename file and run the install command
    show me “ERROR: xampp.tar.gz was not found in this directory”
    what should i do?

    please help

    1. It should work! (working in my ubuntu)

      Please be sure you:

      – Renamed the downloaded *.tar.gz correctly to xampp.tar.gz, i.e. no capitalization allowed
      – Copied the file xampp.tar.gz to the directory where you script exists

      Now try running the script. It should work.

      However, if it still fails, open the file with a text editor and edit the 3rd line. Replace the line with this text:
      if test -f "./xampp.tar.gz"

  2. Dear Sir,
    Thank you very much for this script. I have however run into a problem, which if you can spare five minutes I’d be very grateful for your help with.

    The location i want to install xampp to is a usb stick. My computer is nearly dead due to virtually catastrophic HD failure, and I have to run Ubuntu from a CD. My idea was to keep the whole site on a stick.

    when running your handy script, I get ‘cannot change ownership to uid 0, gid 0: operation not permitted’

    How can I fix this please?

    Also i have no idea what the su user password is, so don’t think I can change permissions for access.

    Is this fatal?

    Thank you very much indeed,
    K H

    1. Istalling to a usb stick would be tough, If the file system for the usb-stick is NTFS/FAT32 , try to change file permission to run as executable (by right clicking on the file icon > Properties > Permissions ). If you are not allowed to put check mark on Allow executing file as Program, you have to enable “execution” bit (which can be difficult) for the usb-stick by editing /etc/fstab file.

      But I wonder how you’ll be editing your etc/fstab file when running from a live cd! 😐

      The sudo password is just the password of your own user account. But in a live CD, you’ll not be asked for password when you use sudo, see this discussion for more info:

  3. how to install this xampp. i can locate the index file but i can not locate where the install was done …thus i can not create a stop and start for the webserver.

Comments are closed.