How I like to set MAMP up
June 6th, 2017

MAMP is a very handy server environment for web stuff, here’s what i do to set it up:

mamp set up 1

use my ‘Sites’ folder as document root - basically keep it out of the MAMP application so when i upgrade mamp or migrate my user folder it keeps my stuff


mamp set up 2

Change the apache port to 80 - that way my urls look normal and don’t have the colon/port number after them

read more about all that here:


I like to make virtual hosts for all my development websites. I call them, rather than their online equivalent for instance. This makes lots of things work better (i.e. the same document root for your code).

edit your hosts file here: /etc/hosts

I install the terminal command for TextMate and Sublime, so currently I type this in terminal to open that file:

sublime /etc/hosts

add a line to this file that looks like this:

The open this file within the MAMP application:


Find this line (use the find tool - its around line 584 on mine, but this sort of thing changes):

# Virtual hosts
#Include /Applications/MAMP/conf/apache/extra/httpd-vhosts.conf

remove the hash before ‘Include’ so it looks like this:

# Virtual hosts
Include /Applications/MAMP/conf/apache/extra/httpd-vhosts.conf

Then go to this file:


There are various examples there, but the minimum you need (and i never use any more than this) is below. You must redefine ‘localhost’ to be the same folder you set up as the MAMP document root above. Then you can define as many virtual hosts as you like with the second bit:

<VirtualHost *:80>
   DocumentRoot /Users/yourusername/Sites/
   ServerName localhost

<VirtualHost *:80>
   DocumentRoot “/Users/yourusername/Sites/sitefolder”

In the above example yourusername is your user folder, sitefolder is the folder you’ve got your site in, is what you defined in the /etc/hosts file.

Now stop, then start the MAMP server and you should be able to go to and it will work.


A hand trick to find the exact location of a file/folder in the way that MAMP and many other bits of software expect to see it is to grab the file and drag it into a terminal window - you can then copy this path, much quicker than typing it.