The default instance of Microsoft SQL Server (protocol TDS) listens on port 1433/TCP. Named instances usually use dynamic ports instead; the SQL Server Browser service on 1434/UDP tells clients which port belongs to which instance. The port can be set in SQL Server Configuration Manager under TCP/IP.
Do not open it to the internet. Exposed SQL Servers are constantly scanned for weak passwords, especially on the sa account. Allow only app servers or use a VPN, prefer Windows authentication, protect sa with a strong password or disable it, and encrypt connections.
Typical error: "A network-related or instance-specific error" – the TCP/IP protocol is not enabled on the instance (e.g. SQL Server Express), the firewall blocks 1433, or the instance name is missing. After enabling it, restart the service.
Check
sqlcmd -S db.example.com,1433 -U app -Q "SELECT @@VERSION"