ubuntu server firewall open port code example Example 1: firewall allow port ubuntu sudo ufw allow 2222 Example 2: ubuntu open port sudo ufw allow 1191/tcp