How to open Windows Firewall ports on your VPS

Print
  • 0

Windows Firewall controls which inbound connections are allowed into your Windows VPS. If you install a game server, web service, database, or remote tool, you may need to allow its port before players or users can connect.

Only open the ports your software actually needs. Opening extra ports increases the amount of traffic that can reach the VPS.

 

Open a port with PowerShell

  1. Connect to the Windows VPS using Remote Desktop or the VPS console.
  2. Open PowerShell as Administrator.

    Windows VPS with PowerShell open

  3. Run a command like this, replacing 7777 with the port you need:
New-NetFirewallRule -DisplayName "Allow TCP 7777" -Direction Inbound -Protocol TCP -LocalPort 7777 -Action Allow

For a UDP port, change -Protocol TCP to -Protocol UDP:

New-NetFirewallRule -DisplayName "Allow UDP 7777" -Direction Inbound -Protocol UDP -LocalPort 7777 -Action Allow

Some game servers need more than one port. Add one rule per port/protocol, or use a comma-separated list if the same protocol applies to all of them:

New-NetFirewallRule -DisplayName "Allow Game Ports" -Direction Inbound -Protocol UDP -LocalPort 7777,7778,27015 -Action Allow

 

Check the port

Start the software that listens on the port, then test from outside the VPS. A firewall rule alone does not make a port respond; the service must also be running and listening on that port.

If your VPS also has a panel firewall plan applied, make sure the panel firewall allows the same port as well. Windows Firewall and panel-level firewall rules can both affect access.


Was this answer helpful?

Related Articles

« Back

Follow us on Social Media

Stay in the loop! Follow our social media accounts and stay up-to-date with the latest news, announcements, tips & tricks and behind-the-scenes insights!