How to Open Ports in Oracle Cloud

Opening a port will let users on the public web to access your server through this “gate” of sorts, learn how to open ports from the Oracle Cloud Dashboard.

Oracle cloud’s virtual network and systems can be a bit confusing at times, but follow this guide, and it’ll all be explained.

If you are using Ubuntu, see the section “Troubleshooting” below!

Using the Oracle Cloud Dashboard

Firstly, head over to the Oracle Cloud Dashboard

Click on the instance you would like to change:

Instances Dashboard

Click on the text after “Subnet:”

Instance Details Dashboard

Click on the security list

Virtual Subnet Dashboard

Click on “Add Ingress Rules”:

Ingress Rules for Security Lists – specific to each virtual subnet

Set up as below, and press “Add Ingress Rules”

  • Source Type – CIDR
  • Source CIDR – 0.0.0.0/0
  • IP Protocol – TCP
  • Source Port Range – 80,443 (or any port based on your need)
  • Destination Port Range – 80,443 (or any port based on your need)
  • Description (Optional) – anything

These settings will open ports 80 and 443 (for HTTP and HTTPS traffic) from any source, as represented by the CIDR 0.0.0.0/0. This will be over the TCP protocol, and if you would like to use UDP select that in the “IP Protocol” dropdown. (the dropdown also contains many other common ports that you might want to open, so check that out as well!)

The main interface for opening ports

Congrats! Your ports are now open.

Troubleshooting

On Ubuntu, I’ve noticed a strange problem, which can be fixed with the following code.

Run the following code, replacing “PORT” with the port of your choosing

sudo iptables -I INPUT 6 -m state --state NEW -p tcp --dport PORT -j ACCEPT
sudo netfilter-persistent save

This will open the port and refresh the netfilter – so that the port is open (this is a strange problem that only seems to happen on Ubuntu Oracle VMs).

Happy coding!

The post How to Open Ports in Oracle Cloud appeared first on Jiuyu's Guide.