Install XAMPP Ubuntu Linux 2022

Posted on

Install XAMPP Ubuntu

How to Install XAMPP on Ubuntu Linux – XAMPP is one of the most widely used database management applications by web developers for creating SQL databases within the scope of the PHP programming language.

This XAMPP application is cross platform that can be installed on Windows, Linux and Mac OS. In this article I will share how to install XAMMP on Linux using the terminal.

Download XAMPP Linux

If you don’t have the installer file, please download it on the download page. You can download the version you want.

You can use the following buttons

Download XAMMP Linux

Installation Guide

Now, once the download is complete open Terminal. Then navigate to the folder where the file has been downloaded.

For example, the name of the XAMPP file I downloaded is in the Downloads folder.

Open a terminal, then type the following command:

$ cd Downloads/

Then, for installation use the following command:

$ chmod +x
$ sudo ./

Then the XAMPP application install screen will appear like this:

Install XAMPP on Ubuntu Linux

Just click Next and Next for the installation process.

When the installation is complete, the XAMPP folder will be in /opt/lampp and it will look like this:

Install XAMPP on Ubuntu Linux

Okay, so far we have finished the installation process, but it can’t be used smoothly. We have to change the access permissions of the htdocs folder.

Change htdocs Folder Permissions

Slightly different from Windows, on Windows OS we can directly access (write) files in the htdocs folder, where htdocs is the folder that we will use to store php files and others and in this folder localhost/ is located.

Linux by default will make this htdocs folder accessible only to administrators. So, with this condition we will have a bit of a problem if we want to write one of our project files which we will save in the htdocs folder.

To be able to change it to public / guest, then open a terminal using the following command:

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

*username is replaced with the username of your computer. For example, your computer username is asus, then the command will be:

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

Then, we have to update the httpd.conf file which is owned by XAMPP. Please open the file via terminal with the command:

*gedit is a text editor application that I use. You can replace it with your favorite text editor.

When the httpd.conf page opens, look for the words:

User nobody
Group nobody

Change it with :

User nobody
Group nogroup

Then save file httpd.conf.

How to Run Server on XAMPP on Linux

This becomes very important, because by running the server we can access localhost and start creating the desired website.

To be able to run an existing server on XAMPP on Linux, there are two ways:

1. Using Control Panel

To be able to run the server, open the control panel and navigate to the Manage Servers menu. Pay attention to the following picture:

Install XAMPP on Ubuntu Linux

By default, there are 3 servers provided, MySQL Database, ProFTPD and Apache. The red color indicates that the server has not been started.

Please click Start on each server and wait for the color to turn green.

2. Using Terminal

Please open a terminal, use the following command:

$ sudo /opt/lampp/xampp start

If you get a result like the following, it means the server has been running successfully.

Starting XAMPP for Linux 8.0.7-0...
XAMPP: Starting Apache...ok.
XAMPP: Starting MySQL...ok.

How to Open XAMPP Control Panel on Ubuntu?

If you want to access the XAMPP control panel, by default shortcut icons are not created automatically. So to run the XAMPP Control Panel on Linux, use the following command:

$ sudo /opt/lampp/

LocalHost Access

Okay I assume everything is running normally and the server is running, especially the Apache server.

Open a web browser, Google Chrome for example, then type localhost/ in the search form, then click Enter.

If it looks like the picture above, it’s a sign that you have successfully installed XAMPP on Linux.

Install XAMPP on Ubuntu Linux

Hopefully this article on How to Install XAMPP on Ubuntu Linux is useful for you.

Do you want to share this article? Use the share button below.

1 comment

Leave a Reply