Running the built-in Apache service automatically after a reboot keeps local sites, reverse proxies, webhook endpoints, and test vhosts available without a manual recovery step every time macOS starts.
macOS still ships Apple-supplied Apache httpd as the launchd service org.apache.httpd. The Apache-facing wrapper /usr/sbin/apachectl is still available, but the persistent boot-time state is owned by launchd through /System/Library/LaunchDaemons/org.apache.httpd.plist, which starts the current /usr/sbin/httpd-wrapper program with the system Apache configuration under /etc/apache2.
These steps target the Apple-provided Apache stack, not a Homebrew-installed httpd service. Use an administrator account, test the configuration before enabling boot startup, and expect launchctl status output to vary by macOS release; for example, some systems show enabled while others show false for the same not-disabled state.
Related: How to test Apache configuration
Related: How to enable or disable Apache modules
Steps to configure automatic Apache startup on macOS:
- Open Terminal with an account that can use sudo.
- Validate the active Apache configuration before enabling automatic startup.
$ sudo apachectl configtest Syntax OK
A syntax error can prevent boot-time startup and trigger repeated restart attempts.
Related: How to test Apache configuration
- Enable the built-in launchd job for Apache.
$ sudo launchctl enable system/org.apache.httpd
Current launchctl guidance favors the explicit enable and disable service controls. Apple-supplied system daemons are already known to the system domain, so you do not need to bootstrap a separate third-party plist for this built-in service.
- Start or restart the Apache job immediately under launchd supervision.
$ sudo launchctl kickstart -k system/org.apache.httpd
The kickstart -k option terminates an existing instance before starting a fresh one.
If you prefer the Apache wrapper, sudo apachectl start enables and starts the same built-in service through launchctl compatibility commands.
- Verify that launchd reports the job as running.
$ sudo launchctl print system/org.apache.httpd system/org.apache.httpd = { path = /System/Library/LaunchDaemons/org.apache.httpd.plist state = running program = /usr/sbin/httpd-wrapper ##### snipped ##### } - Confirm that the service is allowed to start at boot.
$ sudo launchctl print-disabled system | grep 'org\.apache\.httpd' "org.apache.httpd" => enabled
If this line shows enabled or false, the Apache service is not disabled for boot. The exact wording depends on the macOS release.
- Confirm that the local server responds after launchd starts it.
$ curl -I http://localhost/ HTTP/1.1 403 Forbidden Date: Thu, 09 Apr 2026 04:22:24 GMT Server: Apache Content-Type: text/html; charset=iso-8859-1
A 403 Forbidden response still proves that Apache is listening. A 200 OK response is also fine if your default site allows access.
- Disable automatic startup if it is no longer required.
$ sudo launchctl disable system/org.apache.httpd
- Stop and unload the current system Apache job.
$ sudo launchctl bootout system/org.apache.httpd
This stops Apache immediately and keeps it disabled until it is enabled again.
Mohd Shakir Zakaria is a cloud architect with deep roots in software development and open-source advocacy. Certified in AWS, Red Hat, VMware, ITIL, and Linux, he specializes in designing and managing robust cloud and on-premises infrastructures.
