XAMPP is one of those tools that has a very specific purpose and does it well: give you a complete Apache + MySQL + PHP + Perl development stack in a single download, with no package management, no dependency chasing, and no configuration files to edit before your first localhost page loads. Version 1.8.3, released in late 2013, bundled Apache 2.4.7, MySQL 5.6.14, PHP 5.5.6, and phpMyAdmin 4.0.9 โ a solid stack for PHP development at the time. This guide covers the full installation process on Ubuntu Desktop, from download to testing, and wraps up with the security considerations that make XAMPP perfectly appropriate for development and completely inappropriate for anything facing the internet. We have used XAMPP for quick local development environments since the early Ubuntu days, and while we generally recommend a native LAMP stack for serious work (better integration, better security, better updates), XAMPP has its place โ especially when you need a working PHP environment in five minutes. For background on package management through apt, see our CLI Basics reference.
Why XAMPP Instead of a Native LAMP Stack?
Fair question. Ubuntu has apache2, mysql-server, and php in its repositories. You can install a full LAMP stack with a handful of apt-get commands. So why does XAMPP exist?
Three reasons: speed of setup, isolation, and cross-platform consistency.
A native LAMP install on Ubuntu requires configuring Apache virtual hosts, setting a MySQL root password, enabling PHP modules, and making sure all the pieces talk to each other. It is not difficult, but it takes fifteen to thirty minutes the first time and requires understanding how Ubuntu organises Apache configurations (sites-available, sites-enabled, mods-available, the a2ensite/a2enmod pattern).
XAMPP skips all of that. Run the installer, start the services, drop your PHP files in /opt/lampp/htdocs/, and open http://localhost in a browser. Done. For a developer who just needs to test a WordPress theme or debug a PHP script, that immediacy matters.
The isolation benefit is also real. XAMPP installs everything under /opt/lampp and does not touch Ubuntu’s system packages. You can have a native MySQL installation for one project and XAMPP for another without any overlap โ as long as they do not compete for the same ports.
The downside is equally real: XAMPP does not receive security updates through apt. When a vulnerability is found in Apache or MySQL, Ubuntu pushes a patched package within days. With XAMPP, you wait for the XAMPP team to release a new build, then manually download and reinstall. For production, that is unacceptable. For local development behind a firewall, it is a tolerable trade-off.
Step-by-Step Installation
Step 1: Download the XAMPP Installer
Download the XAMPP 1.8.3 Linux installer. The file will be named something like xampp-linux-x64-1.8.3-5-installer.run and will be around 130 MB. Save it to your ~/Downloads directory.
Architecture note: XAMPP 1.8.3 was available in both 32-bit and 64-bit versions. Match the version to your Ubuntu architecture. Check with
uname -mโx86_64means 64-bit,i686means 32-bit.
Step 2: Make the Installer Executable
The downloaded file does not have execute permissions by default. Fix that:
cd ~/Downloads
chmod +x xampp-linux-x64-1.8.3-5-installer.run
Step 3: Run the Installer
sudo ./xampp-linux-x64-1.8.3-5-installer.run
The sudo is required because XAMPP installs to /opt/lampp, which is owned by root. The installer presents a graphical wizard (even from a terminal, if you have a desktop session running) that walks you through component selection. The default selections โ Apache, MySQL, PHP, phpMyAdmin, and the XAMPP developer files โ are fine for most users.
Click through the wizard. Installation takes about one to two minutes.

Step 4: Start XAMPP Services
After installation, start Apache and MySQL:
sudo /opt/lampp/lampp start
You should see output confirming each service has started:
Starting XAMPP for Linux 1.8.3-5...
XAMPP: Starting Apache...ok.
XAMPP: Starting MySQL...ok.
If Apache fails to start, the most common cause is another web server (or process) already listening on port 80. Check with:
sudo netstat -tlnp | grep :80
If you see apache2 from Ubuntu’s native package, stop it first: sudo service apache2 stop.
Step 5: Test the Installation
Open a web browser and navigate to:
http://localhost
You should see the XAMPP welcome page, which confirms Apache is running and PHP is functional. Click the “phpMyAdmin” link in the left sidebar to verify the database is accessible.
Step 6: Test PHP Execution
Create a quick test file:
echo '<?php phpinfo(); ?>' | sudo tee /opt/lampp/htdocs/info.php
Navigate to http://localhost/info.php in your browser. You should see the PHP information page showing the version (5.5.6), loaded modules, and configuration details.
Cleanup: delete this file when you are done testing. The
phpinfo()output reveals server configuration details that you do not want publicly accessible, even on a development machine.
sudo rm /opt/lampp/htdocs/info.php
Managing XAMPP Services
XAMPP provides a single control command for all services:
sudo /opt/lampp/lampp start # Start Apache + MySQL
sudo /opt/lampp/lampp stop # Stop all services
sudo /opt/lampp/lampp restart # Restart all services
sudo /opt/lampp/lampp status # Check service status
To start individual components:
sudo /opt/lampp/lampp startapache # Apache only
sudo /opt/lampp/lampp startmysql # MySQL only
There is also a graphical manager if you prefer:
sudo /opt/lampp/manager-linux-x64.run
This opens a small GUI with start/stop buttons for each service and a “Network” tab showing active ports.

Security Considerations
XAMPP’s default configuration is intentionally open โ it is designed for frictionless development, not for defence. Here is what you need to know:
MySQL has no root password. Out of the box, you can connect to MySQL as root with no password. Set one immediately if your machine is on a shared network:
/opt/lampp/bin/mysqladmin -u root password 'your-secure-password'
phpMyAdmin is accessible without authentication. Anyone who can reach your machine’s port 80 can access phpMyAdmin and, through it, your entire database. Restrict access by editing /opt/lampp/etc/extra/httpd-xampp.conf and changing the Require all granted line for the phpMyAdmin directory to Require local.
The XAMPP security script. XAMPP includes a built-in security hardening tool:
sudo /opt/lampp/lampp security
This interactive script walks you through setting passwords for MySQL root, phpMyAdmin, and the XAMPP directory password. Run it after installation on any machine that is not completely isolated.
Network accessibility. By default, XAMPP’s Apache listens on all interfaces (0.0.0.0:80). On a laptop connected to a coffee shop Wi-Fi, this means anyone on the same network can access your development server. To restrict it to localhost only, edit /opt/lampp/etc/httpd.conf and change Listen 80 to Listen 127.0.0.1:80.
Common Pitfalls
Port 80 already in use. If you installed Ubuntu’s apache2 package at any point (or if another application like Skype claims port 80), XAMPP’s Apache will refuse to start. Check for conflicts with netstat as shown above, and either stop the conflicting service or reconfigure XAMPP to use a different port by editing /opt/lampp/etc/httpd.conf.
SELinux or AppArmor blocking access. Ubuntu uses AppArmor, and on some installations the AppArmor profile for MySQL conflicts with XAMPP’s bundled MySQL binary. If MySQL fails to start and the error log (/opt/lampp/var/mysql/<hostname>.err) mentions AppArmor denials, you may need to add an exception or set the XAMPP MySQL binary to complain mode.
File permissions in htdocs. Because XAMPP runs as root (or as the daemon user), files you create in /opt/lampp/htdocs/ as your normal user may have permission issues. PHP scripts might fail to write files or create directories. Set ownership appropriately: sudo chown -R daemon:daemon /opt/lampp/htdocs/yourproject/ for directories that need write access.
Forgetting to stop XAMPP before shutting down. XAMPP does not install shutdown hooks. If you shut down Ubuntu without stopping XAMPP first, MySQL may not flush its buffers cleanly. On next start, MySQL might enter recovery mode. This is usually not catastrophic โ InnoDB recovers gracefully โ but it is a good habit to run sudo /opt/lampp/lampp stop before powering off.
PHP module differences. XAMPP bundles its own PHP compilation with a specific set of modules. If your project requires a PHP extension that is not included (for example, php-imagick or php-redis), you cannot install it through apt-get because XAMPP’s PHP is not the system PHP. You would need to compile the extension against XAMPP’s PHP headers manually, which is significantly more work than the native LAMP approach where sudo apt-get install php5-imagick handles everything.
XAMPP vs. Native LAMP: Which Should You Choose?
Use XAMPP when you want a disposable, zero-configuration development environment that you can install in five minutes and delete when you are done. Use a native LAMP stack when you need production-representative configuration, security updates through apt, and the ability to install PHP modules without compiling them by hand. For anything internet-facing โ even a personal blog โ use the native stack and configure it properly. XAMPP is strictly a local development convenience.
