How to start Apache automatically on macOS boot

Running Apple's built-in Apache service under launchd keeps local sites, reverse proxies, webhook receivers, and test virtual hosts available after a Mac restarts. Boot-time startup matters most when the machine provides a local development endpoint or lightweight intranet service that should be ready before anyone opens Terminal.

macOS defines the Apple-supplied Apache httpd launch daemon as org.apache.httpd. The built-in plist lives under Apple's LaunchDaemons directory and runs httpd-wrapper with KeepAlive enabled, while the web server still reads its configuration from /etc/apache2 through the apachectl wrapper and httpd binary shipped with macOS.

The commands target the built-in macOS Apache stack, not a Homebrew, MacPorts, MAMP, XAMPP, or other packaged httpd service. Use an administrator account, confirm the configuration parses before enabling the daemon, and verify both the persistent launchd disabled state and the local HTTP response before relying on the next reboot.

Steps to configure automatic Apache startup on macOS:

  1. Open Terminal with an account that can use sudo.
  2. Confirm the Apple-supplied Apache launch daemon is present.
    $ plutil -p /System/Library/LaunchDaemons/org.apache.httpd.plist
    {
      "Disabled" => true
      "KeepAlive" => true
      "Label" => "org.apache.httpd"
      "ProgramArguments" => [
        0 => "/usr/sbin/httpd-wrapper"
        1 => "-D"
        2 => "FOREGROUND"
      ]
    ##### snipped #####
    }

    The Disabled key is the shipped default in the Apple plist. The persistent operator override is stored by launchd and appears in the launchctl print-disabled system output after the service is enabled.

  3. 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.

  4. Enable the built-in launchd job for boot-time startup.
    $ sudo launchctl enable system/org.apache.httpd

    Apple-supplied system daemons are already known to the system domain, so no separate third-party plist has to be bootstrapped for this built-in service.

  5. Start or restart Apache 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.

    The macOS apachectl wrapper still exists. Its start action uses the older launchctl load -w compatibility path for the same Apple plist.

  6. Confirm that Apache is no longer disabled in the system launchd domain.
    $ sudo launchctl print-disabled system
    
    	disabled services = {
    		"com.apple.CSCSupportd" => disabled
    		"com.apple.ftpd" => disabled
    ##### snipped #####
    		"org.apache.httpd" => enabled
    ##### snipped #####
    	}

    If this line shows enabled or false, the Apache service is not disabled for boot. The exact wording depends on the macOS release.

  7. Verify that launchd reports the Apache job as running.
    $ sudo launchctl print system/org.apache.httpd
    system/org.apache.httpd = {
        active count = 1
        path = /System/Library/LaunchDaemons/org.apache.httpd.plist
        type = LaunchDaemon
        state = running
        program = /usr/sbin/httpd-wrapper
    ##### snipped #####
    }
  8. Confirm that the local server responds after launchd starts it.
    $ curl -I http://localhost/
    HTTP/1.1 403 Forbidden
    Date: Sat, 06 Jun 2026 08:02: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.

  9. Repeat the launchctl print and curl checks after the next reboot if the host needs proof that Apache starts before manual intervention.