In this tutorial, you will learn how to install XAMPP on Linux.
XAMPP supports multiple operating systems, including Linux.
XAMPP can be easily installed on Linux, by using the XAMPP installer that you can download from the official XAMPP website.
If you are a PHP developer, and want a PHP environment on your machine, then all you need is XAMPP installed on your computer. As by having XAMPP installed, allows you to code on PHP and run PHP projects on your local machine, without having to use a server.
Install XAMPP on Linux
Step 1 - Download XAMPP
XAMPP can be easily downloaded from the official XAMPP website. First, you need to navigate to the XAMPP website
https://www.apachefriends.org/
Next, click to "XAMPP for Linux" to download XAMPP for linux.
Step 2 - Install XAMPP
Now that XAMPP has been downloaded on your system, you can proceed to install it.
Installing XAMPP on Linux is quite simple, as all you have to do is run the installer that you downloaded.
Assuming XAMPP installer was downloaded on Downloads directory, first you need to change directory to Downloads.
cd Downloads
To verify that XAMPP installer is located in the Downloads directory, you can use the ls command as below.
ls *run
As you can see, xampp installer was downloaded and it is located in the Downloads directory.
Now you can proceed to install XAMPP.
Before running XAMPP installer, you need to make sure that you can run the installer, by making the installer executable.
chmod 755 xampp-linux-x64-8.2.12-0-installer.run
Now to install XAMPP, simply run the installer, by executing the command below.
sudo ./xampp-linux-x64-8.2.12-0-installer.run
Next, you will be asked to authenticate in order to run the installer, so enter your password and then press enter.
And XAMPP installer will start as shown in the screenshot below. Simply click "Forward" to proceed installing XAMPP.
Next, you need to choose which XAMPP components you want to install. In this tutorial, we are installing both components, "XAMPP Core Files" and "XAMPP Developer files", so make sure to check both boxes and click "Forward" button if you want to install both components.
Next, XAMPP will tell you where it will be installed on your system, all you need to do here is click "Forward" to continue installing XAMPP.
This is the final step, in this step you need to click "Forward" button again to install XAMPP on your system.
And XAMPP will be installing on your system. All you need to do in this step is wait for the XAMPP installer to finish.
Once XAMPP is installed, you will see the following window. Simply click "Finish" button to close the installer and launch XAMPP manager.
And XAMPP manager will start.
Step 3 - Run XAMPP
XAMPP is now installed on your system, so you can proceed to run XAMPP.
XAMPP won't start automatically by default, so you need to start it manually.
Starting XAMPP is quite simple, and it can be done via the terminal.
To do so, simply run the command below.
sudo /opt/lampp/lampp start
And xampp will start.
Next, you can navigate to the localhost IP to see if XAMPP is working
127.0.0.1
As you can see, XAMPP is now running on our system.
Step 4 - Manage XAMPP
When it comes to managing a XAMPP server, you must know the essential commands, for starting, restarting and stopping XAMPP.
To start XAMPP you can do so by using the start command.
sudo /opt/lampp/lampp start
To restart XAMPP, you can do so by using the restart command.
sudo /opt/lampp/lampp restart
To stop XAMPP, simply use the stop command.
sudo /opt/lampp/lampp stop
Alternatively, managing XAMPP can also be done by using the XAMPP manager. To start XAMPP manager, run the command below.
Uninstall XAMPP on Linux
If you no longer need XAMPP, or simply want to uninstall it to do a fresh install, then you can easily uninstall XAMPP via the terminal.
To do so, first run the command below.
sudo /opt/lampp/uninstall
Next, confirm that you want to uninstall XAMPP. To do so, simply click "Yes".
Once XAMPP is uninstalled, you will see the following prompt. All you need to do now is click the "Ok" button.
Conclusion
In this tutorial, you learned how to install XAMPP on Linux, and how to start XAMPP after installing it.