To make sure which ports are open on your server firewall, run this command:
sudo ufw status
This will give you a list like this:
To Action From -- ------ ---- 22 ALLOW Anywhere 80 ALLOW Anywhere 22 (v6) ALLOW Anywhere (v6) 80 (v6) ALLOW Anywhere (v6)
Make sure that your port is listed there. Port 80 is used for all normal web traffic (non ssl) and port 22 is used for SSH / SFTP.
You can open new ports by using the command:
sudo ufw allow 22
So this will open whatever port you add after the allow keyword.
Make sure that you open minimum numbers of ports as each open port means increased security risk.
Also, make sure that you enable the same ports on your server or hosting provider. For example Google Cloud Console (gcc) and Amazon Web Services (aws) have ports turned off by default and you might have to open them in their settings too.