Uninstall Apache as a Service on Windows

Today I share how you can uninstall the Apache Windows service.

Why uninstall the Apache Service

If you want to reinstall Apache you will want to remove the service first. This ensures you will be able to fully uninstall apache before reinstall.

In other situations you might want to reinstall the service with different parameters.

Uninstalling the Apache Windows Service

To uninstall Apache as a service you need to use an admin command prompt. This can be opened by typing cmd in the search bar and right clicking it to select “Run as administrator”.

Once the command window is open you need to cd into the bin directory of the apache folder. This is the folder that holds httpd.exe.

To uninstall the service, if it was installed with the default name, you can run.

httpd.exe -k uninstall 

If the service is installed with a custom name you can use the -n flag to specify which apache service to remove. In the below example I am removing the apache service called “Apache HTTP Server”

httpd.exe -k uninstall -n "Apache HTTP Server"

Using these commands you can remove any Apache service installed using httpd.exe.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.