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.

Verdict up front: XAMPP is excellent for local development and quick testing on a machine that isn't exposed to the internet. It is not suitable for a public-facing production server. If your Debian machine is hosting a live website, use the manual stack from Chapters 1–6.

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.

philip@debian — download XAMPP installer
# Check https://www.apachefriends.org for the current version number # Example below uses 8.2.12 — substitute the actual current version philip@debian:~$ cd /tmp philip@debian:/tmp$ wget https://downloadsapachefriends.global.ssl.fastly.net/xampp-linux-x64-8.2.12-0-installer.run Saving to: 'xampp-linux-x64-8.2.12-0-installer.run' ... 156 MB/s eta 0s 'xampp-linux-x64-8.2.12-0-installer.run' saved [165823000/165823000]

Step 2 — Make it executable and run

philip@debian — run the installer
philip@debian:/tmp$ chmod +x xampp-linux-x64-8.2.12-0-installer.run philip@debian:/tmp$ sudo ./xampp-linux-x64-8.2.12-0-installer.run Welcome to the XAMPP Setup Wizard. Select components to install: [x] XAMPP Developer Files [x] XAMPP Core Files (required) [x] phpMyAdmin Installation Directory: /opt/lampp Setup has finished installing XAMPP on your computer.
Headless install (no GUI): on a server without a desktop environment, add the --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

philip@debian — XAMPP control
philip@debian:~$ sudo /opt/lampp/lampp start Starting XAMPP for Linux 8.2.12-0... XAMPP: Starting Apache...ok. XAMPP: Starting MySQL...ok. XAMPP: Starting ProFTPD...ok. philip@debian:~$ sudo /opt/lampp/lampp stop Stopping XAMPP for Linux 8.2.12-0... XAMPP: Stopping Apache...ok. XAMPP: Stopping MySQL...ok. philip@debian:~$ sudo /opt/lampp/lampp status Apache is running. MySQL is running. ProFTPD is not running.

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.

/opt/lampp/ ├── apache2/ Apache binaries and modules │ └── conf/ httpd.conf and extra/ ├── etc/ php.ini and my.cnf live here │ ├── php.ini │ └── my.cnf ├── htdocs/ ← your web files go here │ └── dashboard/ XAMPP welcome page ├── mysql/ MariaDB data directory │ └── data/ ├── php/ PHP binary and extensions ├── phpmyadmin/ phpMyAdmin (served at /phpmyadmin) ├── logs/ Apache error.log and access.log └── lampp The control script (start/stop/status)
Port conflicts: if your system Apache is already running on port 80, XAMPP's Apache will fail to start. Either stop the system service first (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:

philip@debian — XAMPP security wizard
philip@debian:~$ sudo /opt/lampp/lampp security XAMPP: Quick security check... XAMPP: MySQL is accessible via network. Recommended: configure network access. XAMPP: The MySQL root user has no password set. Please change this. Do you want to set a password for the MySQL root? [yes] yes Password: **** Do you want to allow access to phpMyAdmin from the network? [no] no XAMPP: Security improvements complete.
XAMPP is not hardened for the internet. The security script above is for local-only use. Even after running it, XAMPP lacks the UFW rules, fail2ban, and per-file permission model built in Chapters 5–6. For a production server, use the manual stack.

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

Use XAMPP when…
You need a local dev environment up in 10 minutes with no internet exposure. Testing a PHP script, evaluating a CMS, or demoing something to a client on a laptop. Cross-platform team where some members use Windows or macOS — XAMPP gives everyone the same setup. You want phpMyAdmin without any additional configuration.
Use the manual stack when…
The server is publicly accessible — even behind a Cloudflare Tunnel. You want automatic security updates via 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

CommandWhat 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:

philip@debian — XAMPP systemd unit
philip@debian:~$ sudo vi /etc/systemd/system/xampp.service
# /etc/systemd/system/xampp.service [Unit] Description=XAMPP After=network.target [Service] ExecStart=/opt/lampp/lampp start ExecStop=/opt/lampp/lampp stop Type=forking RemainAfterExit=yes [Install] WantedBy=multi-user.target
philip@debian — enable autostart
philip@debian:~$ sudo systemctl daemon-reload philip@debian:~$ sudo systemctl enable xampp Created symlink /etc/systemd/system/multi-user.target.wants/xampp.service

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.
Web Server Setup: Debian 12 Bookworm — Complete
All 7 chapters done · Manual LAMP stack built and hardened · XAMPP covered as the alternative
Ch 1 Overview Ch 2 Web Server Ch 3 Database Ch 4 PHP Ch 5 SSL/HTTPS Ch 6 Firewall Ch 7 XAMPP