Search Our Database

How to disable a service in Windows to free a Port

Last updated on |
by

Introduction

Sometimes, critical ports such as 80, 443, or 3306 may be occupied by unnecessary or conflicting services on a Windows system. This can prevent other applications—like Apache, Nginx, MySQL, or Docker—from running properly. To resolve these conflicts, it is often necessary to identify and disable the Windows service that is occupying the port.

Disabling a service that is no longer needed can help free up system resources, reduce security risks, and avoid port binding conflicts. For example, World Wide Web Publishing Service (W3SVC) may use port 80 and conflict with third-party web servers.

This article explains how to check which service is using a port, identify its associated Windows service, and safely disable it using Command Prompt, PowerShell, or Services.msc GUI.

 

Prerequisites

  • Windows 7, 8, 10, 11, or Windows Server
  • Administrator privileges
  • A specific port number that you want to free (e.g., 80, 443, 3306)
  • Familiarity with basic Windows tools (CMD, PowerShell, or Services console)

 

Step-by-step Guide

Step 1: Identify the Process ID (PID) Using the Port

Open Command Prompt as Administrator and run:

netstat -aon | findstr :80

Replace :80 with the port number you want to check.

Example output:

TCP    0.0.0.0:80     0.0.0.0:0     LISTENING     1234

Here, 1234 is the Process ID (PID) of the application using port 80.

 

Step 2: Identify the Application Using the PID

Now find out which application or service owns this PID:

tasklist /fi "PID eq 1234"

This will return the name of the executable (e.g., svchost.exe).

Tips 🖊️: If the result is svchost.exe, it likely hosts multiple services. Use the next step to narrow it down.

 

Step 3: Identify the Associated Service

Run this command to find which service(s) are running under the PID:

sc queryex type= service | findstr "1234"

Alternatively, use:

tasklist /svc /fi "PID eq 1234"

This will return the service name (e.g., W3SVC or SQLSERVERAGENT).

 

Step 4: Disable the Service Using Services Console (GUI)

  1. Press Windows + R, type services.msc, and press Enter.
  2. Look for the service name you found (e.g., World Wide Web Publishing Service).
  3. Right-click the service and choose Properties.
  4. Under Startup type, choose Disabled.
  5. Click Stop to stop the running instance.
  6. Click Apply and then OK.

 

Step 5: Alternatively, Disable the Service via Command Line

To disable the service from Command Prompt or PowerShell:

sc config "W3SVC" start= disabled
net stop "W3SVC"

Replace W3SVC with your actual service name.

Conclusion

Disabling unused or conflicting services is a quick and effective way to free up ports on a Windows machine. By identifying which service is using the port and disabling it safely via the Services console or command line, you can ensure your required applications start and function without interference.

Be cautious when disabling services—make sure the service is not essential to the operating system or another application.

Should you have any inquiries about the guidelines, please feel free to open a ticket through your portal account or contact us at support@ipserverone.com. We’ll be happy to assist you further.