Installing WordPress on MAMP creates a local macOS site for theme work, plugin testing, content imports, and configuration changes that should be checked before they touch a hosted environment. The stack stays on the Mac, so the first administrator account, database, and files can be replaced without affecting a live site.
MAMP provides a local Apache or Nginx web server, MySQL, and PHP from one app. The active web root is controlled from Settings → Server, and the default document root for MAMP on macOS is /Applications/MAMP/htdocs.
Using a dedicated project folder under the MAMP document root keeps the WordPress files separate from the default start page and makes the local URL predictable. MAMP defaults to Apache port 8888, Nginx port 7888, and MySQL port 8889, while the stock local database values for the WordPress installer are root, root, and localhost.
Steps to install WordPress on MAMP:
- Open Settings → Server in MAMP and note the active document root.
Default document root: /Applications/MAMP/htdocs
- Open Settings → Ports and confirm the active web-server and MySQL ports.
Apache Port: 8888 Nginx Port: 7888 MySQL Port: 8889
MAMP can switch the web and database services to 80 and 3306, so the browser URLs should match the active web-server port.
- Start the local MAMP servers and wait for the toolbar status to turn green.
- Create a dedicated project folder under the active MAMP document root.
/Applications/MAMP/htdocs/wordpress-mamp
Keeping WordPress in its own subdirectory avoids overwriting the default MAMP landing page and leaves room for multiple local projects under the same stack.
- Download and unzip the current WordPress package from wordpress.org.
https://wordpress.org/download/
- Copy the extracted WordPress files into the new project folder.
Copy the contents of the extracted wordpress directory into wordpress-mamp so the local site opens at a short project URL instead of /wordpress/wordpress/.
- Click WebStart in MAMP and open phpMyAdmin from the tools list.
- Create a database for the local site in phpMyAdmin.
Database name: wordpress_mamp Collation: utf8mb4_general_ci
The empty-database message No tables found in database. is expected immediately after creation because WordPress has not created its tables yet.
- Open the local project URL in a browser to start the WordPress installer.
http://localhost:8888/wordpress-mamp/
Use http://localhost:7888/wordpress-mamp/ when MAMP is serving the project through Nginx, or http://localhost/wordpress-mamp/ when the web server is set to port 80.
MAMP documents a Safari issue where the AdBlock extension can break the WordPress installer on the default ports, so pause that extension during setup if Safari is the browser in use.
- Enter the database connection values in the WordPress installer.
Database Name: wordpress_mamp Username: root Password: root Database Host: localhost Table Prefix: wp_
If the local MySQL account or password was changed earlier, use those values instead of the stock MAMP credentials.
If WordPress cannot write wp-config.php automatically, copy wp-config-sample.php to wp-config.php inside the project folder, reload the installer, and submit the same database values again.
- Complete the site details form and create the first administrator account.
Site Title: WordPress on MAMP Username: localadmin Password: choose-a-strong-password Email: admin@example.test
- Sign in to the local WordPress dashboard and confirm that both the dashboard and the front page load from the MAMP project URL.
Dashboard: http://localhost:8888/wordpress-mamp/wp-admin/ Front page: http://localhost:8888/wordpress-mamp/
- Change the permalink structure to Post name.
Dashboard -> Settings -> Permalinks -> Post name
- Request the local login endpoint from Terminal when a command-line smoke test is useful.
$ curl -I http://localhost:8888/wordpress-mamp/wp-login.php HTTP/1.1 200 OK Set-Cookie: wordpress_test_cookie=WP%20Cookie%20check; path=/; HttpOnly Content-Type: text/html; charset=UTF-8
Replace 8888 with the active MAMP web-server port when the project uses Nginx or a custom port.
Mohd Shakir Zakaria is a cloud architect with deep roots in software development and open-source advocacy. Certified in AWS, Red Hat, VMware, ITIL, and Linux, he specializes in designing and managing robust cloud and on-premises infrastructures.