Create your first MAMP PRO site
In this tutorial you will set up a local development site with MAMP PRO from scratch. By the end you will have a virtual host with its own domain running on your Mac, and a PHP page served from it in the browser.
What you need: MAMP PRO installed on macOS. If you haven’t installed it yet, see Installation.
Part 1: Start MAMP PRO and the servers
Section titled “Part 1: Start MAMP PRO and the servers”-
Open MAMP PRO.
Launch MAMP PRO from
/Applications/MAMP PRO.appor via Launchpad. The MAMP PRO window opens with the Sites list on the left and the site configuration panel on the right. -
Start the servers.
Click the Start button in the top-right of the toolbar. MAMP PRO may ask for your macOS administrator password to modify system files such as
/etc/hosts.Once both servers are running, the button changes to Stop and the status indicator turns green. You now have Apache (or Nginx) and MySQL running on your Mac.
-
Confirm the server is working.
Open your browser and go to
http://localhost:8888. You should see the MAMP PRO default page, which confirms the web server is active.
Part 2: Create a new site
Section titled “Part 2: Create a new site”Unlike MAMP, MAMP PRO gives each project its own virtual host – a dedicated domain name that maps to a specific folder on your Mac. This means your projects get realistic URLs like myproject.local instead of localhost:8888/myproject/.
-
Click the + button in the lower-left corner of the Sites list to create a new site.
The first time you do this, MAMP PRO will show a dialog explaining that the SSL environment needs to be set up. Click OK and enter your macOS administrator password when prompted. This is a one-time step.
-
Choose the site type.
A dialog appears with several site types. Select Empty – this creates a new site with a simple placeholder page so you can verify everything works before adding your own files.
-
Set the site name.
Enter a name for your site, for example
myproject.local. This name becomes the domain you use in the browser. MAMP PRO automatically creates a matching folder at~/Sites/myproject.localand adds an entry to/etc/hostsso your Mac resolves the domain locally. -
Click Apply.
MAMP PRO writes the new virtual host configuration and restarts the servers. The new site appears in the Sites list. If its icon is blue, the site is accessible.
Part 3: Open your site in the browser
Section titled “Part 3: Open your site in the browser”-
Click the Open button to the right of the site name field in the configuration panel.
Your default browser opens and navigates to
http://myproject.local:8888. You should see the MAMP PRO placeholder page for your new site. -
Switch to port 80 (optional).
If you prefer
http://myproject.localwithout the port number, go to Settings › Ports and click 80 & 3306. After clicking Apply, your site is accessible athttp://myproject.localdirectly.
Part 4: Add your first PHP file
Section titled “Part 4: Add your first PHP file”-
Open the site folder in Finder.
In the MAMP PRO configuration panel, click the folder icon next to the Site folder field. Finder opens the folder
~/Sites/myproject.local. You will see anindex.phpfile placed there by MAMP PRO. -
Replace the placeholder page.
Open
index.phpin a text editor and replace its contents with:<?phpecho "<h1>Hello from MAMP PRO!</h1>";echo "<p>PHP version: " . PHP_VERSION . "</p>";echo "<p>Document root: " . $_SERVER['DOCUMENT_ROOT'] . "</p>";Save the file.
-
Reload the browser.
Go back to your browser and reload
http://myproject.local:8888. The page now shows your PHP output, including the active PHP version and the document root path.
What you have built
Section titled “What you have built”You now have a fully working local development environment with MAMP PRO:
- A dedicated virtual host (
myproject.local) served by Apache - A dedicated site folder (
~/Sites/myproject.local) that maps to the domain - PHP running and processing
.phpfiles
Where to go next:
- Set a specific PHP version for your site – each site can run a different PHP version
- Create a WordPress site – let MAMP PRO install WordPress automatically
- Set up SSL – serve your site over HTTPS locally
- Connect to the database – use phpMyAdmin or connect via PHP