For the first issue. It looks like your on the wrong server? Should be on Mattermost-Server for running the platform command. Also you should do cd mattermost/bin
then run ./platform
. The platform binary is in the mattermost/bin
directory.
For the second issue, are you running psql on the DB server? You should run it there.