If you have blocked ports you can open them easily with ufw by running the following command:
x: can be any valid port number
y: can be tcp or udp
And to enable it:
I'm pretty sure ufw is installed by default in any Ubuntu installation. BTW, it's a easy way to have basic firewall protection in your computer.
Hope it helps!