XAMPP, a Better Option?
Chapter 7 — XAMPP
All six previous chapters built a web server stack component by component — web server, database, PHP, SSL, firewall. XAMPP takes the opposite approach: one installer, everything bundled, running in minutes. This final chapter explains what XAMPP is, how to install it on Debian 12 Bookworm, what its directory structure looks like, and — critically — when it's the right tool and when it absolutely isn't.
What Is XAMPP?
XAMPP stands for X (cross-platform), Apache,
MariaDB, PHP, and Perl.
It's an open-source package maintained by Apache Friends that bundles all of
these components into a single self-contained installation under
/opt/lampp/. It was originally designed to let developers run a
local copy of a LAMP stack on Windows or macOS without touching their system
packages — the Linux version is a secondary use case.
Everything XAMPP installs lives inside /opt/lampp and runs as its
own processes. It does not interact with your system Apache, MariaDB, or PHP
packages — they coexist independently, on different ports if needed.
Installing XAMPP on Debian 12
Step 1 — Download the installer
XAMPP is not in Debian's package repository. Download the Linux installer directly from the Apache Friends website. Choose the version that matches your PHP requirement — XAMPP bundles its own PHP version independent of the system.
Step 2 — Make it executable and run
--mode text flag to run the installer in the
terminal:sudo ./xampp-linux-x64-8.2.12-0-installer.run --mode text
Step 3 — Start and stop XAMPP
Step 4 — Access the XAMPP dashboard
Open a browser and navigate to http://localhost. You should see
the XAMPP welcome page with links to phpMyAdmin and the dashboard. Your web files
go in /opt/lampp/htdocs/.
Directory Structure
Everything lives under /opt/lampp/. This self-contained layout is
intentional — it's easy to back up, easy to delete, and never touches system
directories.
sudo systemctl stop apache2) or configure XAMPP to listen on a
different port by editing /opt/lampp/etc/httpd.conf — change
Listen 80 to Listen 8080 and access via
http://localhost:8080.
Initial Security Steps
Out of the box, XAMPP ships with its MariaDB root account having no password, phpMyAdmin accessible to anyone on the network, and an FTP server running by default. Run the XAMPP security script immediately after installation:
XAMPP vs Manual Stack — Honest Comparison
| Factor | XAMPP | Manual Stack (Chs 1–6) |
|---|---|---|
| Setup time | 5–10 minutes | 1–2 hours (first time) |
| System integration | Self-contained in /opt/lampp — not managed by systemd, apt, or UFW | Full systemd control, apt updates, UFW integration |
| Security defaults | No root password, phpMyAdmin open, FTP running — must run security wizard | mysql_secure_installation, UFW, fail2ban all covered in this course |
| PHP version control | Tied to the version bundled with the XAMPP installer | Install any PHP version via Debian or Sury repo; switch with update-alternatives |
| Updates | Manual — download a new installer; no apt upgrade |
sudo apt upgrade patches everything |
| Multiple sites | Awkward — one htdocs folder, no clean virtual-host management | sites-available / sites-enabled per domain |
| Production use | Not recommended — not designed or hardened for this | The correct choice for any publicly accessible server |
| phpMyAdmin | Bundled and pre-configured | Install separately via apt or Composer |
| Windows/macOS parity | Identical experience across all platforms — good for team setups | Linux-specific; developers on other OSes need their own setup |
| Learning value | Hides how the stack fits together | You understand every component — easier to debug |
| Uninstall | sudo /opt/lampp/uninstall — clean removal |
Manual — apt remove each package |
When to Use XAMPP vs the Manual Stack
apt upgrade.
You need to host multiple domains with separate virtual hosts. You're
building a long-term setup you'll maintain and understand. This course's
stack (Chapters 1–6) is the correct choice for Philip's Debian home server.
Useful XAMPP Commands
| Command | What it does |
|---|---|
| sudo /opt/lampp/lampp start | Start Apache, MariaDB, ProFTPD |
| sudo /opt/lampp/lampp stop | Stop all XAMPP services |
| sudo /opt/lampp/lampp restart | Restart all services |
| sudo /opt/lampp/lampp startapache | Start Apache only |
| sudo /opt/lampp/lampp startmysql | Start MariaDB only |
| sudo /opt/lampp/lampp status | Show running/stopped state of each service |
| sudo /opt/lampp/lampp security | Interactive security hardening wizard |
| sudo /opt/lampp/bin/php --version | XAMPP's bundled PHP version (different from system PHP) |
| sudo /opt/lampp/bin/mysql -u root -p | Connect to XAMPP's MariaDB (separate from system MySQL) |
| sudo /opt/lampp/uninstall | Remove XAMPP completely |
Autostarting XAMPP with systemd
If you want XAMPP to start automatically on boot (on a dedicated local development machine, not a production server), create a systemd unit file:
Course Summary Checklist
Everything covered across the seven chapters — a complete reference for setting up a LAMP stack on Debian 12 Bookworm from scratch:
- Ch 1 — Overview & Planning: stack anatomy, component choices, prerequisites, IP address, essential tools.
- Ch 2 — Web Server: Apache (mod_php, virtual hosts, a2ensite) or Nginx (PHP-FPM, server blocks, try_files).
- Ch 3 — Database: MariaDB (recommended, no extra repo), MySQL 8 (APT repo), or PostgreSQL. mysql_secure_installation, user and database creation.
- Ch 4 — PHP: PHP 8.2 (Debian main) or 8.3 (Sury repo). Essential extensions, php.ini tuning, Apache mod_php vs Nginx FPM socket, connection testing.
- Ch 5 — SSL/HTTPS: Let's Encrypt via Certbot for public domains, self-signed certificates for local development, HTTP → HTTPS redirect.
- Ch 6 — Firewall & Security: UFW rules, fail2ban jail.local, filesystem permissions (755/644/775), server version hiding, SSH hardening.
- Ch 7 — XAMPP: Install, directory structure, security wizard, systemd autostart, and when to use it vs the manual stack.