This guide covers installing the latest version of XAMPP on macOS (specifically tested for macOS Sonoma, Sequoia, and earlier versions).
Step 1: Download XAMPP for macOS
-
Open your web browser (Safari, Chrome, etc.).
-
Go to the official Apache Friends website: https://www.apachefriends.org/download.html
-
Scroll down to the XAMPP for OS X section.
-
You will likely see two types of downloads:
-
VM Version: Runs XAMPP in a virtual machine (often confusing for beginners).
-
Installer (Recommended): Runs natively on your Mac.
-
Tip: Look for the version that does not say "VM" in the filename if available, as the native version is easier to manage. However, recently, the "VM" version has become the standard for newer macOS versions due to security architecture.
-
-
Click Download (64-bit) on the latest version (e.g., PHP 8.2.x or higher).
Step 2: Install the Application
-
Open your Downloads folder and double-click the .dmg file you just downloaded (e.g., xampp-osx-8.2.x-installer.dmg).
-
A window will open showing the XAMPP icon.
-
If it is the Native Installer: Double-click the XAMPP installer icon.
-
If it is the VM Version: Drag the XAMPP icon into your Applications folder.
-
- Security Warning: You will likely see a pop-up saying "XAMPP cannot be opened because the developer cannot be verified" or "Downloaded from the internet."
-
Click Cancel.
-
Go to System Settings (or System Preferences) > Privacy & Security.
-
Scroll to the bottom. You should see a message about XAMPP being blocked. Click Open Anyway.
-
Enter your Mac password when prompted.
-
Step 3: Initial Setup & Launch
-
Go to your Applications folder.
-
Find the XAMPP folder (or the XAMPP icon if you installed the VM version).
-
Double-click to open the application.
-
Note: It might be named "manager-osx" inside the XAMPP folder.
-
-
You will see the XAMPP Control Panel.
Step 4: Starting the Servers
To run a website locally, you need to turn on the "services."
-
In the XAMPP Control Panel, click the Manage Servers tab.
- You will see three main services:
-
Apache Web Server (Required for websites)
-
MySQL Database (Required for databases)
-
ProFTPD (Usually not needed for local setups)
-
-
Select Apache Web Server and click Start. Wait for the status light to turn Green.
-
Select MySQL Database and click Start. Wait for the status light to turn Green.
If the lights turn green, your server is running successfully!
Step 5: Verify the Installation
-
Open your web browser.
-
Type http://localhost in the address bar and press Enter.
-
You should see the "Welcome to XAMPP" dashboard. This confirms that the software is installed and running correctly.
Step 6: Setting Up Your Project Files
On Windows, files go into C:\xampp\htdocs. On macOS, the location depends on which version you installed:
Option A: Standard (Native) Installation
-
Open Finder.
-
Go to Applications > XAMPP > htdocs.
-
This is your web folder. Create a new folder here (e.g., mywebsite) and place your .php or .html files inside it.
-
Access it via: http://localhost/mywebsite/
Option B: VM Installation (Common on M1/M2/M3 Macs)
If you are using the "VM" version, you cannot access the files directly through your normal Finder Applications folder effortlessly. You must "Mount" the drive first.
-
Open the XAMPP Control Panel.
-
Go to the Volumes tab.
-
Click the Mount button.
-
Once mounted, click Explore.
-
A Finder window will pop up showing the internal Linux files. Open the folder named htdocs.
-
Place your project folder (e.g., mywebsite) inside this htdocs folder.
-
Access it via: http://localhost:8080/mywebsite (Note: VM versions sometimes require port 8080).
________________________________________________________________
Troubleshooting Common macOS Issues
1. "Apache" will not start (Port 80 Error)
macOS often uses Port 80 for built-in file sharing or developer tools.
-
Fix: In the XAMPP Control Panel, select Apache > Configure. Change the port from 80 to 8080.
-
You will then access your sites via http://localhost:8080.
2. MySQL keeps stopping
This is common on M1/M2/M3 Macs if you downloaded an older Intel-only version of XAMPP.
-
Fix: Ensure you downloaded the latest version from the website, which often includes architecture fixes. If it persists, restart your computer and try starting MySQL before Apache.
3. Permissions Error (403 Forbidden)
If you see "Access Forbidden" when trying to view your site:
-
Open the terminal inside the XAMPP folder and run a command to reset permissions (advanced), OR simply ensure your folder names in htdocs do not have spaces or special characters.