I don't know your full setup, but have you checked ufw settings regarding said port? AFAIK ubuntu has ufw enabled by default. You would need to do something like sudo ufw allow 5000.
sudo ufw allow 5000