Opening Ports on Core Compute VMs

This tutorial will walk you through how to open ports on Core Compute VMs, and assumes you already have a Core Compute VM deployed.

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.

  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.

  1. sudo ufw status verbose

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

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:

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.

  1. 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.

  1. 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 >".

  1. Select "Allow the Connection" on the next menu, and click "Next >".

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

  1. 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.

Last updated

Was this helpful?