How to install XAMPP on Ubuntu 16.04

In this post we will see How to install XAMPP in Ubuntu 16.04.

Step 1 :
Open the link in your favorite browser and download the latest version of LAMPP software that you want for Ubuntu Linux.

download apache Xampp file

download file

STEP 2. Open your Terminal and Change directory to the Downloads folder (by default it downloads into the Downloads folder)

$ cd Downloads

STEP 3. Change the execution rights if the installation file, So we can run it as executable file. Execute this command

sudo chmod +x

Note : The version of XAMPP you’ll download might be different, so change the version in this command accordingly.

For above command to run you have to provide your system’s password


Run the installer, but don’t close the Terminal.

$ sudo ./

A installation set up dialog box will open. In the dialog box, click next(for each step) and move through the process of installation. Once XAMPP is installed, click finish.

xampp install 1

Click Next !

xampp install 2

Click Next !

xampp install 3

Click Next !

xampp install 4

Click Next !

xampp install 5

Click Finish!

xampp install finish

This will launch the Xampp control panel like shown below. Here Click “Manage servers“.

xampp control panel

Now start all three services by pressing start all button.

start all services


You can also use the commands below to run the Xampp control panel.

  • If you use a 64-bit system:
    sudo /opt/lampp/

Once all Apache server is running .  You can use the URL http://localhost/dashboard to open the Dashboard.

apache dashboard

You can also verify if phpmyadmin is running by opening the URL http://localhost/phpmyadmin.

apache phpmyadmin

Now Lets try to run some PHP code using our Apache server. For that you need to create a php file in the htdocs directory of Xampp. htdocs is generally located in /opt/lampp/htdocs/. Create a php file with the name myphp.php with the following code:

echo "Hello world!";

Now we will change the permission of the files in htdocs using the following command

sudo chmod +x -R /opt/lampp/htdocs/

Now open the URL http://localhost/myphp.php. You will see Hello World printed on your browser.

php hello world

Thats it.

Some More helpful commands

  1. To set a password, type
    ./lampp security

    Press y + Enter. Then enter a new password and re-enter this password again to confirm.

  2. Start XAMPP
    ./xampp start

    Type exit(Enter) to exit the SuperUser

  3. To start XAMPP, execute this command
    sudo /opt/lampp/lampp start
  4. To stop XAMPP, execute this command
    sudo /opt/lampp/lampp stop



Video Instructions

Partner Sites


Leave a Reply

Your email address will not be published.