From here: Configure SQL Server to listen on a specific TCP port - SQL Server | Microsoft Learn
If you have installed SQL Server 2022, you might find that you can't easily connect to the SQL Server remotely, even though you've set port 1433 as open in the firewall.
To fix this, open SQL Server Configuration Management. Note that if you have multiple SQL Instances on a single machine then you need to assign different ports. In my case I used 1433 for Production and 1434 for Development.
Assign a TCP/IP port number to the SQL Server Database Engine
-
In SQL Server Configuration Manager, in the console pane, expand SQL Server Network Configuration, select Protocols for <instance name>, and then in the right pane double-click TCP/IP.
-
In the TCP/IP Properties dialog box, on the IP Addresses tab, several IP addresses appear in the format IP1, IP2, up to IPAll. One of these entries is for the IP address of the loopback adapter, 127.0.0.1
. Additional IP addresses appear for each IP address on the computer. (You might see both IP version 4 and IP version 6 addresses.) Right-click each address, and then select Properties to identify the IP address that you want to configure.
-
If the TCP Dynamic Ports dialog box contains 0
, indicating the Database Engine is listening on dynamic ports, delete the 0
.

-
In the IP n Properties area box, in the TCP Port box, type the port number you want this IP address to listen on, and then select OK. Multiple ports might be specified by separating them with a comma. Select OK.
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 are used, and individual IP n sections are ignored in their entirety. If the Listen All setting is set to No, then the TCP Port and TCP Dynamic Port settings under the IPAll section are ignored, and the TCP Port, TCP Dynamic Port, and Enabled settings on the individual IP n sections are used instead.
Each IP n 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.
-
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 Server.