Table of Contents >> Show >> Hide
- What Is XAMPP, and Why Do Linux Users Still Use It?
- Before You Install XAMPP on Linux
- How to Install XAMPP on Linux Step by Step
- How to Verify That XAMPP Is Working
- Common XAMPP on Linux Problems and How to Fix Them
- Useful XAMPP Paths to Remember on Linux
- Final Thoughts
- Real-World Experiences Installing XAMPP on Linux
- SEO Tags
If you want a local web server on Linux without spending your entire afternoon hand-assembling Apache, MariaDB, PHP, and Perl like a very determined robot, XAMPP is the shortcut. It bundles the classic web development stack into one installer, so you can get a local environment up and running fast, test PHP projects, tinker with databases, and preview sites before they meet the real internet.
That said, Linux users are blessed and cursed with options. You could build a LAMP stack manually. You could use containers. You could spend two hours arguing with your terminal over a port conflict. But if your goal is simple local development, XAMPP is still one of the easiest ways to get moving. In this guide, I’ll walk you through how to install XAMPP on Linux step by step, how to verify that it works, and how to fix the most common issues before they turn into dramatic “why is localhost ignoring me?” moments.
What Is XAMPP, and Why Do Linux Users Still Use It?
XAMPP is a cross-platform development stack that packages Apache, MariaDB, PHP, and Perl into a single installer. On Linux, it installs under /opt/lampp, which keeps most of the XAMPP files in one predictable place. That makes it convenient for developers who want a local server without manually configuring every component from scratch.
The main reason people still choose XAMPP on Linux is speed. It is handy for:
- testing PHP applications locally
- running WordPress on localhost
- learning how Apache and PHP work together
- experimenting with databases in phpMyAdmin
- creating a disposable development environment without touching a live server
There is one important catch, though: XAMPP is meant for development, not production. In plain English, it is great for your laptop or dev machine, but it is not the server setup you want guarding a public website at 2 a.m. while the internet pokes at it with pointy sticks.
Before You Install XAMPP on Linux
Before running the installer, do a quick reality check.
1. Make sure you are downloading the right Linux package
Apache Friends offers Linux installers for multiple PHP branches. Pick the version that matches your project requirements. If your app needs an older PHP version for compatibility, choose that on purpose. If you are starting fresh, go with the newest version your app and plugins support.
2. Expect MariaDB, not old-school MySQL branding
XAMPP on Linux ships with MariaDB. Functionally, that is fine for most local development work, and many developers treat it as a drop-in substitute for MySQL. Still, it is worth knowing so you are not confused when you install “XAMPP with MySQL” and the control panel politely gives you MariaDB instead.
3. Watch out for port conflicts
If Apache, Nginx, MySQL, MariaDB, or another local stack is already running, XAMPP may refuse to start. The usual problem children are port 80 for HTTP, 443 for HTTPS, and 3306 for the database. If XAMPP acts moody after installation, this is one of the first places to look.
4. Know what XAMPP is actually for
XAMPP is best used for local development and testing. Keep phpMyAdmin local, avoid exposing your local machine to the wider network unless you truly need to, and do not confuse “it works on localhost” with “it is ready for production.” Those are cousins, not twins.
How to Install XAMPP on Linux Step by Step
Step 1: Download the XAMPP Installer
Go to the Apache Friends download page and grab the Linux installer. It will typically be a .run file with a name similar to this:
Save it to your Downloads folder or another directory you can find without needing a treasure map.
Step 2: Open the Terminal and Move to the Download Directory
Most Linux browsers save downloads to your home Downloads folder, so the command is often:
If you saved the file somewhere else, switch to that directory instead.
Step 3: Make the Installer Executable
Linux will not run the installer just because you believe in it. You need to give it execute permission first:
You can also use sudo chmod 755 if needed, but for a file in your home directory, regular chmod is usually enough.
Step 4: Run the Installer
Now launch the installer with root privileges:
This should open the graphical setup wizard. If it appears, congratulations: Linux and XAMPP are currently on speaking terms.
Click through the installer, keep the default components unless you have a specific reason to customize them, and let XAMPP install to its default location:
That default path matters because most of the commands you will use later assume XAMPP lives there.
Step 5: Launch the XAMPP Manager
After installation, you can open the graphical manager with:
On some setups, the manager may also be available as:
From the manager, go to Manage Servers and start Apache and MariaDB. If the GUI is not your style, you can use the command line instead.
Step 6: Start and Stop XAMPP from the Terminal
These are the two commands you will probably use most:
If everything goes well, Apache and the database service should start cleanly. If not, do not panic. Linux is just giving you a small character-building exercise.
How to Verify That XAMPP Is Working
Once the services are running, open your browser and check one of these addresses:
If XAMPP is installed correctly, you should see the XAMPP start page or dashboard.
Next, test phpMyAdmin:
If phpMyAdmin opens, your database service is alive and doing its job.
Create a Quick PHP Test File
To confirm that PHP is processing files correctly, create a test file in the XAMPP document root. XAMPP commonly uses:
Create a file named test.php with this content:
Then visit:
If you see the PHP information page, your local server is officially working. Cue the tiny victory dance.
Common XAMPP on Linux Problems and How to Fix Them
Apache Will Not Start
This is the classic one. XAMPP may tell you that Apache is already running, or it may fail with a vague error that sounds like a shrug. Usually, another service is already using port 80.
Check what is listening on port 80:
If another Apache instance, Nginx, or a different local dev stack is already bound to port 80, stop or reconfigure that service. If you would rather keep the other service running, you can change XAMPP’s Apache port in the manager and use something like 8080 instead.
MariaDB or MySQL Is Already Running
XAMPP may also complain that the database daemon is already running. Same story, different port. Check port 3306 and stop the conflicting service if needed. If your system already runs a separate database server, decide which one you actually want to use instead of making them wrestle over the same socket.
Localhost Refuses to Connect
If http://localhost does not load, work through the basics:
- make sure XAMPP is started
- check whether Apache actually launched
- look for a port conflict on 80 or 443
- make sure your browser is not forcing HTTPS when you only configured HTTP
- try another browser before blaming the universe
If you changed Apache to port 8080, remember to visit http://localhost:8080 instead of the default address.
SELinux Gets in the Way
On some RHEL-based distributions, SELinux can block XAMPP from starting correctly. The official XAMPP FAQ suggests temporarily setting SELinux to permissive mode to confirm the issue:
If that fixes it, you have identified the cause. For a longer-term solution, adjust your SELinux policy properly instead of leaving your system more open than necessary.
You Need to Check the Error Log
When Apache still refuses to cooperate, look at the XAMPP error log:
That tiny command can save a lot of guessing. The log usually tells you whether the problem is a missing permission, a port conflict, or a configuration mistake.
Firewall Questions
If you are only using XAMPP on your own machine through localhost, you generally do not need to open firewall rules. If you want to access the server from another device on your network, then you may need to allow HTTP and HTTPS traffic. On Ubuntu, that often means a UFW rule such as:
On firewalld-based systems, it may look more like this:
Only do this if you truly need remote access. Local development is usually happiest when it stays local.
phpMyAdmin Security
By default, phpMyAdmin should stay accessible from localhost only. That is a good thing. Opening it to the outside world just because it sounds convenient is the networking equivalent of leaving your house key under a doormat labeled “house key.”
If you want to harden your XAMPP setup further, run:
This walks through a simple security check, including database passwords and demo-page protection.
Useful XAMPP Paths to Remember on Linux
/opt/lamppthe main XAMPP installation directory/opt/lampp/htdocsyour web root for local projects/opt/lampp/etc/httpd.confApache configuration/opt/lampp/etc/extra/httpd-xampp.confextra XAMPP Apache settings/opt/lampp/etc/php.iniPHP configuration/opt/lampp/etc/my.cnfdatabase configuration/opt/lampp/logs/error_logApache error log
Remembering these paths makes troubleshooting a lot easier. It also makes you look suspiciously prepared, which is always nice.
Final Thoughts
Installing XAMPP on Linux is surprisingly straightforward once you know the order of operations: download the installer, make it executable, run it with sudo, start the services, and test localhost. The real friction usually comes afterward, when another web server is already camping on port 80 or Linux decides your permissions need a little more “character.”
Still, for local PHP development, XAMPP remains a practical tool. It is quick to install, easy to manage, and friendly enough for beginners while still being useful for experienced developers who just want a working local stack without ceremony. Use it for development, keep it reasonably locked down, and let production be someone else’s stress ball.
Real-World Experiences Installing XAMPP on Linux
One of the funniest things about installing XAMPP on Linux is that the installation itself is rarely the scary part. The installer usually behaves. You download the file, run chmod, click through the wizard, and think, “Wow, that was almost suspiciously painless.” Then the real Linux experience begins: you open localhost, and either everything works beautifully or your machine responds with the emotional warmth of a locked bank vault.
A very common experience is the “port 80 surprise.” Someone installs XAMPP on Ubuntu, confidently starts Apache from the manager, and gets an error because another web server is already running. Maybe it is Apache from a previous LAMP setup. Maybe it is Nginx from an old project. Maybe it is some dev tool the user forgot they installed three months ago and never touched again. This is the moment when Linux gently reminds you that your computer has a memory and it absolutely keeps receipts.
Another frequent experience is confusing MariaDB with MySQL. Plenty of people install XAMPP expecting the word “MySQL” everywhere because that is the term they grew up reading in tutorials. Then they open the stack, see MariaDB, and wonder whether they downloaded the wrong thing. They did not. For local development, it usually works just fine. The confusion is less about functionality and more about branding. It is a little like ordering fries and getting “artisan potato sticks.” Different label, familiar result.
Then there is the htdocs moment. New users often install XAMPP successfully but are unsure where their project files are supposed to go. Once they discover the web root and drop in a simple PHP file, everything clicks. That is usually the turning point when XAMPP stops feeling like a mysterious black box and starts feeling like a usable tool. Create a file, visit it in the browser, see output, smile. That simple feedback loop is why local development stacks remain popular.
On Fedora or other SELinux-heavy systems, the experience can get more interesting. Some users do everything right and still watch Apache refuse to start. That often sends them down a rabbit hole of permissions, policies, logs, and muttered words not suitable for a family blog. The upside is that Linux teaches good habits. You stop assuming. You check logs. You inspect ports. You learn that every vague error message is really a scavenger hunt in disguise.
People also tend to discover pretty quickly that XAMPP is best when used for exactly what it promises: local development. The moment someone tries to expose phpMyAdmin broadly, run a production site from it, or bolt on every feature under the sun, the setup starts to feel less charming and more like a folding chair being asked to replace a sofa. It can hold you for a while, sure, but that was never the plan.
In the end, most Linux users who install XAMPP come away with the same verdict: it is convenient, fast, and very useful for testing. It is not magic, and it is not meant to be a forever server. But if you need a local stack today, not next Tuesday after manually configuring every service, XAMPP gets the job done. And honestly, sometimes “it works and I can get back to building my project” is the most beautiful feature of all.
