Port 1433 (SQL Server)

Port 1433 is the default port of Microsoft SQL Server, Microsoft's database.

Key facts

Port
1433
Protocols
TCP
Range
Registered port, 1024-49151
IANA service name
ms-sql-s

IANA assigns ports in this range to services on request, under RFC 6335.

About port 1433

Port 1433 is the default port of Microsoft SQL Server, Microsoft's database. Applications and management tools use it to connect to the Default Instance over TCP.

According to the Microsoft documentation, a Named Instance, an additional SQL Server instance identified by its own name, uses a dynamic port by default, and the SQL Server Browser service listens on UDP port 1434 and tells clients which port the instance is listening on. IANA registers port 1433 for the ms-sql-s service.

What port 1433 is used for

  • Websites and applications: ASP.NET applications and business applications connect to the database on port 1433, usually from the application server.
  • Database management: tools such as SQL Server Management Studio and sqlcmd connect to the same port.
  • Replication: according to the Microsoft documentation, replication connections use the database's regular ports, meaning port 1433 on the Default Instance.

When a Named Instance needs to pass through a firewall, Microsoft recommends giving it a fixed port, so the firewall rule doesn't stop matching after a restart.

Port 1433 in the firewall

The Microsoft documentation marks the option to allow access from any computer, including computers on the internet, as not recommended. When the application and the database are on the same server, keep port 1433 closed. When another application server needs access, allow it only from that server's address, for example in PowerShell as administrator:

  • New-NetFirewallRule -DisplayName "SQL Server from app" -Direction Inbound -Protocol TCP -LocalPort 1433 -RemoteAddress 203.0.113.10 -Action Allow

When you restrict access to specific addresses, also delete any earlier rule that opened the port to everyone, or that general rule will keep allowing access from any address.

On a Linux server running SQL Server, or when a Linux-based firewall protects the network:

  • UFW: ufw allow from 203.0.113.10 to any port 1433 proto tcp
  • firewalld: firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="203.0.113.10" port port="1433" protocol="tcp" accept'

Risks and security

A database that is open to the internet receives automated password-guessing attempts, mainly against the sa administrator account. Alongside restricting network access, a few simple settings protect the database:

  • Prefer Windows Authentication (signing in with a Windows account). If you also turn on SQL Server Authentication (signing in with a database username and password), disable the sa account or give it a long, unique password.
  • Create a separate user for each application, with permissions only on the database it needs.
  • Encrypt connections with TLS, especially when they travel over a network that isn't private.
  • Install SQL Server and Windows security updates regularly.
  • When you need access from changing addresses, connect through a VPN instead of opening the port to everyone.

Commands to check and configure

  • Test-NetConnection db.example.com -Port 1433

    Checks from a Windows computer whether port 1433 on the database server is open and reachable.

  • netstat -an | findstr :1433

    Checks in CMD that the server is listening on port 1433.

  • sqlcmd -S db.example.com,1433 -U appuser

    Connects to the database on the specified server and port as the user appuser. The password is prompted for separately.

  • New-NetFirewallRule -DisplayName "SQL Server from app" -Direction Inbound -Protocol TCP -LocalPort 1433 -RemoteAddress 203.0.113.10 -Action Allow

    Allows access to port 1433 in Windows Firewall only from the specified IP address (PowerShell as administrator).

  • ss -tlnp | grep ':1433 '

    On a Linux server running SQL Server, checks that the service is listening on port 1433 and on which address (requires root privileges).

  • ufw allow from 203.0.113.10 to any port 1433 proto tcp

    Allows access to port 1433 only from the specified IP address (UFW).

  • firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="203.0.113.10" port port="1433" protocol="tcp" accept'

    Allows access to port 1433 in firewalld only from the specified IP address. Then run firewall-cmd --reload.

Port 1433 in the IANA registry

Port Protocol Service IANA registry description
1433 TCP ms-sql-s Microsoft-SQL-Server
1433 UDP ms-sql-s Microsoft-SQL-Server

Data source: IANA Service Name and Transport Protocol Port Number Registry (opens in a new tab)

Port 1433 FAQ

Do I need to open port 1433 when the website and the database are on the same server?

No. When the application and the database are on the same server, the connection stays inside the server, and port 1433 remains closed in the firewall. Open it only for another server that needs to connect, and only for its IP address.

Why does the connection to a Named Instance fail?

A Named Instance uses a dynamic port by default, which the client discovers through the SQL Server Browser service on UDP port 1434. When that service or port is blocked, the connection fails. The simple fix is to give the instance a fixed port and specify it in the connection, for example db.example.com,1533.

How do I change the SQL Server port?

In SQL Server Configuration Manager, in the instance's TCP/IP protocol settings, enter the port you want and restart the service. Before the change, open the new port in the firewall, and update the applications' connection strings.

How do I manage SQL Server remotely and securely?

Allow port 1433 only from the administrators' IP addresses, or first connect to the server over a VPN or Remote Desktop, and manage the database from there. The PowerShell commands page has commands for managing Windows Firewall.

Shopping cart

Your cart is emptyYou can start with one of our popular plans.

Site search

Accessibility

Text size
100%
Accessibility statement