Sql-server – How to connect to a SQL Server installed on Windows Server 2012 running on VPS

remotesql serversql-server-2016windows-server

I want to connect to my SQL server installed on a windows server 2012, that is running on a VPS(Virtual Private Server) remotely, I have done the following steps:

  • Enabling SQL Server to allow remote connections
  • SQL Server Configuration Manager>SQL Server Network Configuration>Protocols For MSSQLSERVER>TCP/IP Set Enabled
  • Create a new Inbound Rule for port 1443 in windows firewall

Still I cannot connect to SQL server remotely via SQL server management studio.

Thanks

Best Answer

In addition to using SQL Server Configuration Manager to enable TCP/IP connections, you need inbound tcp port 1433 and optionally udp port 1434 open at the firewall for SQL Server to accept inbound connections.

1433 is the default T-SQL tcp endpoint, and udp port 1434 is used by the SQL Server Discovery Protocol to locate SQL Server ports by the instance name, for example SQLSERVER\MYINSTANCE. If you are not using a named instance, 1434 is not required.

See this Microsoft Docs page for further details.