Home Search

DriveWorks Pro 22
How To: Configure Windows Firewall for SQL Server (KB13103002)

Send Feedback

How To: Configure Windows Firewall for SQL Server

This document will show you how to open remote access to SQL Server by configuring Windows Firewall.

Applies To

  • Windows 8.1
  • Windows 10
  • Windows Server 2016
  • Windows Server 2019
  • Microsoft SQL Server Express/Standard or higher editions 2012 or later.
  • Microsoft SQL Server Compact Edition 4.0 or later.

Prerequisites

To follow the steps in this document you will need to have one of the versions of SQL Server running on one of the versions of Windows mentioned above.

This article only applies to Windows Defender Firewall. Other Firewalls may have similar settings that can be applied.

It is also assumed that you have configured SQL Server for remote access, either manually, or by following the steps in How To: Configure SQL Server for Remote Access.

You need to be a member of the Administrators group to perform the steps in this document.

Configure Windows Firewall

There are two methods for configuring Windows Firewall for SQL Server.

Choose one of the two methods below, that best suits your IT policy:

Create Inbound Rules for the SQL Server Ports

This method will target the specific ports SQL Server uses for communication.

  1. Open Windows Control Panel and select System and Security.

  2. From the System and Security window, click Windows Defender Firewall.

  3. From the Windows Defender Firewall window, click Advanced Settings.

  4. Add the port SQL uses for TCP.

    From the Windows Defender Firewall with Advanced Security window:

    Select Inbound Rules from the left hand column.

    Click New Rule... from the Actions column.

  5. From the New Inbound Rule Wizard, select Port.

    Click Next.

  6. Select TCP.

    Select Specific local ports.

    Enter 1433.

    Click Next.

  7. Select Allow the connection.

    Click Next.

  8. Select Domain, Private and Public.

    Click Next.

  9. Enter a name for the rule.

    For example: SQL TCP.

  10. Add the port SQL uses for UDP.

    From the Windows Defender Firewall with Advanced Security window:

    Select Inbound Rules from the left hand column.

    Click New Rule... from the Actions column.

  11. From the New Inbound Rule Wizard, select Port.

    Click Next.

  12. Select UDP.

    Select Specific local ports.

    Enter 1434.

    Click Next.

  13. Select Allow the connection.

    Click Next.

  14. Select Domain, Private and Public.

    Click Next.

  15. Enter a name for the rule.

    For example: SQL TCP.

    Click Finish.

Allow the SQL Server applications in the Firewall

This method will open all ports for access to SQL Server.

  1. Open Windows Control Panel and select System and Security.

  2. From the System and Security window, click the link to Allow an app through Windows Firewall.

  3. Allow the SQL Server Browser:

    Click the Allow another app... button.

    If your Windows Firewall settings are managed by your system administrator, you may need to click the Change Settings button.

  4. Click the Browse button.

    Browse to sqlbrowser.exe

    This is located in the default installation folder:

    C:\Program Files (x86)\Microsoft SQL Server\90\Shared

    Click the Add button.

  5. Allow the SQL Server Application:

    Click the Allow another app... button.

  6. Click the Browse button.

    Browse to sqlserver.exe

    This is located in the default installation folder:

    C:\Program Files\Microsoft SQL Server\<Version and Edition>\MSSQL\Binn

    Version and Edition

    The Version and Edition folder depends on the installed SQL Server.

    For instance:

    • SQL Server 2012 (Express) is located within the folder MSSQL11.SQLEXPRESS
    • SQL Server 2017 (Express) is located within the folder MSSQL14.SQLEXPRESS

    Other versions and editions will be similarly named and cannot be confused with the other folders in the Microsoft SQL Server folder.

    Click the Add button.

  7. Click the OK button to save and apply the changes.


Knowledge Base Article Ref:KB13103002