Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

XAMPP Linux Launcher: Create a Desktop Shortcut

· 5 min read · Home Automation

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

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

  1. Find your XAMPP installation path. Open a terminal and run ls /opt/lampp. If you see files like manager-linux.run and xampp, your path is /opt/lampp. If you installed elsewhere, adjust the paths below accordingly.
  2. Create a .desktop file. Open a text editor and create a new file. Name it something like xampp-control-panel.desktop. You can save it in your home folder first for editing.
  3. Write the desktop entry content. Copy and paste the following into the file, then adjust the Exec and Icon lines if your path differs:
    [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=true
    
    The Exec line must point to the actual manager-linux.run file. The Icon line can point to /opt/lampp/xampp.png if that file exists; if not, you can use a generic icon like utilities-terminal.
  4. 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.
  5. Make the file executable. Open a terminal and run:
    chmod +x ~/.local/share/applications/xampp-control-panel.desktop
    If you saved it to the Desktop, replace the path accordingly. This step is critical—without it, the launcher will not run.
  6. 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 with ls.
  • 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 Exec line to Exec=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 the Icon line.
  • If you move your XAMPP installation, update the Exec line 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:

  1. Check the terminal output. Open a terminal and run /opt/lampp/manager-linux.run manually. If it fails, you'll see an error message (e.g., missing library or permission issue).
  2. Verify the file permissions. Run ls -l ~/.local/share/applications/xampp-control-panel.desktop and ensure the first column shows -rwxr-xr-x or similar with an x for the owner. If not, re-run the chmod command.
  3. Check the path again. Sometimes the file is named manager-linux-x64.run on 64-bit systems. Use ls /opt/lampp to see the exact filename and update Exec accordingly.
  4. 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.
  5. Recreate the file. If all else fails, delete the .desktop file 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.