Linux firewall rules control which inbound connections can reach services on your VPS. Open only the ports your software needs, and make sure the service is running before testing from outside.
Ubuntu or Debian with UFW
Allow a TCP port:
sudo ufw allow 7777/tcp
Allow a UDP port:
sudo ufw allow 7777/udp
Check status:
sudo ufw status
AlmaLinux, Rocky Linux, or Oracle Linux with firewalld
sudo firewall-cmd --permanent --add-port=7777/tcp sudo firewall-cmd --reload
For UDP, replace tcp with udp. If your VPS also has a panel firewall plan, allow the same ports there too.
