Unofficial archive. This is a read-only, community-run archive of the Apple Support Community. It is not affiliated with or endorsed by Apple Inc.

Setting up a local web server on a Mac

Helpful153Views394,786Last modified Sep 29, 2026 10:30 AM

These instructions are slightly different for each version of macOS. Please see the User Tip appropriate for your macOS version.

Setting up a local web server on MacOS X 10.6 "Snow Leopard"

Setting up a local web server on MacOS X 10.7 "Lion"

Setting up a local web server on OS X 10.8 "Mountain Lion"

Setting up a local web server on OS X 10.9 "Mavericks"

Setting up a local web server on OS X 10.10 "Yosemite"

Setting up a local web server on OS X 10.11 "El Capitan"

Setting up a local web server on macOS 10.12 "Sierra"

Setting up a local web server on macOS 10.13 "High Sierra"

Setting up a local web server on macOS 10.14 “Mojave”

Setting up a local web server on macOS 10.15 “Catalina”

Setting up a local web server on macOS 11 “Big Sur”

Setting up a local web server on macOS 12 “Monterey”

Setting up a local web server on macOS 13 “Ventura”

Setting up a local web server on macOS 14 “Sonoma”

Setting up a local web server on macOS 15 “Sequoia”

Setting up a local web server on macOS 26 “Tahoe”

Setting up a local web server on macOS 27 “Golden Gate”

Helpful (153)

Comments

Great guide, thanks John.


Just a note, in case anyone has the same issue. At first I couldn't get this to work. I tried logging out and back in (still no joy), then restarting the mac (still no joy).


Try doing both of those first. However, if, like me, you still can't get the local host site to load, try the following: You should find a file at /Library/WebServer/Documents/index.html.en . This contains the text "It works!" referred to in the post. What I did was duplicate that file in the same folder and changed the duplicate's name to 'index.html', leaving the original in situ.


Both local and user sites then loaded. After which, I was able to delete the duplicated file and everything now works without issue. Just to be clear, leave the original file index.html.en where it is, untouched and unharmed throughout this step.


Not sure why I had to take this mysterious detour - probably something local to my machine, but if you're having trouble after following the guide above, see if it helps.

Testing user tips

Hi Etresoft. On my new iMac, with OS 10.13.3, the php version is 7. I had to tweak a few things to get 5.6

Austin Kinsella1 wrote:


Hi Etresoft. On my new iMac, with OS 10.13.3, the php version is 7.

When did that happen? I updated that for High Sierra. Oh well, I've updated it again. Thanks!