Home » Ubuntu » How to Install XAMPP on Ubuntu 20.04

How to Install XAMPP on Ubuntu 20.04

XAMPP is a free and open-source web server package developed by Apache Friends. The XAMPP software package comprises the Apache web server, MariaDB database server, PHP, and Perl. It is basically a localized LAMP server that gives developers a suitable environment to test websites and applications before uploading them to a production server.

The acronym XAMPP stands for: X - Cross-platform, A - Apache server, M-MariaDB, P - PHP and P - Perl. XAMPP can run on Windows, macOS, and all Linux distributions.

In this guide, you will learn how to install XAMMP on Ubuntu 20.04.

Step 1: Update Ubuntu system

To get started, it's good practice to ensure that all the packages are up to date.

First update the package index, type:

$ sudo apt update 

Now download and install the latest package version, using:

$ sudo apt upgrade 

Step 2: Download XAMPP on Ubuntu 20.04

Once you are done updating your system's packages, proceed to the XAMPP Downloads page and grab the latest release of XAMPP. Choose the right installer for XAMPP according to the PHP version installed on your system.

To check the PHP version on your system, execute the command:

$ php -v

Once you have established the version of PHP on your system, be sure to download the installer that corresponds to the PHP version on your system as follows:

For PHP 7.4:

$ wget https://www.apachefriends.org/xampp-files/7.4.12/xampp-linux-x64-7.4.12-0-installer.run

For PHP 7.3:

$ wget https://www.apachefriends.org/xampp-files/7.3.24/xampp-linux-x64-7.3.24-0-installer.run

For PHP 7.2:

$ wget https://www.apachefriends.org/xampp-files/7.2.34/xampp-linux-x64-7.2.34-0-installer.run

For my case, I went with the first option since I have PHP 7.4.3 on my system. Let's now proceed to the next step.

Step 3: Install XAMPP On Ubuntu 20.04

By now you should have the installer sitting on your current working directory. You need to give it execute permissions first, before running it in order to install XAMMP.

To assign execute permissions, use the chmod command as follows:

$ sudo chmod a+x xampp-linux-x64-7.4.12-0-installer.run

Next, run the installer script to install XAMPP on your ubuntu machine

$ sudo ./xampp-linux-x64-7.4.12-0-installer.run

The XAMMP setup window appears as shown. Click 'Next' to commence the installation process.

Install XAMMP on Ubuntu 20.04
XAMMP Initial setup

Next, select the components that you wish to install and hit the 'Next' button.

install XAMPP on Ubuntu 20.04
select components to be installed

The next step shows you where XAMMP will be installed. Simply click 'Next' to proceed to the next step.

Xammp installation path

The installation of XAMMP will start, so kindly give it some time.

Install XAMMP on Ubuntu 20.04
xammp installation underway

Finally, click 'Finish' to complete the installation. Before that, you can check off the 'Launch XAMMP' option to launch XAMMP automatically.

complete installation of xammp
complete installation of xammp

After clicking the 'Finish' button, the welcome page will be displayed as shown.

xammp welcome page
xammp welcome page

To manage the core services (Apache web server, MariaDB database & ProFTPD), click on the 'Manage Servers' tab. In the right section, be sure to find options for starting, stopping, and restarting the services.

Manage services in XAMMP
Manage services in XAMMP

Step 4: Verify that XAMPP is running

By default, the Apache webserver and phpMyAdmin are the only components that are active. To access the phpMyAdmin page, browse the URL shown.

http://localhost/phpmyadmin

The default page presents you with preexisting databases that come with the setup.

Step 5: Stopping/starting XAMPP server

To stop all running services on XAMMP, invoke the command:

$ sudo /opt/lampp/lampp stop

To start the services, run:

$ sudo /opt/lampp/lampp start

To remove XAMMP from your system, run the following commands:

$ cd  /opt/lampp
$ sudo  ./uninstall

Conclusion

In this tutorial, we learned how you install XAMPP in Ubuntu 20.04. XAMPP allows you to easily test your applications and mimic a real world situation where you applications will be hosted on a production server for clients to interact with it.

Leave a Comment