> ## Documentation Index
> Fetch the complete documentation index at: https://kb.hostcloud.in/llms.txt
> Use this file to discover all available pages before exploring further.

# Allow a program or port through Windows Firewall

> Open a port on your Windows VPS safely with Windows Defender Firewall.

Windows Defender Firewall blocks incoming connections that you haven't allowed. If you install software that others need to reach, such as a website or a database, you need to add a rule for it. This guide shows you how.

> [!WARNING]
>
> Never turn the firewall off, and never remove the Remote Desktop rule. If you lock yourself out, click **Console** on the server panel in the Client Area to reach your server from your browser.

## Add a rule

**1. Open the firewall settings**

[Connect to your server with Remote Desktop](/windows-vps/connect-with-remote-desktop.md). Press **Windows + R**, type `wf.msc` and press **Enter**. **Windows Defender Firewall with Advanced Security** opens.

**2. Start a new inbound rule**

Click **Inbound Rules** on the left, then **New Rule** on the right.

**3. Choose Port**

Choose **Port** and click **Next**.

**4. Enter the port**

Choose **TCP** (unless your software says UDP), and enter the port number under **Specific local ports**, for example `443`. Click **Next**.

**5. Allow the connection**

Choose **Allow the connection** and click **Next**.

**6. Choose when it applies**

Leave **Domain**, **Private** and **Public** ticked, and click **Next**. On a VPS, your network connection is usually treated as public.

**7. Name it**

Give the rule a clear name, such as `Website HTTPS`, and click **Finish**.

The rule works straight away.

## Common ports

| Software | Port |
| - | - |
| Website (HTTP) | `80` (TCP) |
| Website (HTTPS) | `443` (TCP) |
| Microsoft SQL Server | `1433` (TCP) |
| Remote Desktop | Already allowed. Don't change it |

> [!TIP]
>
> Only open a database port (such as `1433`) to the IP addresses that need it. In the rule's **Properties**, open the **Scope** tab and add those addresses under **Remote IP address**.

## Use PowerShell instead

Open **PowerShell** as administrator and run, for example:

```powershell theme={null}
New-NetFirewallRule -DisplayName "Website HTTPS" -Direction Inbound -Protocol TCP -LocalPort 443 -Action Allow
```

To remove that rule later:

```powershell theme={null}
Remove-NetFirewallRule -DisplayName "Website HTTPS"
```

## Firewall tab in the Client Area

You can also attach a firewall from the **Firewall** tab on your server panel. It filters traffic before it reaches your server. If you use it as well, a connection must be allowed in both places.

Still stuck? [Open a ticket](/support/open-a-ticket.md) with your server's IP address and the port you're trying to open.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.