UFW manages incoming connections on Ubuntu through firewall rules. Allowing a port does not start an application; the application must also listen on the same port and protocol.
1. Preserve existing access
Inspect sudo ufw status verbose. Before enabling UFW, allow your actual SSH port and keep the panel console accessible.
2. Allow the required port
For example, use sudo ufw allow 25565/tcp for TCP port 25565. Replace this example with your application’s port and protocol; avoid unnecessary open ports.
3. Verify
List the rules again. If UFW is inactive, verify the SSH rule before running sudo ufw enable. Test from an external connection and check any provider firewall as well.








