XAMPP stands for cross-platform(X), Apache(A) server, MariaDB(M), PHP(P) and Perl(P). It is built by Apache Friends and basically serves as a local host or a local server. Through this local server, you can install this software on your system and test the clients or your website before uploading it to the remote web server or computer. XAMPP is most widely known by Windows users, but there are XAMPP packages for Ubuntu Linux as well. In this article, we will describe a step-by-step method for installing this application stack on your system. You can then verify the installation by using a few URLs. You can also go through the uninstall process that will help you in uninstalling the software if the need arises.
The commands and procedures described in this article have been run on an Ubuntu 20.04 LTS system.
Installing XAMPP on Ubuntu 20.04
Please follow the following steps in order to download, install and configure XAMPP on your system:
Step 1: Download the installation package
The first step is to download the XAMPP package for Linux from the official Apache Friends website:
Click on the XAMPP for Linux option after which you will be prompted to Run the package or Save it to your system. We recommend downloading the package by clicking the Save File option. After which, your downloaded file will be saved to the Downloads folder by default.
Step 2: Make the installation package executable
We will install the package through the Ubuntu command line, The Terminal. In order to open the Terminal, either use the Dash or the Ctrl+Alt+T shortcut. After the Terminal is open, you need to move to your Downloads folder to access the file.
Move to the Downloads folder by using the following command:
$ cd /home/[username]/Downloads
The installation package you downloaded needs to be made executable before it can be used further. Run the following command for this purpose:
$ chmod 755 [package name]
$ chmod 755 xampp-linux-*-installer.run
Now the install package is in an executable form.
Step 3: Confirm execute permission
It is important to verify if the package can be executed by the current user. The execute permission can be checked through the following command:
$ ls -l [package name]
$ ls -l xampp-linux-x64-8.0.3-0-installer.run
The -rwxr output shows that the file can be executed by the user whose name is also mentioned in the output.
Step 4: Launch the Setup Wizard
As a privileged root user, run the following command in order to launch the graphical setup wizard.
$ sudo ./[package name]
This will launch the Setup wizard that will direct you with the rest of the installation procedure.
Step 5: Work through the graphical setup wizard
Now that the Setup Wizard for XAMPP by Bitnami is launched as follows, click the Next button to start the installation process:
The following dialog lets you choose XAMPP components that you want to install.
Keep the default settings intact and then click Next. The following dialog will inform you about the location where XAMPP will be installed.
Click Next to begin the installation process:
When the installation is complete, click the Next button. The following dialog indicates the completion of the installation process.
If you do not want to Launch XAMPP at this moment, uncheck the Launch XAMPP option. Also, click Finish to close the Setup dialog.
Step 6: Launch XAMPP through the Terminal
In order to launch XAMPP through your Ubuntu Terminal, enter the following command as root:
$ sudo /opt/lampp/lampp start
This output shows that XAMPP is started and already running. Please note that you need to manually start XAMPP each time you restart your system.
If you get the following output after starting XAMPP, it means that Net Tools are not installed on your system:
In order to install Net Tools, run the following command as root:
$ sudo apt install net-tools
After the installation of Net Tools, you will be successfully able to launch and use XAMPP.
Step 7: Verify Installation
After you have installed XAMPP on your Ubuntu system, it is good practice to verify the installation. To do so, enter the following URL in your Firefox browser:
The following webpage verifies that XAMPP is successfully installed and running on your system:
You can also verify the installation of phpMyAdmin in a similar manner by entering the following URL in your browser:
The following webpage verifies that phpMyAdmin is successfully installed and running on your system:
It is also important to learn how to completely uninstall and remove XAMPP from your Ubuntu system if you ever need to do so.
Open your Ubuntu Terminal and move to the directory where XAMPP is installed. That is:
$ cd /opt/lampp
The next step is to run the uninstall program you will find in the lampp folder through the following command:
$ sudo ./uninstall
The following dialog will appear asking you if you want to uninstall XAMPP and all of its modules:
$ sudo ./uninstall
Provide the password then press <enter>
The system will ask for your confirmation before proceeding. Type Y then hit enter to confirm your selection.
After some time, the Uninstallation completed information will be displayed in the output to confirm the uninstallation process.
Finally, you can remove the directory using:
$ sudo rm -r /opt/lampp
Now, XAMPP and all its modules are uninstalled from your system. You can also delete the downloaded install package if you want.
In this tutorial, you have learned a step-by-step installation process for XAMPP on your Ubuntu System. From downloading the install package, running it, and then verifying the installation, you have walked through the entire procedure with us. We have also provided enough information about uninstalling XAMPP if you ever need to do that.