Skip to content
Follow
Ubuntu Linux

How to Install XAMPP on Ubuntu 24.04

Richard
Written by
Richard
Updated 4 min read
How to Install XAMPP on Ubuntu 24.04
How to Install XAMPP on Ubuntu 24.04
Before you start
  • 6 steps
  • Needs administrator rights

XAMPP is a free software bundle that puts a web server, a database, and PHP tools onto your computer in one package. You can build and test websites locally on Ubuntu 24.04 before putting them online.

Advertisement

This guide installs version 8.2.12 or newer of this local server environment. The download comes from the official Apache Friends website, and the whole setup takes only a few steps.

Before you start, make sure you have an Ubuntu 24.04 system, an account with administrator (sudo) rights, and a working internet connection. If another web server is already running on the machine, stop it first. Two servers cannot listen on the same port at once, and the XAMPP Apache server may fail to start.

⚡ Quick Answer

Open a terminal with Ctrl+Alt+T, download the installer with wget from the Apache Friends SourceForge link, then run sudo chmod +x on the.run file and start it with sudo./xampp-linux-*-installer.run. Choose the XAMPP Core Files and Developer Files, and the setup installs everything into /opt/lampp.

Advertisement

Download XAMPP

To install XAMPP on Ubuntu 24.04, you first download the official Linux installer from the SourceForge project page. The Apache Friends website links to it. Then you make the file executable so the system can run the setup script.

  1. Press Ctrl+Alt+T to open a terminal window.
  2. Run the wget command shown below to download the installer directly to your computer.
  3. Wait for the download to finish and for the prompt to come back.
Advertisement
📝Good to Knowwget saves the file in the folder your terminal is currently in, which is normally your home folder.

Make a note of that location, because you need to run the installer from the same folder.

💻Code
wget https://sourceforge.net/projects/xampp/files/XAMPP%20Linux/8.2.12/xampp-linux-x64-8.2.12-0-installer.run

A freshly downloaded file does not have permission to run. Use chmod to add the execute permission, as shown below. If you skip this step, the installer stops with a “Permission denied” error.

With the file executable, start the installer from the terminal. It runs with administrator privileges, so you may be asked for your password. After that, a setup window opens and its prompts guide you through the installation, including the choice of XAMPP components. When the installation finishes, you use the XAMPP application to manage your web server and databases.

🐧Bash / Shell
sudo chmod +x xampp-linux-*-installer.run && sudo ./xampp-linux-*-installer.run

The setup wizard opens with a welcome page. Read it, then click Next to continue.

Advertisement
XAMPP installer wizard interface on Ubuntu 24.04
XAMPP installer wizard interface on Ubuntu 24.04

On the component selection page, choose the XAMPP Core Files and XAMPP Developer Files options, then click Next. The core files hold Apache, MariaDB, PHP and Perl. The developer files add the headers and tools you need if you compile extensions later. Keep both ticked unless you have a specific reason not to.

XAMPP components installation selection screen
XAMPP components installation selection screen

The installer now copies the files into place. Wait until the progress bar completes and the installer reports that it has finished. It installs everything under the /opt/lampp folder.

XAMPP components install progress
XAMPP components install progress

Click the Finish button to close the wizard. The XAMPP application opens, and you can use it to control your servers.

XAMPP launch app
XAMPP launch app

Open the Manage Servers tab. It lists the servers that come with XAMPP, including Apache and the MariaDB database. Select a server and use the buttons next to it to start, stop or restart it. Start both Apache and the database now. You need them running for the checks later in this guide.

Advertisement
XAMPP App manager
XAMPP App manager

The command line is an alternative to the application, and it is handy on a server with no desktop. The commands below start and stop all the servers in one go. Run them from a terminal with administrator rights.

🐧Bash / Shell
sudo /opt/lampp/lampp stop
sudo /opt/lampp/lampp start

Operation

⚠️WarningXAMPP stores all its files in the /opt/lampp folder, including your web server files and databases.

Back up this folder before you make big changes.

  1. Start the services, using either the XAMPP application or the command-line method above.
  2. Open a web browser on the Ubuntu machine.
  3. Go to your server IP address. On the same machine, localhost also works.

If the XAMPP welcome page loads, Apache is running. You can then click the phpMyAdmin link on that page to manage your databases through a web interface.

Advertisement

Browse to the server IP address or hostname to view the default Apache web page. If the page does not load, go back to the Manage Servers tab and check that Apache is running. Also check that no other web server is using the same port.

XAMPP web portal dashboard on Ubuntu 24.04
XAMPP web portal dashboard on Ubuntu 24.04

Click the PHPInfo link to display PHP information. The page lists the installed PHP version, the loaded modules and the configuration settings. It is a quick way to confirm that PHP works with Apache.

XAMPP web portal PHP info
XAMPP web portal PHP info

Click the phpMyAdmin link to manage MariaDB. The database server must be running for this page to work. From phpMyAdmin you can create databases, add tables and import or export data without typing SQL commands.

XAMPP web portal phpMyAdmin
XAMPP web portal phpMyAdmin

That completes the setup. XAMPP is installed, Apache and MariaDB are running, and you can start building and testing your PHP projects locally.

XAMPP gives you an efficient way to set up a local server environment on Ubuntu for PHP development. These are the main points:

  • XAMPP provides an efficient way to set up a local server environment on Ubuntu, facilitating PHP development.
  • The installation process is straightforward, requiring only a few terminal commands.
  • This package includes essential components such as Apache, MariaDB, and interpreters for PHP and Perl, streamlining web development.
  • Users can manage their servers easily through the XAMPP application or command line.
  • With XAMPP, you can easily create, run, and manage PHP-based websites and applications from a single installation, enhancing developer productivity.

Have a question about this guide?

Answered by AI from this guide. Good questions may be added to this page — please don't include personal details.

Did this guide fix your problem?

Richard

About the Author

Richard

Tech Writer, IT Professional

Richard is a writer at Geek Rewind who turns complex IT tasks into clear, step-by-step guides. He draws on years of hands-on experience in system administration and enterprise IT operations, focusing on Windows, Linux and WordPress: the problems people actually run into, and the fixes that work. His server and WordPress guides come from systems he runs himself. Richard builds and maintains the platform behind Geek Rewind, from its Ubuntu servers and Nginx configuration to its custom WordPress plugins. Many new tutorials start with readers' questions, and he's always glad to answer them in the comments.

Advertisement

2 Comments

Leave a Comment

Your email address will not be published. Required fields are marked *