MAMP — Mac Localhost Development

MAMP (Mac, Apache, MySQL, PHP) is the most popular local development environment for macOS. Run PHP websites, WordPress, and web applications locally on your Mac. Access sites at localhost or localhost:8888 and manage databases through phpMyAdmin.

MAMP Localhost: http://localhost:8888
MAMP stack showing Mac, Apache, MySQL, PHP

MAMP vs MAMP PRO

FeatureMAMP (Free)MAMP PRO
PriceFree$39 (one-time)
Virtual HostsManual configEasy GUI setup
Multiple PHPSwitch manuallyPer-host PHP version
SSL/HTTPSManualOne-click
Cloud SyncNoYes

How to Install MAMP

  1. Download MAMP — From mamp.info
  2. Open .pkg installer — Drag to Applications
  3. Launch MAMP — From Applications folder
  4. Click Start — Starts Apache and MySQL
  5. Status lights turn green — Services running
  6. WebStart page opens — localhost:8888/MAMP

MAMP Default Ports

ServiceDefault PortStandard Port
Apache (HTTP)888880
Nginx (if used)888880
MySQL88893306
Why port 8888? Ports below 1024 require admin privileges on macOS. MAMP uses 8888 to avoid permission issues. You can change to port 80 in preferences (requires password).

MAMP Directory Structure

PathPurpose
/Applications/MAMP/htdocs/Document root (your sites)
/Applications/MAMP/db/MySQL databases
/Applications/MAMP/conf/Configuration files
/Applications/MAMP/logs/Error logs

Create Your First Site

  1. Open Finder → Applications → MAMP → htdocs
  2. Create new folder: mysite
  3. Create file: index.php
  4. Add: <?php echo "Hello from MAMP!"; ?>
  5. Visit: http://localhost:8888/mysite

Access phpMyAdmin

  • URL: http://localhost:8888/phpMyAdmin
  • Username: root
  • Password: root

Change Document Root

  1. Open MAMP application
  2. Click Preferences (or MAMP → Preferences)
  3. Go to Web Server tab
  4. Click folder icon next to Document Root
  5. Select your project folder
  6. Click OK → Restart servers

Use Standard Ports (80, 3306)

  1. Open MAMP → Preferences
  2. Go to Ports tab
  3. Click Set Web & MySQL ports to 80 & 3306
  4. Click OK
  5. Enter admin password when prompted
  6. Access site at http://localhost (no port)

MAMP vs XAMPP on Mac

FeatureMAMPXAMPP
Native Mac feel✅ YesCross-platform UI
PRO upgrade✅ AvailableNo pro version
Default port888880
Nginx option✅ YesApache only

Troubleshooting

ProblemSolution
Apache won't startCheck if port 8888 is in use
MySQL won't startDelete /Applications/MAMP/db/mysql/*.pid
localhost not loadingEnsure MAMP is running (green lights)
Permission deniedCheck htdocs folder permissions