Skip to content

TechDirectArchive

Hands-on IT, Cloud, Security & DevOps Insights

  • Home
  • About
  • Advertise With US
  • Reviews
  • Contact
  • Toggle search form
Home » Oracle/MSSQL/MySQL » Configure SQL Server Instance to listen on a specific TCP Port
  • VMware vSphere
    Differences between vSphere and ESXi and vCenter Virtualization
  • disableFaceTime567u
    Sign out of FaceTime: How to disable or enable FaceTime on Mac Mac
  • 1 kAUgwdVYmcVgUSXiwUkObw
    Error 0x801c001d – Automatic registration failed: Failed to look up the registration service from AD Windows Server
  • Install SQL Server Management Studio 21 on Windows Server
    Install SQL Server Management Studio 21 on Windows Server Oracle/MSSQL/MySQL
  • Exchange
    Update Global Address List: Recognition Error Network | Monitoring
  • Windows Server vNext
    What’s New? Install Windows Server 2025 on Beelink EQ12 PC Windows
  • mbamclient
    How to deploy MBAM Client as part of a Windows Deployment Windows Server
  • Screenshot 2020 10 31 at 10.35.37
    How to set the PowerShell Execution Policy via Windows Registry Windows Server

Configure SQL Server Instance to listen on a specific TCP Port

Posted on 15/03/202424/10/2024 Christian By Christian No Comments on Configure SQL Server Instance to listen on a specific TCP Port
Configure-SQL-Server-to-listen-on-a-specific-TCP-port

In this blog post, we shall discuss how to Configure SQL Server Instance to listen on a specific TCP Port using SQL Server Configuration Manager. The default instance of Microsoft SQL Server listens on TCP Port 1433. This is the default port for communication between Microsoft SQL Server and its applications. Here is a similar article on Setup is unable to access the SQL UDP Port 1434 on the specified SQL Server, and how to enable or disable WinRM via the command-line.

Note: The Named instances of the Database Engine and SQL Server Compact are configured for dynamic ports. Because the Database Engine might change the selected port every time the SQL Server service starts.

This could present a challenge if there is a firewall between the application server and the SQL server, as is typically the case in most deployments. This is what we need to solve in this guide.

See the Concept of Ansible on Windows using Cygwin, how to change the default RDP port in Windows, and “Active Directory Ports: Service and network port requirements for Windows“.

SQL Server Firewall Rules

To ensure secure access to computer resources, it is crucial to properly configure firewall correctly. Failure to configure the firewall correctly can result in blocked attempts to connect to SQL Server. When connecting to a named instance through a firewall, it is advisable to configure your Windows Firewall to enable the appropriate ports for the database engine to listen on a specific port.

Use the Windows Firewall with Advanced Security MMC snap-in to view and configure all firewall profiles. The Windows Firewall item in Control Panel only configures the current profile.

Also, see how to create a Windows firewall rule on Windows, Remote WMI Connection: How to enable or disable WMI Traffic Using Firewall UI, and How to enable or disable a Remote WMI Connection in Windows.

Why Hardcode a specific Port?

To emphasize on what we have discussed above. The default instance of a SQL Server Database Engine listens on TCP port 1433. Named instances on the other hand are by configured by default to use dynamic ports.

This means that they select an available port when the SQL Server service is started. Because the port selected might change every time that the Database Engine is started. This can pose a bit of a challenge if there is a firewall between the application server and the SQL server, which in most deployments there will be

  • Also, for enhanced security. Most organisations and applications resort to changing the known standard port from 1433 to 1401 or something else. Keep in mind, TCP/IP permits port scanners to query open ports. Therefore the principle of changing the TCP/IP port is not a robust security measure.

Note: An alternative to configuring a named instance to listen on a fixed port is to create an exception in the firewall for a SQL Server program such as sqlservr.exe (for the Database Engine).

The port number won’t appear in the Local Port column of the Inbound Rules page when you’re using the Windows Firewall with Advanced Security MMC snap-in. It can be difficult to audit which ports are open. 

Configure Microsoft SQL Server Database Engine to Listen on a particular Port

Before proceeding with these steps, please note that if the Listen All setting on the Protocol tab is set to “Yes”. Then only TCP Port and TCP Dynamic Port values under the IPAll section will be used and individual IPn sections will be ignored in their entirety.

On the other hand, if the Listen All setting is set to “No”, then the TCP Port and TCP Dynamic Port settings under the IPAll section will be ignored and the TCP Port, TCP Dynamic Port, and Enabled settings on the individual IPn sections will be used instead.

Note: Each IPn section has an Enabled setting with a default value of “No” which causes SQL Server to ignore this IP address even if it has a port defined.

Start SQL Server Configuration Manager. Here is a similar issue: Setup is unable to access the SQL UDP Port 1434 on the specified SQL Server.

Launch configuration Manager
Launch configuration Manager

Expand SQL Server Network Configuration, select the Database Engine instance you want to edit (Protocols for <instance name>). Right-click or double-click TCP/IP.

Enable-TCPIP-for-SQL-Network-Configuration
TCPIP network Properties for SQL Server
TCPIP network Properties for SQL Server

Navigate to the IPAddress Tab as shown below.

TCPIP-Address-TAb

Hard code the TCP/IP Port

Like i said, I will ignore TCP/IP Properties dialog box in the format IP1, IP2 (IPn). As you can see, I have set the IPn section to enabled. As such, we have to work with the IPALL section. Enter your TCP ports as shown below.

dynamic-ports-are-ignored

In the console pane, select SQL Server Services. In the details pane, right-click SQL Server (<instance name>) and then select Restart, to stop and restart SQL Serve

restart-SQL-service

Note: The Database Engine begins listening on a new port when restarted.

However the SQL Server Browser service monitors the registry and reports the new port number as soon as the configuration is changed. Even though the Database Engine might not be using it. Restart the Database Engine to ensure consistency and avoid connection failures.

I hope you found this blog post on how to configure SQL Server Instance to listen on a specific TCP Port helpful. If you have any questions, please let me know in the comment session.

5/5 - (1 vote)

Thank you for reading this post. Kindly share it with others.

  • Click to share on X (Opens in new window) X
  • Click to share on Reddit (Opens in new window) Reddit
  • Click to share on LinkedIn (Opens in new window) LinkedIn
  • Click to share on Facebook (Opens in new window) Facebook
  • Click to share on Pinterest (Opens in new window) Pinterest
  • Click to share on Tumblr (Opens in new window) Tumblr
  • Click to share on Telegram (Opens in new window) Telegram
  • Click to share on WhatsApp (Opens in new window) WhatsApp
  • Click to share on Pocket (Opens in new window) Pocket
  • Click to share on Mastodon (Opens in new window) Mastodon
  • Click to share on Bluesky (Opens in new window) Bluesky
  • Click to share on Threads (Opens in new window) Threads
  • Click to share on Nextdoor (Opens in new window) Nextdoor
Oracle/MSSQL/MySQL Tags:Microsoft Windows, MsSQL, Windows Server 2016

Post navigation

Previous Post: How to upgrade Microsoft SQL Server 2019 to 2022
Next Post: How to upgrade Trellix ePolicy Orchestrator

Related Posts

  • Encryption
    How to encrypt Microsoft SQL Server Traffic Oracle/MSSQL/MySQL
  • images 5 1
    How to access MySQL Server from command Prompt Oracle/MSSQL/MySQL
  • how to Install SQL Server Management Studio on Windows Server
    Install SQL Server Management Studio 20 on Windows Server Oracle/MSSQL/MySQL
  • Enale FIPS compliance mode on Windows
    How to enable FIPS mode on Windows Server Oracle/MSSQL/MySQL
  • create a new Azure SQL Database
    How to create a new Azure SQL Database [PaaS] AWS/Azure/OpenShift
  • MSSQLlicensing
    Microsoft SQL Evaluation period has expired: How to upgrade SQL Server instance Oracle/MSSQL/MySQL

More Related Articles

Encryption How to encrypt Microsoft SQL Server Traffic Oracle/MSSQL/MySQL
images 5 1 How to access MySQL Server from command Prompt Oracle/MSSQL/MySQL
how to Install SQL Server Management Studio on Windows Server Install SQL Server Management Studio 20 on Windows Server Oracle/MSSQL/MySQL
Enale FIPS compliance mode on Windows How to enable FIPS mode on Windows Server Oracle/MSSQL/MySQL
create a new Azure SQL Database How to create a new Azure SQL Database [PaaS] AWS/Azure/OpenShift
MSSQLlicensing Microsoft SQL Evaluation period has expired: How to upgrade SQL Server instance Oracle/MSSQL/MySQL

Leave a Reply Cancel reply

You must be logged in to post a comment.

Microsoft MVP

VEEAMLEGEND

vexpert-badge-stars-5

Virtual Background

GoogleNews

Categories

veeaam100

sysadmin top30a

  • VMware vSphere
    Differences between vSphere and ESXi and vCenter Virtualization
  • disableFaceTime567u
    Sign out of FaceTime: How to disable or enable FaceTime on Mac Mac
  • 1 kAUgwdVYmcVgUSXiwUkObw
    Error 0x801c001d – Automatic registration failed: Failed to look up the registration service from AD Windows Server
  • Install SQL Server Management Studio 21 on Windows Server
    Install SQL Server Management Studio 21 on Windows Server Oracle/MSSQL/MySQL
  • Exchange
    Update Global Address List: Recognition Error Network | Monitoring
  • Windows Server vNext
    What’s New? Install Windows Server 2025 on Beelink EQ12 PC Windows
  • mbamclient
    How to deploy MBAM Client as part of a Windows Deployment Windows Server
  • Screenshot 2020 10 31 at 10.35.37
    How to set the PowerShell Execution Policy via Windows Registry Windows Server

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 1,839 other subscribers
  • RSS - Posts
  • RSS - Comments
  • About
  • Authors
  • Write for us
  • Advertise with us
  • General Terms and Conditions
  • Privacy policy
  • Feedly
  • Telegram
  • Youtube
  • Facebook
  • Instagram
  • LinkedIn
  • Tumblr
  • Pinterest
  • Twitter
  • mastodon

Tags

AWS Azure Bitlocker Microsoft Windows PowerShell WDS Windows 10 Windows 11 Windows Deployment Services Windows Server 2016

Copyright © 2025 TechDirectArchive

 

Loading Comments...
 

You must be logged in to post a comment.