# Change RDP Port

{% hint style="info" %}
**INFO:**&#x20;

Changing the default port for Remote Desktop Protocol (RDP) can provide an additional layer of security for your system
{% endhint %}

Open Registry Editor from the Run Prompt (**windows key + R**) :

<figure><img src="/files/YWyXg90VG6te3zMWX3Yh" alt=""><figcaption></figcaption></figure>

Locate and then click the following registry subkey :

```
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\TerminalServer\WinStations\RDP-Tcp\PortNumber

```

<figure><img src="/files/R7hpWAtnlLel9CypJSZt" alt=""><figcaption></figcaption></figure>

On the Edit menu, click "**Decimal**", edit "3389" to Your Custom Port Number, and then Click "**OK**" :

<figure><img src="/files/7akSkP32QCKDB4Psw1So" alt=""><figcaption></figcaption></figure>

{% hint style="warning" %}
**You Need To Open New TCP RDP Port**&#x20;

See [Open Ports (Port Forwarding)](/windows-server/open-ports-port-forwarding.md)
{% endhint %}

Open "**Services**" from the Run Prompt (**windows key + R**) :

<figure><img src="/files/1yIlzNSuTCmfXgYIMxqv" alt=""><figcaption></figcaption></figure>

Restart "**Remote Desktop Services**" Service :&#x20;

<figure><img src="/files/BSIPWe7YxtzWfBVg4QzV" alt=""><figcaption></figcaption></figure>

You will now be able to log back into the server with the new RDP port.

<br>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.snghosting.com/windows-server/change-rdp-port.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
