DEV Community

Vishnu Damwala
Vishnu Damwala

Posted on • Originally published at meshworld.in

Install XAMPP on Ubuntu

A XAMPP is one of the most popular cross-platform PHP development environment. It is an open source package that can be easily install and to use.

XAMPP stands for cross-platform (X), Apache (A), MariaDB (M), PHP (P), and Perl (P).

XAMPP has been used widely by developers and has been around here with huge support of community since more than 10 years. It's currently available on Windows, Linux & Mac platforms while writing this article.

To download the Linux installer head over to the Download page. Here you will find latest release as well as previous versions.

While writing this article, the latest release version is 8.0.6. In this article, we will see how to install this open-source application in Ubuntu or Ubuntu-based distributions. Follow the same steps to install into other Ubuntu-based Distros.

Install XAMPP on Ubuntu or Ubuntu-based Distros

Download the XAMPP installer

Head over to XAMPP Home page and select XAMPP for Linux, that contains direct link that can be used for the latest version.

Source: apachefriends.org

Once it's downloaded, open your terminal (Ctrl + Alt + T), head over to your directory where your installer has been saved and run the below commands with sudo privileges to change the permission.

sudo chmod 755 xampp-linux-*-installer.run
Enter fullscreen mode Exit fullscreen mode

This command will give permission to the installer.

Note: Replace xampp-linux-*-installer.run with actual file name.

Run the XAMPP installer

sudo ./xampp-linux-*-installer.run
Enter fullscreen mode Exit fullscreen mode

This command will start the installer wizard. Proceed with installation, make changes if you need. By default it will be installed in /opt/lampp/ directory, you can customize the installation directory too.

Install supporting package

sudo apt install net-tools -fy
Enter fullscreen mode Exit fullscreen mode

This command will install netstat that is a part of the net-tools package.

Start, Stop & Restart Server

Start, Stop & Restart Server via command line aka CLI

  • Start the server with below command
sudo /opt/lampp/lampp start
Enter fullscreen mode Exit fullscreen mode
  • Stop the server with below command
sudo /opt/lampp/lampp stop
Enter fullscreen mode Exit fullscreen mode
  • Restart the server with below command
sudo /opt/lampp/lampp restart
Enter fullscreen mode Exit fullscreen mode

Start, Stop & Restart Server via Graphical User Interface aka GUI

  • Execute the below command to launch graphical manager
sudo /opt/lampp/manager-linux-x64.run
Enter fullscreen mode Exit fullscreen mode

Create alias or shortcuts for commands for Bash Shell

Below command will create an alias for command for Bash shell, so you only need to use lamppStart to launch the graphical manager. You might need to reopen the terminal to use this newly added alias.

echo "alias lamppStart='cd /opt/lampp/ && sudo ./manager-linux-x64.run'" >> ~/.bashrc
Enter fullscreen mode Exit fullscreen mode

Creating a launcher icon

With the below code, you can create it a launcher icon.

cat > ~/.local/share/applications/postman.desktop <<EOL
[Desktop Entry]
Version=1.2
Encoding=UTF-8
Name=XAMPP
Exec=sh -c "pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY sudo /opt/lampp/manager-linux-x64.run"
Icon=/opt/lampp/htdocs/favicon.ico
Terminal=false
Type=Application
Categories=Network;WebBrowser;Development;
MimeType=text/html
EOL
Enter fullscreen mode Exit fullscreen mode

Uninstall XAMPP

  • To uninstall XAMPP, open the terminal and navigate to the opt/lampp directory with the below command.
 cd /opt/lampp
Enter fullscreen mode Exit fullscreen mode
  • Execute the below command to uninstall XAMPP.
 sudo ./uninstall
Enter fullscreen mode Exit fullscreen mode
  • The prompt dialogue box will open asking for your confirmation to uninstall XAMPP and all of its modules.
  • Finally, remove the lampp installation directory with below command.
 sudo rm โ€“r /opt/lamp
Enter fullscreen mode Exit fullscreen mode

Conclusion

After reading this article, you will be able install XAMPP on Ubuntu or Linux devices.

XAMPP allows you to set up a free development environment on your system. It is a set of tools that allows you to get your site up and running much easily & quickly. An alternative to installing and configuring individual components.

Read the complete post on our site Install XAMPP on Ubuntu

Read others post on our site MeshWorld

Hope you like this!

Keep helping and happy ๐Ÿ˜„ coding

Top comments (1)

Collapse
 
aureliodeguzma2 profile image
Aurelio De Guzman

Thanks