How to disable default Apache Server on macOS Big Sur to release port 80?

2021-01-21 macOS

macOS 11.0 Big Sur comes with Apache 2.4 pre-installed. This leads to a situation where port 80 is taken and you cannot use it for other purposes (like creating Docker environments).

When you go to http://localhost, you will see “It works!”.

To stop Apache Server, open your Terminal and type: sudo apachectl stop

Unfortunately after you restart your macOS, Apache Server will summon itself again.

To prevent auto-start of Apache Server type: sudo launchctl unload /System/Library/LaunchDaemons/org.apache.httpd.plist 2>/dev/null