In this comprehensive guide, we’ll walk you through the process of install XAMPP on Linux. Whether you’re using Ubuntu, Fedora, or any other Linux distribution, the steps will be simple and easy to follow. Let’s get started!
If you’re a developer looking to set up a local server environment on your Linux system, XAMPP is one of the most popular solutions available. XAMPP is a free, open-source platform that allows you to create a local server with Apache, MySQL/MariaDB, PHP, and Perl, all bundled together. This is perfect for developers who want to test their websites or applications locally before deploying them live.
What is XAMPP and Why Should You Use It?
XAMPP Overview
XAMPP is a cross-platform web server solution that bundles several powerful tools for web development:
- Apache: An open-source web server software used to serve web content.
- MySQL/MariaDB: A database management system for storing and managing data.
- PHP: A server-side scripting language used to create dynamic web pages.
- Perl: A high-level programming language used for various web development tasks.
These components are packaged together in XAMPP, making it a one-stop solution for setting up a local development environment. By installing XAMPP on your Linux machine, you can easily test, develop, and deploy web applications locally before pushing them to a live server.
Why Use XAMPP on Linux?
XAMPP is widely popular due to its ease of use and powerful features:
- Cross-Platform: XAMPP is available for Linux, Windows, and macOS, making it suitable for developers working on different operating systems.
- All-in-One Package: XAMPP includes everything you need to start developing right away, without having to install each component separately.
- Free and Open Source: XAMPP is completely free to download and use, making it a cost-effective option for developers of all experience levels.
- Ideal for Beginners: With an intuitive user interface, XAMPP is easy to install and configure, even for those new to web development.
Now that we know what XAMPP is and why it’s beneficial, let’s dive into the installation process on Linux.
System Requirements for Install XAMPP on Linux
Before you begin, make sure your Linux system meets the following requirements:
Minimum System Requirements
- Linux Distribution: XAMPP is compatible with most major Linux distributions, including Ubuntu, Fedora, Debian, CentOS, and more.
- Processor: 32-bit or 64-bit processor.
- RAM: At least 2GB of RAM is recommended for smooth performance.
- Disk Space: At least 1GB of free disk space for the installation.
Ensure that your Linux distribution is up to date for optimal performance during the installation process.

Step-by-Step Guide to Install XAMPP on Linux
Follow these steps to install XAMPP on your Linux system:
Step 1: Download XAMPP for Linux
- Visit the Official XAMPP Website: Go to the official XAMPP website: https://www.apachefriends.org/index.html.
- Select the Linux Version: On the download page, select the appropriate version of XAMPP for your Linux distribution.
- Download the Installer: Click on the download button to get the
.run
installer file for Linux. The download should begin automatically.
Once the file has downloaded, locate it in your Downloads folder.
Step 2: Make the XAMPP Installer Executable
Before you can run the installer, you need to give it executable permissions.
- Open a Terminal window.
- Navigate to the directory where the installer file is located (usually your Downloads folder). Use the following command to change the directory:bashCopy
cd ~/Downloads
- Change the file permissions to make the installer executable using the
chmod
command:arduinoCopychmod +x xampp-linux-x64-<version>.run
Replace<version>
with the actual version number of the XAMPP installer.
Step 3: Run the XAMPP Installer
Once the installer is executable, you can run it by typing the following command:
arduinoCopysudo ./xampp-linux-x64-<version>.run
This will launch the XAMPP installation wizard. You’ll need to enter your sudo password to allow the installer to make changes to your system.
Step 4: Follow the Installation Wizard
- The XAMPP setup wizard will open. Follow the on-screen instructions to complete the installation.
- Choose the installation directory for XAMPP. By default, XAMPP installs to
/opt/lampp
, which is the standard directory for most Linux applications. You can change this if you prefer. - Once you’ve selected the directory, the installation will begin. The wizard will extract and install the necessary files.
Step 5: Launch XAMPP Control Panel
Once the installation is complete, you can launch XAMPP and start the servers.
- Open the Terminal again and run the following command to start the XAMPP control panel:bashCopy
sudo /opt/lampp/lampp start
This will start the Apache, MySQL, and ProFTPD services, and you’ll see output indicating that the services are running. - To stop the services, you can run:arduinoCopy
sudo /opt/lampp/lampp stop
Step 6: Verify the Installation
To verify that XAMPP is working correctly, open a web browser and type the following URL:
arduinoCopyhttp://localhost
You should see the XAMPP welcome page, indicating that your local server is running successfully.
Configuring XAMPP After Installation
Now that you’ve installed XAMPP on Linux, here are a few tips to help you configure it for web development.
Accessing the XAMPP Dashboard
To manage your local server, you can use the XAMPP Dashboard:
- Open your web browser and go to
http://localhost/dashboard
. - This dashboard provides links to various management tools such as phpMyAdmin (for managing MySQL databases) and Apache (for configuring your web server).
Setting Up Your Local Website
To start working on your web projects:
- Navigate to the
/opt/lampp/htdocs
folder. This is where you’ll store your website files.bashCopycd /opt/lampp/htdocs
- Create a new folder, for example,
my_website
, and place your HTML, PHP, or other web files in it.arduinoCopymkdir my_website
- Now, you can access your website locally by visiting
http://localhost/my_website
in your browser.
Configuring PHP Settings
You may need to configure PHP settings depending on the requirements of your projects.
- Open the
php.ini
file located in/opt/lampp/etc/php.ini
using a text editor.bashCopysudo nano /opt/lampp/etc/php.ini
- Here, you can change settings such as
upload_max_filesize
,max_execution_time
, or others to suit your project needs. - After making changes, restart XAMPP by running:bashCopy
sudo /opt/lampp/lampp restart
Managing MySQL Databases with phpMyAdmin
XAMPP comes with phpMyAdmin, a web-based interface for managing MySQL databases.
- To access phpMyAdmin, open your browser and go to:arduinoCopy
http://localhost/phpmyadmin
- Here, you can create, manage, and interact with your databases. You can also run SQL queries and perform other database operations.
Troubleshooting Common Issues During Installation
While XAMPP is usually easy to install on Linux, you may encounter a few issues. Here are some common problems and solutions:
Apache or MySQL Not Starting
If Apache or MySQL fails to start, check for the following:
- Port Conflicts: Apache uses port 80 and MySQL uses port 3306 by default. If another application is using these ports, XAMPP won’t be able to start. You can change the ports in the configuration files if needed.
- Permission Issues: Make sure that you have the necessary permissions to start XAMPP. Running XAMPP with
sudo
usually resolves this issue.
“XAMPP Command Not Found” Error
If you get the error “XAMPP command not found” after installation, ensure that the XAMPP directory (/opt/lampp
) is included in your system’s PATH. Alternatively, use the full path to the XAMPP command:
bashCopysudo /opt/lampp/lampp start
Firewall Blocking XAMPP
If your firewall is blocking XAMPP’s services, make sure that you’ve allowed the necessary ports (80 for Apache and 3306 for MySQL). You can disable the firewall temporarily to check if it’s the cause.
Alternatives to XAMPP for Linux Users
While XAMPP is a great choice for local web development, there are other options available for Linux users:
LAMP Stack
The LAMP stack (Linux, Apache, MySQL, PHP) is a popular alternative for Linux users. Unlike XAMPP, LAMP requires manual installation of each component, but it offers more flexibility and control over your development environment.
Docker
Docker allows you to create lightweight containers for web applications. It provides more control over the environment and is ideal for developers who need to manage multiple projects with different configurations.
Vagrant
Vagrant is another tool for managing virtualized development environments. It allows you to create reproducible environments for different operating systems, making it a good choice for cross-platform development.
Conclusion
Install XAMPP on Linux is a straightforward process that sets up a powerful local server environment for your web development projects. By following this guide, you’ve learned how to download, install, and configure XAMPP on your Linux machine. You also know how to troubleshoot common issues and set up your local websites and databases.
Read Also : How to Install XAMPP on Windows?