Skip to content
Menu
DevSecOps Now!!!
  • About
  • Certifications
  • Contact
  • Courses
  • DevSecOps Consulting
  • DevSecOps Tools
  • Training
  • Tutorials
DevSecOps Now!!!

How to Install and Configure XAMPP on Ubuntu 24 Server (Latest Version – 2026 Complete Guide)

Posted on February 28, 2026

Limited Time Offer!

For Less Than the Cost of a Starbucks Coffee, Access All DevOpsSchool Videos on YouTube Unlimitedly.
Master DevOps, SRE, DevSecOps Skills!

Enroll Now

If you are using Ubuntu 24 Server and want to install XAMPP (latest version) for PHP, MySQL, and Apache in one package, this guide will walk you through everything step by step.

This tutorial is written especially for:

  • VPS users
  • Dedicated Ubuntu servers
  • Developers migrating from Windows to Linux
  • Laravel, WordPress, Eventmie, or custom PHP users
  • Anyone who wants a simple LAMP stack setup quickly

This guide includes:

  • Installing the latest XAMPP on Ubuntu 24
  • Starting and stopping services
  • Fixing common errors
  • Setting permissions correctly
  • Enabling WebP support
  • Using Imagick (recommended)
  • Making XAMPP auto-start on boot
  • Security best practices
  • Hosting multiple domains
  • Production warnings
  • Troubleshooting tips

Everything is explained in simple language.


1. What is XAMPP?

XAMPP is a complete Apache distribution that includes:

  • Apache Web Server
  • MySQL / MariaDB
  • PHP
  • phpMyAdmin
  • ProFTPD (optional)

Instead of installing Apache, PHP, and MySQL separately, XAMPP gives everything in one installer.

On Linux, it installs in:

/opt/lampp

2. Should You Use XAMPP on Ubuntu 24 Server?

Before installing, understand this clearly:

XAMPP is primarily designed for development environments.

If your server is production and public, the better approach is:

  • Nginx or Apache (native)
  • PHP-FPM
  • MariaDB
  • Let’s Encrypt SSL

However, if:

  • You are testing software
  • You frequently reinstall apps
  • You want portability
  • You want minimal configuration

Then XAMPP is fine.


3. System Requirements for Ubuntu 24

Make sure your server has:

  • Ubuntu 24.04 LTS
  • Minimum 2GB RAM (4GB recommended)
  • Root or sudo access
  • Ports 80 and 443 open

Check your Ubuntu version:

lsb_release -a

4. Update Ubuntu 24 First

Always update before installing:

sudo apt update
sudo apt upgrade -y
sudo apt install wget curl net-tools unzip -y

5. Download Latest XAMPP for Linux

Go to the official website:
https://www.apachefriends.org

At the time of writing, latest version is:

XAMPP 8.2.x (PHP 8.2)

Download using terminal:

cd /tmp
wget https://sourceforge.net/projects/xampp/files/XAMPP%20Linux/8.2.12/xampp-linux-x64-8.2.12-0-installer.run/download -O xampp-installer.run

Make installer executable:

chmod +x xampp-installer.run

6. Install XAMPP on Ubuntu 24 Server

Since Ubuntu Server has no GUI, use text mode:

sudo ./xampp-installer.run --mode text

Follow prompts:

  • Press Enter
  • Accept default install path (/opt/lampp)
  • Complete installation

After installation, XAMPP is installed in:

/opt/lampp

7. Start and Stop XAMPP

Start:

sudo /opt/lampp/lampp start

Stop:

sudo /opt/lampp/lampp stop

Restart:

sudo /opt/lampp/lampp restart

Check status:

sudo /opt/lampp/lampp status

8. Open Firewall Ports

If UFW is active:

sudo ufw allow 80
sudo ufw allow 443
sudo ufw enable

Now open browser:

http://your-server-ip

You should see XAMPP dashboard.


9. Where to Put Website Files?

Your web root is:

/opt/lampp/htdocs

Example test:

echo "<?php phpinfo(); ?>" | sudo tee /opt/lampp/htdocs/info.php

Visit:

http://your-server-ip/info.php

10. Fix Permission Issues (Very Important)

By default, only root can modify htdocs.

Give ownership to your user:

sudo chown -R $USER:$USER /opt/lampp/htdocs

Now you can upload Laravel, WordPress, or other apps without permission errors.


11. Secure XAMPP

Run:

sudo /opt/lampp/lampp security

Set:

  • MySQL root password
  • Disable phpMyAdmin remote access if needed

Never leave MySQL without password on a public server.


12. Make XAMPP Start Automatically on Boot

Create service file:

sudo nano /etc/systemd/system/lampp.service

Paste:

[Unit]
Description=XAMPP
After=network.target

[Service]
Type=forking
ExecStart=/opt/lampp/lampp start
ExecStop=/opt/lampp/lampp stop
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target

Enable:

sudo systemctl daemon-reload
sudo systemctl enable lampp
sudo systemctl start lampp

13. Enable WebP Support (Very Important for Modern Websites)

Many people face WebP errors in Ubuntu.

First check:

/opt/lampp/bin/php -m | grep imagick

Check WebP:

/opt/lampp/bin/php -r 'print_r(gd_info());'

If WebP is missing in GD, best solution is to use Imagick.

Check Imagick WebP support:

/opt/lampp/bin/php -r 'print_r(\Imagick::queryFormats());'

If WEBP is present, you are good.

If not, install ImageMagick system dependency:

sudo apt install imagemagick -y

Restart XAMPP.

Imagick is more reliable than GD for WebP.


14. Common Problems and Solutions

Problem: Apache not starting

Solution:
Check if port 80 is used:

sudo netstat -tulpn | grep :80

Stop Apache2 if installed:

sudo systemctl stop apache2
sudo systemctl disable apache2

Restart XAMPP.


Problem: MySQL not starting

Check:

sudo netstat -tulpn | grep :3306

Stop system MySQL:

sudo systemctl stop mysql
sudo systemctl disable mysql

Restart XAMPP.


Problem: Permission denied uploading files

Fix:

sudo chown -R $USER:$USER /opt/lampp/htdocs

15. Hosting Multiple Domains in XAMPP

Edit virtual hosts:

sudo nano /opt/lampp/etc/extra/httpd-vhosts.conf

Example:

<VirtualHost *:80>
    DocumentRoot "/opt/lampp/htdocs/site1"
    ServerName site1.local
</VirtualHost>

<VirtualHost *:80>
    DocumentRoot "/opt/lampp/htdocs/site2"
    ServerName site2.local
</VirtualHost>

Enable vhosts in:

/opt/lampp/etc/httpd.conf

Uncomment:

Include etc/extra/httpd-vhosts.conf

Restart XAMPP.


16. Is XAMPP Safe for Production?

Short answer: Not recommended.

Why?

  • Runs as root
  • Minimal security hardening
  • Not optimized for performance
  • No automatic SSL

If hosting real business app, use native stack.


17. How to Uninstall XAMPP

sudo /opt/lampp/uninstall

18. Final Recommendations

If you:

  • Frequently reinstall Eventmie
  • Work on Laravel projects
  • Need portable LAMP stack
  • Want quick testing environment

Then XAMPP on Ubuntu 24 is perfect.

If you:

  • Run high traffic site
  • Need advanced security
  • Need scalable environment

Then configure Nginx + PHP-FPM instead.

Post Views: 401
  • Configure XAMPP
  • Configure XAMPP on Ubuntu
  • How to Install
  • How to Install and Configure XAMPP
  • How to Install and Configure XAMPP on Ubuntu 24 Server
  • How to install xampp
  • Xampp
Subscribe
Login
Notify of
guest
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
  • Incorrect definition of table mysql.column_stats
  • Mautic and PHP 8.3 Compatibility Guide (2026)
  • Certified AIOps Engineer: The Complete Career Path and Certification Guide
  • How to Rename Apache Virtual Host Files Safely (Step-by-Step Guide for Linux)
  • AIOps Foundation Certification: Everything You Need to Know to Get Certified
  • DevOps to Certified Site Reliability Professional: A Senior Mentor’s Guide
  • Certified Site Reliability Manager Training, Preparation, and Career Mapping
  • Certified Site Reliability Architect: The Complete Career Guide
  • What Is a VPN? A Complete Beginner-to-Advanced Tutorial
  • How to Install, Secure, and Tune MySQL 8.4 on Ubuntu 24.04 for Apache Event MPM and PHP-FPM
  • Complete Guide to Certified Site Reliability Engineer Career
  • Certified DevSecOps Professional Step by Step
  • Certified DevSecOps Manager: Complete Career Guide
  • Certified DevSecOps Engineer: Skills, Career Path and Certification Guide
  • Step-by-Step: Become a Certified DevSecOps Architect
  • Tuning PHP 8.3 for Apache Event MPM and PHP-FPM on Ubuntu: A Complete Step-by-Step Production Guide
  • Complete Step-by-Step Guide to Configure Apache Event MPM, Create index.php, Set Up VirtualHost, and Fix Ubuntu Default Page
  • Convert XAMPP Apache to Event MPM + System PHP-FPM
  • The Gateway to System Observability Engineering (MOE)
  • How to Finetune Apache and Prove It Works: A Real-World Guide to Testing Performance, Concurrency, HTTP/2, Memory, CPU, and Security
  • Building a High-Performance Apache Event MPM + PHP-FPM + MariaDB Stack (Advanced Server Optimization Guide)
  • Master Infrastructure as Code: The Complete Hashicorp Terraform Associate Guide
  • Building a High-Performance Apache Server with Event MPM + PHP-FPM (Step-by-Step Guide)
  • Is XAMPP Safer for Production Than Using Apache and PHP as Root? 2026 Practical Guide
  • Unlock Cloud Security Expertise with Certified Kubernetes Security Specialist (CKS)
  • How to Fix wpDiscuz Not Replacing Default WordPress Comments in Block Themes
  • Complete Guide to Certified Kubernetes Application Developer Certification
  • Overview of Certified Kubernetes Administrator (CKA) Certification
  • How to Install and Configure XAMPP on Ubuntu 24 Server (Latest Version – 2026 Complete Guide)
  • Mastering the Google Cloud Professional DevOps Engineer

Recent Comments

  1. digital banking on Complete Tutorial: Setting Up Laravel Telescope Correctly (Windows + XAMPP + Custom Domain)
  2. SAHIL DHINGRA on How to Uninstall Xampp from your machine when it is not visible in Control panel programs & Feature ?
  3. Abhishek on MySQL: List of Comprehensive List of approach to secure MySQL servers.
  4. Kristina on Best practices to followed in .httacess to avoid DDOS attack?
  5. Roshan Jha on Git all Commands

Archives

  • April 2026
  • March 2026
  • February 2026
  • January 2026
  • December 2025
  • November 2025
  • October 2025
  • September 2025
  • August 2025
  • July 2025
  • June 2025
  • May 2025
  • April 2025
  • March 2025
  • February 2025
  • January 2025
  • December 2024
  • November 2024
  • October 2024
  • September 2024
  • August 2024
  • July 2024
  • June 2024
  • May 2024
  • April 2024
  • March 2024
  • February 2024
  • January 2024
  • December 2023
  • November 2023
  • October 2023
  • September 2023
  • August 2023
  • July 2023
  • May 2023
  • April 2023
  • March 2023
  • February 2023
  • January 2023
  • December 2022

Categories

  • Ai
  • AI Blogging
  • AiOps
  • ajax
  • Android Studio
  • Antimalware
  • Antivirus
  • Apache
  • Api
  • API Security
  • Api Testing
  • APK
  • Aws
  • Bike Rental Services
  • ChatGPT
  • Code Linting
  • Composer
  • cPanel
  • Cyber Threat Intelligence
  • Cybersecurity
  • Data Loss Prevention
  • Database
  • dataops
  • Deception Technology
  • DeepSeek
  • Devops
  • DevSecOps
  • DevTools
  • Digital Asset Management
  • Digital Certificates
  • Docker
  • Drupal
  • emulator
  • Encryption Tools
  • Endpoint Security Tools
  • Error
  • facebook
  • Firewalls
  • Flutter
  • git
  • GITHUB
  • Google Antigravity
  • Google play console
  • Google reCAPTCHA
  • Gradle
  • Guest posting
  • health and fitness
  • IDE
  • Identity and Access Management
  • Incident Response
  • Instagram
  • Intrusion Detection and Prevention Systems
  • jobs
  • Joomla
  • Keycloak
  • Laravel
  • Law News
  • Lawyer Discussion
  • Legal Advice
  • Linkedin
  • Linkedin Api
  • Linux
  • Livewire
  • Mautic
  • Medical Tourism
  • MlOps
  • MobaXterm
  • Mobile Device Management
  • Multi-Factor Authentication
  • MySql
  • Network Traffic Analysis tools
  • Paytm
  • Penetration Testing
  • php
  • PHPMyAdmin
  • Pinterest Api
  • Quora
  • SAST
  • SecOps
  • Secure File Transfer Protocol
  • Security Analytics Tools
  • Security Auditing Tools
  • Security Information and Event Management
  • Seo
  • Server Management Tools
  • Single Sign-On
  • Site Reliability Engineering
  • soft 404
  • software
  • SuiteCRM
  • SysOps
  • Threat Model
  • Twitter
  • Twitter Api
  • ubuntu
  • Uncategorized
  • Virtual Host
  • Virtual Private Networks
  • VPNs
  • Vulnerability Assessment Tools
  • Web Application Firewalls
  • Windows Processor
  • Wordpress
  • WSL (Windows Subsystem for Linux)
  • X.com
  • Xampp
  • Youtube
©2026 DevSecOps Now!!! | WordPress Theme: EcoCoded
wpDiscuz