etstat lists sockets and connections. On recent Ubuntu the recommended tool is ss (from iproute2); both show which ports are open.
Steps
Install net-tools (netstat) if you need it; ss is usually already there:
sudo apt updatesudo apt install -y net-tools iproute2TCP/UDP listeners with netstat:
sudo netstat -tulpnSame view with ss (faster on current kernels):
sudo ss -tulpnEstablished connections on a given port:
sudo ss -tpn sport = :443
Tips
- Prefer
ssin new scripts; netstat remains useful for older tutorials. - Combine with lsof when you need the exact binary path that is listening.
ext step
etwork and firewall under your control: Deploy your Cloud VPS.