How do I connect to remote SQL Server using SSMS? I know this is a classic question, but i can’t seem to find any solution.

I created an Ubuntu 16.04 LEMP droplet and installed SQL Server Linux by following this example. I have tried connecting using sqlcmd -S localhost -U sa -P mypassword command, it works.

However, when I tried connecting using SSMS it gave me error: “A network-related or instance-specifi error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: TCP Provider, error: 0 - The wait operation timed out.) (Microsoft SQL Server, Error: 258)

Note: I have set my firewall to allow incoming traffic on port for 1433 TCP

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer

Hey friend!

I think it’s a bit outside of the intended use of the software, but there may be ways to force it to function. I’ve never done it, but I gravitate to confident answers and this one seemed pretty confident to me:


Hoping it helps :)


  • Hello, thanks for your reply. What I’m trying to do is to use ssms to connect to mssql (linux) not mysql. I’ve been tinkering for a while and I think the problem is on the firewall.

    What I did:

    • On Networking tab at Droplet dashboard, I allow incoming traffic on port 1433
    • On my server, I allow port 1433 using sudo ufw allow 1433 command

    To confirm the port is open, I did the following:

    • On my server (DO droplet/ubuntu), I checked the port using nmap <my-server-ip> command. It showed that port 22 (ssh), 80(http), and 1433(ms-sql-s) are open.
    • On my laptop (Win 10), I checked using nmap <my-server-ip> command, but it only showed port 22 (ssh) and 80 (http) are open. Port 1433 is not detected.

    Do you have any idea how I can open that port?