Although Ubuntu 20.04 or its earlier Linux versions we don’t need to install XAMPP because using a few commands, we can set up the LAMP environment on Ubuntu. Thus, for Windows, it is a greater piece of software. However, if you don’t want to go through various commands to set up a LAMP, the XAMPP is the best option.
What is XAMPP?
If you want to develop software for the web or create a website, you need a test environment that is not accessible from outside but includes all the necessary tools. XAMPP from Apachefriends offers such a development environment. It allows the creation of a Local web server with Apache, PHP, Perl, and MySQL.
In addition to Apache, MySQL, PHP, and Perl, other programs such as phpMyAdmin for the administration of MySQL, OpenSSL for encryption of network connections, FileZilla as an FTP server and the Mercury Mail Transport System is an email server with POP, SMTP, and IMAP are included. In addition, the web analysis tool Webalizer is available, although the path in webalizer.php may have to be adapted in the event of problems.
XAMPP is designed as a pure test system and aims to be ready for use quickly. Thus, not meant to serve as a web server for commercials because it does not offer adequate protection against possible hacker attacks there. Apart from Windows and macOS, it almost supports all Linux distributions such as Debian, RedHat, CentOS, Ubuntu, Fedora, Gentoo, Arch, and SUSE.
- Graphical Ubuntu 20.04 LTS Linux
- A non-root user with
Use Xampp on Ubuntu 20.04 LTS focal Fossa
You can follow the below steps not only for Ubuntu Focal Fossa but also for earlier versions such as Ubuntu 19.10/19.04/18.10/18.04/16.04… Linux Mint, Debian, Elementary OS…
Step 1: Download XAMPP for Ubuntu Linux
The first thing we need is the executable binary of XAMPP on our Ubuntu 20.04 LTS. For that, we simply visit the official website of this tool. Here is the link.
Scroll down to the section where the XAMPP Linux packages are available to download. You will see three versions there.
Expect the PHP version, the rest of the tools in all three versions will be the same. Thus, as per the requirement of the PHP version of your project download the one.
Here we are downloading the latest PHP version, however, you can go for any of them. Click on the Download button.
Step 2: Open Command Terminal
You can either use the shortcut- CTRL+ALT+T or simply go to the Applications from Activities option and search for the Terminal and run it.
Step 3: Change permission and Run the XAMPP installer
By default, whatever we are downloading from the internet using the browser on Linux systems, goes into the Downloads folder, thus first switch to that first.
Change the permission of the installer. 755 means read and execute access for everyone and write access to the owner of the file
chmod 755 xampp-linux-*-installer.run
Run the installer
Step 4: Setup Installer Wizard
The moment you run the installation command, a XAMP setup wizard will open. Click on the Next button.
Select both the components “XAMPP Core files” and XAMPP Developer files and then NEXT.
By default, all the files will unpack under
ProgressClick on the Finish and the XAMPP will be on your Ubuntu 20.04 LTS system.
Although once the installation is done, the system will automatically start the XAMPP, however for later you can use the command terminal:
Step 5: Start Apache and MySQL server
Go to the Manage Server Tab and corresponding to Web server and Database click on the start button. To change their running ports select Configure one.
Step 6. XAMPP Desktop Shortcut
We need to create a file that will use as a Desktop shortcut in which add some entries that will let the system execute and launch the XAMPP application.
Add Lampp server and icon path
Inside the above-created launcher file, copy and paste the below entries which define the type of the shortcut, and the path to execute along with the icon.
[Desktop Entry] Version=1.0 Type=Application Name=XAMPP Exec=sudo /opt/lampp/manager-linux-x64.run Icon=/opt/lampp/htdocs/favicon.ico Terminal=false StartupNotify=false
Save the file using Ctrl+O, hit the Enter key, and then exit the file – Ctrl+X.
Now give sudo permission to your desktop shortcut.
Scroll to the end of the file and past the given line:
your-user ALL = NOPASSWD: /opt/lampp/manager-linux-x64.run
Note: Don’t forget to replace the your-user with your current user that you are using to run XAMPP on your Ubuntu 20.04 LTS system.
Now, right-click on the Desktop shortcut and select “Allow Launching“.
Step 7: Stop or Start the XAMPP server
In the future, if you want to stop the service of this tool, simply use the following command with
To stop all Xampp running services:
sudo /opt/lampp/lampp stop
And if you want to start them again via the command line:
sudo /opt/lampp/lampp start
Step 8: Uninstall Xampp from Ubuntu 20.04
To completely uninstall or remove the XAMPP server from your system, let’s see the command that you can use.
To remove shortcuts:
sudo rm ~/Desktop/XAMPP.desktop
sudo rm /usr/share/applications/XAMPP.desktop
6 thoughts on “How to install XAMPP on Ubuntu 20.04 LTS”
I like your tutorial, a lot. However, as a stone-cold beginner, after step 5, what’s next? Are php and brackets already installed? How do I start using php and brackets on Ubuntu 20.04? Ok, if brackets is installed I can start that. What if Brackets is not installed? and how do I set it up for PHP? The book that I’m learning PHP from doesn’t have all of this detail.
Yes, PHP will automatically get installed with other packages while setting up XAMPP. However, brackets need to be installed manually.
Nicely done easy to follow. Is XAMPP also updated it self or will it update the Apache MySQL and PHP if i run the update and upgrade just like LAMP? Thanks
I am searching on google how to install xampp and I find your post. And after reading your content, hopefully, now we can install xampp. Thank you!
The file on the Desktop is only Desktop entry. How to open XAMPP?