Can you connect to the database from the mongo cli client? If not, them you're using the wrong credentials.

Additionally, I recommend following the official NodeBB docs: https://docs.nodebb.org/installing/os/ubuntu/

Third party tutorials can be outdated or incorrect.