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
  • How to upgrade to SQL Server 2025
    SQL Server 2025 Upgrade Requirements and Compatibility Oracle/MSSQL/MySQL
  • Retrict access to external storage
    Restrict access to removable Storage Drives [Part 2] Windows
  • screenshot 2020 03 13 at 20.24.17
    How to view installed packages in Cygwin Windows
  • Featured image Unblock Microsoft Store
    How to Unblock Microsoft Store on Windows 11 Windows
  • unionfsfeature
    How to Overlay two files with UnionFs in a Linux System Linux
  • macos 10 14
    How to Launch macOS Activity Monitor from the Utility and Terminal Mac
  • Screenshot 2021 09 02 at 20.08.14
    Service Principal Name: How to add or reset and delete SPNs Windows
  • Microsoft Enterprise Root Certification Authority and Forest Domain to Azure migration
    Migrate Microsoft Enterprise Root Certification Authority and Forest Domain to Azure AWS/Azure/OpenShift

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.

  • Share on X (Opens in new window) X
  • Share on Reddit (Opens in new window) Reddit
  • Share on LinkedIn (Opens in new window) LinkedIn
  • Share on Facebook (Opens in new window) Facebook
  • Share on Pinterest (Opens in new window) Pinterest
  • Share on Tumblr (Opens in new window) Tumblr
  • Share on Telegram (Opens in new window) Telegram
  • Share on WhatsApp (Opens in new window) WhatsApp
  • Share on Pocket (Opens in new window) Pocket
  • Share on Mastodon (Opens in new window) Mastodon
  • Share on Bluesky (Opens in new window) Bluesky
  • Share on Threads (Opens in new window) Threads
  • 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

  • Database Collation
    Change SQL Database Collation: ePO events DB and SQL server should match with ePO core collation Oracle/MSSQL/MySQL
  • Migrate from SQL Database
    Migrate Veeam One Database from SQL Server 2017 to 2025 Backup
  • xp cmdshell MSSQL
    How to verify whether the xp_cmdshell feature is enabled or disabled in MSSQL Server Oracle/MSSQL/MySQL
  • Screenshot 2020 06 23 at 10.52.52
    How to uninstall Microsoft SQL Server on Windows Oracle/MSSQL/MySQL
  • oracle q4 earnings are in e28094 but what does it really mean 700x425 1
    How to uninstall Oracle Database 11G or 12c Oracle/MSSQL/MySQL
  • MSSQLlicensing
    Microsoft SQL Evaluation period has expired: How to upgrade SQL Server instance Oracle/MSSQL/MySQL

More Related Articles

Database Collation Change SQL Database Collation: ePO events DB and SQL server should match with ePO core collation Oracle/MSSQL/MySQL
Migrate from SQL Database Migrate Veeam One Database from SQL Server 2017 to 2025 Backup
xp cmdshell MSSQL How to verify whether the xp_cmdshell feature is enabled or disabled in MSSQL Server Oracle/MSSQL/MySQL
Screenshot 2020 06 23 at 10.52.52 How to uninstall Microsoft SQL Server on Windows Oracle/MSSQL/MySQL
oracle q4 earnings are in e28094 but what does it really mean 700x425 1 How to uninstall Oracle Database 11G or 12c Oracle/MSSQL/MySQL
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

  • How to upgrade to SQL Server 2025
    SQL Server 2025 Upgrade Requirements and Compatibility Oracle/MSSQL/MySQL
  • Retrict access to external storage
    Restrict access to removable Storage Drives [Part 2] Windows
  • screenshot 2020 03 13 at 20.24.17
    How to view installed packages in Cygwin Windows
  • Featured image Unblock Microsoft Store
    How to Unblock Microsoft Store on Windows 11 Windows
  • unionfsfeature
    How to Overlay two files with UnionFs in a Linux System Linux
  • macos 10 14
    How to Launch macOS Activity Monitor from the Utility and Terminal Mac
  • Screenshot 2021 09 02 at 20.08.14
    Service Principal Name: How to add or reset and delete SPNs Windows
  • Microsoft Enterprise Root Certification Authority and Forest Domain to Azure migration
    Migrate Microsoft Enterprise Root Certification Authority and Forest Domain to Azure AWS/Azure/OpenShift

Subscribe to Blog via Email

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

Join 1,825 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.