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 SettingsServer, 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:

  1. Open SettingsServer in MAMP and note the active document root.
    Default document root: /Applications/MAMP/htdocs
  2. Open SettingsPorts 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.

  3. Start the local MAMP servers and wait for the toolbar status to turn green.
  4. 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.

  5. Download and unzip the current WordPress package from wordpress.org.
    https://wordpress.org/download/
  6. 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/.

  7. Click WebStart in MAMP and open phpMyAdmin from the tools list.
  8. 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.

  9. 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.

  10. 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.

  11. 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
  12. 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/
  13. Change the permalink structure to Post name.
    Dashboard -> Settings -> Permalinks -> Post name
  14. 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.