How to Install XAMPP in Ubuntu 18.04?

Photo of author

By admin

When you are hosting a website on your Ubuntu system, you will require different software packages. These software programs work together to make browsing more efficient for the viewers. Developers often use PHP to gather content from a certain database so that those resources can be viewed by the users easily.

The most common components of web-hosting in Linux servers are PHP, Apache, MariaDB, etc. The XAMPP tool helps you run these components together on your Linux system so that they can be easily manageable when it comes to web hosting. XAMPP combines these components into a single installation package so that the installation becomes simple and easy. Within the XAMPP tool, there is a Bitnami feature that facilitates managing WordPress and other content management systems.

Therefore, installing XAMPP on your Ubuntu system makes hosting a website easier. Here in this article, we will discuss in detail how to install XAMPP on Ubuntu 18.04. So, since you are already here, let’s get started.

Prerequisites

XAMPP stack is an Apache distribution, and it is related to the PHP development environment. This open-source platform helps developers to test the software packages and web pages through a single installation of the Apache (A), MariaDB (M), PHP (P), and Perl (P) cross-platform software. It tests the software and the web pages and then transfers the data to an online server remotely. To install this tool on your Ubuntu system, you will have to meet the following requirements:

  • Your system should have Ubuntu 18.04 Bionic Beaver installed.
  • Sudo privileges on a user account.
  • You should have access to the terminal or command line.
  • You should have the apt tool installed in Ubuntu.

If you have taken care of these requirements, then go ahead and get on with the installation process of XAMPP on Ubuntu.

Step 1: Download and Install XAMPP on Ubuntu

To install XAMPP on your computer, visit the official Apache Friends webpage and download the package from there. When you click on that link, the page that appears is where you will find the download button of XAMPP on Windows, Linux, and OS X. Click on the Linux link since you are trying to get it on your Ubuntu computer.

The download will take a few minutes as per the speed of the internet and system. When the download is completed, you can find the downloaded package of XAMPP in your Downloads directory in Ubuntu. You can run a simple command to execute that file and make the installation possible.

You can run the installation, but you will have to modify the file permissions for XAMPP because you are executing the program. And you need to execute the file first for the same. You can open your terminal window and then follow the instructions mentioned below.

Step 1: Go to the folder where you have downloaded the XAMPP installation package, possibly in the Downloads folder. Alternatively, you can run the cd /home/[username]/Downloads command to visit the Downloads folder from the terminal.

Step 2: Execute the file by running the chmod command: sudo chmod 755 [package_name]. When you go to the Downloads folder, you will find the complete package name in there, and you will copy and paste that name to replace [package_name] in the command above. Once you run the command, the file will be executable.

Step 3: Run the sudo chmod 755 xampp-Linux-x64-7.3.5.1-installer.run command to execute the XAMPP installation package.

Step 4: Since the terminal does not confirm if you have successfully executed the installation or not, run this command to verify the installation: ls –l xampp-Linux-x64-7.3.5.1-installer.run

In the output, you may see <strong>rwxr –xr –x 1</strong> before the user name who has the access to execute the file. You can now set up and install XAMPP on your Ubuntu system.

Step 2: Set Up and Install XAMPP

Since you have installed the XAMPP installer, you can run it on your system and the setup wizard with a simple command: sudo ./[package_name]. We have used the sudo ./xampp-Linux-x64-7.3.5.1-installer.run command to run the graphical setup wizard. The graphical wizard will open a new window at the top of the terminal window from where you can install XAMPP. It will have two available options — Next and Cancel. Observe the instructions here to complete the installation process:

Step 1: In the setup wizard, click on Next.

Step 2: A ‘Select Components’ dialogue box will appear where you will have to click on Next once again after selecting the components you need to equip.

Step 3: The wizard will show you the location of the installed XAMPP software. Click on Next.

Step 4: Another prompt will appear that will allow you to install sponsored applications on top of your main XAMPP app. These sponsored apps will contain WordPress. You don’t have to install those apps if you don’t want to. And for that, try to uncheck the ‘Learn more about Bitnami for the XAMPP’ option.

Step 5: The wizard will tell you if it is ready to install XAMPP, and you will have to click Next.

Step 6: The installation will begin and will take some time. You can track the progress in the next prompt.

Step 7: Another prompt will appear that will tell you that the installation has been finished. You can click on Finish to perform the installation.

Step 8: XAMPP will be launched and appear on your screen. From the main dashboard, look at the upper bar, where you will find the Manage Servers option. Click on it.

Step 9: In this tab, you will see the available services of XAMPP and their status. You can change between Start or Stop.

Step 10: Now visit http://localhost/dashboard from the web browser. If you can see the localhost dashboard on your browser, the installation of XAMPP was successful.

To check if the MariaDB service is working on your XAMPP tool, you can go to http://localhost/phpmyadmin. The result will show you a service database with every service in it, including variables, SQL, etc., so that you verify if it is working or not.

Conclusion

That’s how you can install and configure XAMPP on Ubuntu, but you could also uninstall it easily with a few commands. If an uninstall of the XAMPP on Ubuntu is needed, you can go to the <strong>opt/lampp</strong> directory using cd /opt/lampp. In the directory, you can use the sudo ./uninstall command to uninstall the XAMPP tool. A command box will appear where it will ask you again if you want to uninstall it or not. To confirm uninstallation, select Yes. You can also remove the directory of the XAMPP installation using sudo rm –r /opt/lamp to remove any trace of XAMPP from your computer.

The installation of XAMPP is free localhost set up for your Ubuntu computer, but you can replace XAMPP with LAMP stack or the MEAN stack. To know more about the other two, check out our other articles. If you need any further help with how to install XAMPP on Ubuntu, drop a comment below.

Leave a Comment