# Opening Ports on Core Compute VMs

All TensorDock Core Compute VMs enjoy per-VM dedicated IPs. This allows your machine to enjoy a full range of ports, further streamlining your workflow.

## For Linux-based VMs (Optional):

**By default, all ports on your Linux VMs are open, and UFW is disabled.** \
The following steps are for securing your VM with the UFW firewall, to help protect your VM. \
\
If you choose to use UFW to whitelist ports, **please always ensure you forward port 22**. Failure to do so can lock you out of your VM with no access back in.&#x20;

1. Log into your VM (ssh user\@ip)
2. ```
   sudo ufw enable
   ```
3. ```
   sudo ufw allow <port_number>
   ```

Ensure you replace \<port\_number> with the port you want to open. For example, `80` for HTTP, `443` for HTTPS, `22` for SSH.&#x20;

4. ```
   sudo ufw status verbose
   ```

The final step will show you a list of all your existing rules, including your newly added port forward. \ <br>

### Additional optional commands for Linux:

#### Opening a port using a specific protocol:

```
sudo ufw allow <port_number>/<protocol>
```

Replace \<protocol> with TCP or UDP. \
Syntax:

```
sudo ufw allow 22/tcp
```

#### Opening a range of ports using a specific protocol:

```
sudo ufw allow <start_port>:<end_port>/<protocol>
```

Replace \<protocol> with TCP or UDP, and replace the \<start\_port> and \<end\_port> with your appropriate port range. \
Syntax:&#x20;

```
sudo ufw allow 50000:50010/udp
```

## For Windows-based VMs:

Opening ports on your Windows-based VMs requires the use of Windows Firewall.

1. Search for "Windows Firewall" and open **Windows Defender Firewall with Advanced Security.**&#x20;

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

2. On the left-hand bar, click "**Inbound Rule**" and then click "**New Rule..."** on the right-hand bar side. You should get a window pop-up as shown.&#x20;

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

3. Select "**Port**" on the pop-up menu, and click "**Next >**". Next, select the desired protocol (only one can be selected at a time, a duplicate rule must be created if both protocols are desired), and then select "**Specific local ports**" and enter the port you'd like to open. Click "**Next >**".<br>

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

4. Select **"Allow the Connection**" on the next menu, and click "**Next >**".&#x20;

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

5. Ensure all boxes are checked in the preceding menu and click "**Next >**".

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

6. Add a name for your new rule and a description if you wish. Click "**Finish**" and verify that the rule has been added to your firewall.&#x20;

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


---

# 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.tensordock.com/virtual-machines/opening-ports-on-core-compute-vms.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.
