I forgot my admin password but can't send password reset email

I forgot my main admin account password (maybe the username). Instance doesn’t seem properly configured to send emails. Where do I configure that? I have an SMTP server on the same server.

Also could I change the password in Postgres somehow?

How to reset the root password is written in the documentation