XAMPP Linux Launcher: Create a Desktop Shortcut
In this article
To create a Linux launcher for the XAMPP control panel, you create a .desktop file that points to the manager-linux.run script inside your XAMPP installation folder. This gives you a clickable icon in your application menu or desktop instead of typing commands in the terminal every time. You'll need a text editor (like gedit or nano) and the exact path to your XAMPP folder (usually /opt/lampp).
What You'll Need
- A working XAMPP installation (default location:
/opt/lampp) - A text editor (gedit, nano, or any GUI editor)
- File manager access to your home directory
- Terminal (for making the file executable)
Step-by-Step
- Find your XAMPP installation path. Open a terminal and run
ls /opt/lampp. If you see files likemanager-linux.runandxampp, your path is/opt/lampp. If you installed elsewhere, adjust the paths below accordingly. - Create a
.desktopfile. Open a text editor and create a new file. Name it something likexampp-control-panel.desktop. You can save it in your home folder first for editing. - Write the desktop entry content. Copy and paste the following into the file, then adjust the
ExecandIconlines if your path differs:
The[Desktop Entry] Version=1.0 Type=Application Name=XAMPP Control Panel Comment=Start and stop Apache, MySQL, and other XAMPP services Exec=/opt/lampp/manager-linux.run Icon=/opt/lampp/xampp.png Terminal=false Categories=Development;WebDevelopment; StartupNotify=trueExecline must point to the actualmanager-linux.runfile. TheIconline can point to/opt/lampp/xampp.pngif that file exists; if not, you can use a generic icon likeutilities-terminal. - Save the file to the right location. To make the launcher appear in your application menu, save it in
~/.local/share/applications/. To put it on your desktop, save it in~/Desktop/(or~/桌面if your system uses a localized folder name). You can also place it in/usr/share/applications/for system-wide use, but that requires sudo and is not necessary for personal use. - Make the file executable. Open a terminal and run:
If you saved it to the Desktop, replace the path accordingly. This step is critical—without it, the launcher will not run.chmod +x ~/.local/share/applications/xampp-control-panel.desktop - Test the launcher. Double-click the file on your desktop, or search for “XAMPP Control Panel” in your application menu. If it opens the XAMPP control panel window, you're done.
Common Mistakes
- Wrong path in Exec: If you installed XAMPP to a different directory (e.g.,
/home/username/xampp), the launcher will fail. Always verify withls. - Forgetting to make the file executable: Without
chmod +x, the system treats the file as plain text and may open it in a text editor instead of running it. - Missing
Type=Application: This line is required for the system to recognize it as a launcher. If omitted, the file may be ignored. - Using the wrong icon path: If the icon file doesn't exist, the launcher will show a generic icon, but it will still work. Don't worry if the icon is missing.
Tips
- If you want the launcher to run with admin privileges (needed for some XAMPP operations), change the
Execline toExec=pkexec /opt/lampp/manager-linux.run. However, this will prompt for a password every time, so only do it if you need it. - You can add a custom icon by downloading an image and placing it in
~/.local/share/icons/, then referencing that path in theIconline. - If you move your XAMPP installation, update the
Execline in the launcher file accordingly. - Some desktop environments (like GNOME) may require you to log out and back in for the launcher to appear in the application menu.
Troubleshooting
If the launcher does not work, try these steps in order:
- Check the terminal output. Open a terminal and run
/opt/lampp/manager-linux.runmanually. If it fails, you'll see an error message (e.g., missing library or permission issue). - Verify the file permissions. Run
ls -l ~/.local/share/applications/xampp-control-panel.desktopand ensure the first column shows-rwxr-xr-xor similar with anxfor the owner. If not, re-run thechmodcommand. - Check the path again. Sometimes the file is named
manager-linux-x64.runon 64-bit systems. Usels /opt/lamppto see the exact filename and updateExecaccordingly. - Look for hidden errors. If double-clicking does nothing, open a terminal and run
gtk-launch xampp-control-panel(if it's in~/.local/share/applications) to see any error output. - Recreate the file. If all else fails, delete the
.desktopfile and create a new one, making sure to copy the exact content from this guide.
Frequently Asked Questions
Why does the launcher not appear in my application menu?
Make sure the file is saved in ~/.local/share/applications/ and is executable. Some desktop environments cache the menu; try logging out and back in.
Can I use this launcher to start XAMPP services automatically?
No, this launcher only opens the control panel. You still need to click “Start” for Apache and MySQL inside the panel. To start services at boot, you'd need a systemd service file, which is a different process.
What if I installed XAMPP in a different folder?
Simply change the Exec and Icon paths to match your installation location. For example, if you installed to /home/you/xampp, use /home/you/xampp/manager-linux.run.
Do I need sudo to create this launcher?
No, saving the file in your home directory (~/.local/share/applications) does not require sudo. Only system-wide launchers in /usr/share/applications need admin rights.
Why does the launcher open a terminal window?
If you set Terminal=true in the file, it will open a terminal. Make sure it is set to false as in the example.
Can I create a launcher for the XAMPP start script instead?
Yes, you can point Exec to /opt/lampp/xampp start to start all services with one click, but that won't open the GUI panel. If you want both, create two separate launchers.