MAMP
MAMP stands for Mac, Apache, MySQL, PHP — it's the macOS equivalent of XAMPP for Windows. Install it, click Start, and you have a working local web server for PHP development. WordPress, Laravel, Drupal, and any other PHP application run on it out of the box.
The first thing that confuses people: MAMP defaults to port 8888 for Apache and port 8889 for MySQL, not the standard ports 80 and 3306. This means your sites load at localhost:8888 instead of just localhost. There's a reason for this — and you can change it.
Why Port 8888?
Port 80 (the standard HTTP port) requires administrator privileges on macOS. MAMP uses 8888 by default so it can run without asking for your password every time you start it. On XAMPP for Windows, this isn't usually an issue, which is why XAMPP defaults to port 80.
If typing :8888 constantly annoys you, change it: open MAMP → Preferences → Ports → Set to "80 & 3306" (MAMP calls this "Set Web & MySQL ports to 80 & 3306"). You'll need to enter your Mac password when starting MAMP after this change, but your sites will load at clean localhost URLs.
Getting Started
- Download MAMP from mamp.info (the free version is fine to start)
- Install it — MAMP installs to
/Applications/MAMP - Launch MAMP and click Start
- The MAMP start page opens automatically at
localhost:8888/MAMP - Put your PHP files in
/Applications/MAMP/htdocs/
Your web root (called htdocs) is at /Applications/MAMP/htdocs/. Drop a folder there and access it at localhost:8888/your-folder. For example, if you extract WordPress into htdocs/mysite, it's at localhost:8888/mysite.
MAMP vs. MAMP PRO
MAMP comes in two versions. The installer bundles both — the free version and the PRO trial:
MAMP (Free) — One web root, manual configuration, basic but functional. Good for learning PHP or running a single project. You get Apache, MySQL, and PHP with a simple Start/Stop interface.
MAMP PRO ($99 one-time) — Multiple virtual hosts (run several sites with custom domains like mysite.local), per-project PHP version switching, Nginx option, built-in email testing, dynamic DNS, and a proper GUI for managing everything. Worth it if you juggle multiple PHP projects.
Key Configurations
Changing the Document Root
By default, MAMP serves files from /Applications/MAMP/htdocs. You can change this to any folder: MAMP → Preferences → Web Server → Document Root. Point it to your project folder, Desktop, or wherever you keep your code.
PHP Version
MAMP ships with multiple PHP versions. Switch between them in MAMP → Preferences → PHP. This is useful for testing compatibility or running projects that require specific PHP versions.
MySQL Access
# Default MAMP MySQL credentials:
Host: localhost (or 127.0.0.1)
Port: 8889 (not the standard 3306!)
Username: root
Password: root
# phpMyAdmin is at:
http://localhost:8888/phpMyAdmin
# Connect from terminal:
/Applications/MAMP/Library/bin/mysql -u root -p
# Password: root
The non-standard MySQL port (8889) catches people. If your PHP application can't connect to the database with default settings, check that you're using port 8889, not 3306. Or switch MAMP to standard ports as described above.
MAMP vs. Alternatives in 2026
| Tool | Best For | Pros | Cons |
|---|---|---|---|
| MAMP | PHP beginners on Mac | Simple GUI, just works | Non-standard ports, single doc root (free), dated |
| XAMPP | PHP beginners on Windows | More popular, standard ports | Less elegant on Mac |
| Laravel Valet | Laravel/PHP devs on Mac | Automatic .test domains, fast, lightweight | Mac only, command-line setup |
| Docker | Consistent environments | Matches production exactly, any stack | Steeper learning curve, resource heavy |
| Laragon | PHP devs on Windows | Auto virtual hosts, fast | Windows only |
MAMP is still a solid choice for getting started quickly on Mac. But if you're doing professional PHP development, Laravel Valet (for Mac) or Docker (any platform) are generally better choices because they use standard ports, support multiple projects out of the box, and more closely match production environments.
Troubleshooting
Apache won't start: Something else is using port 8888 (or 80 if you changed it). On macOS, the built-in Apache or another service might be running. Check with lsof -i :8888 in Terminal. If macOS's built-in Apache is running, stop it with sudo apachectl stop.
MySQL won't start: Often caused by a dirty shutdown. Delete the PID file at /Applications/MAMP/db/mysql*/your-hostname.pid and try again. If that doesn't work, check if port 8889 (or 3306) is occupied.
"localhost:8888 refused to connect" after macOS update: macOS updates sometimes reset network settings or re-enable the built-in Apache. Restart MAMP. If it still doesn't work, reinstall MAMP (your htdocs and databases are preserved).