Oracle Cloud Open Port – A Step-by-Step Guide
In a cloud environment, an essential step for accessing resources and services from the internet is the open cloud port, and the Oracle Cloud Infrastructure (OCI) is no different. It offers a secure environment and explicitly requires port opening.
In this article, we’ll provide a step-by-step guide on how to open ports in Oracle Cloud, specifically on Ubuntu.
How to Open Ports in Oracle Cloud on Ubuntu:
- Log in to your Ubuntu instance in Oracle Cloud using SSH.
- Check the firewall status by running the following command:
luaCopy codesudo ufw status
- If the firewall is not enabled, run the following command to enable it:
bashCopy codesudo ufw enable
- To open a port, run the following command, replacing
<port>
with the port number you want to open:
bashCopy codesudo ufw allow <port>/tcp
For example, if you want to open port 80, run the following command:
bashCopy codesudo ufw allow 80/tcp
- After running the command, verify that the port has been opened by running the following command:
luaCopy codesudo ufw status
- Restart the firewall to apply the changes by running the following command:
Copy codesudo ufw reload
- You can also open a range of ports by running the following command, replacing
<start port>
and<end port>
with the range of ports you want to open:
phpCopy codesudo ufw allow <start port>:<end port>/tcp
For example, to open ports from 8000 to 9000, run the following command:
bashCopy codesudo ufw allow 8000:9000/tcp
- To block a port, run the following command, replacing
<port>
with the port number you want to block:
bashCopy codesudo ufw deny <port>/tcp
- After running the command, verify that the port has been blocked by running the following command:
luaCopy codesudo ufw status
Opening ports in Oracle Cloud Infrastructure (OCI) is essential for accessing resources and services from the internet.
Following the step-by-step guide, you can open and close ports on Ubuntu in OCI. Remember always to check the firewall status and verify that the port has been opened or blocked after running the commands.
By taking these steps, you can ensure that your resources and services in OCI are accessible only to authorized users and devices.